whizard is hosted by Hepforge, IPPP Durham

Opened 15 years ago

Closed 15 years ago

Last modified 14 years ago

#19 closed task (fixed)

memory corruption issues in WHIZARD 1

Reported by: Christian Speckner Owned by: Christian Speckner
Priority: P3 Milestone:
Component: core Version: 1.93
Severity: normal Keywords: memory corruption
Cc:

Description (last modified by ohl)

Analyse corruption of WHIZARD 1 structures using compiler options and the valgrind.

Change History (12)

comment:1 Changed 15 years ago by Christian Speckner

You might want to look at the patches that I checked into my 1.93_fix_corruption branch. These address a couple of memory corruption issues that can be found via compiler switches (or valgrind). However, they are just workarounds which don't really fix the issues.

comment:2 Changed 15 years ago by Juergen Reuter

Summary: memory leak analysis of WHIZARD 1memory corruption investigation for WHIZARD 1

comment:3 Changed 15 years ago by ohl

Description: modified (diff)
Keywords: corruption added; leak analysis removed
Reporter: changed from Juergen Reuter to Christian Speckner
Summary: memory corruption investigation for WHIZARD 1memory corruption issues WHIZARD 1

comment:4 Changed 15 years ago by ohl

Summary: memory corruption issues WHIZARD 1memory corruption issues in WHIZARD 1

comment:5 Changed 15 years ago by ohl

Owner: changed from ALL to Christian Speckner

comment:6 Changed 15 years ago by Christian Speckner

Status: newassigned

comment:7 Changed 15 years ago by Juergen Reuter

Milestone: v1.9xv1.94

comment:8 Changed 15 years ago by Christian Speckner

OK, reset :) I've restarted working on this from the 1.xx branch. Two of my previous fixes already have been included by JR, comprising of

  • A bounds violation in init_beam_polarization caused by the dimensionality of rho_hel vs. rho_vector
  • A bounds violation when writing HEPEVT output (with an spurious field written in the output).

r1826 fixes another bounds violation in vamp_apply_equivalences - the previous code assumed the same grid size for all channels, not only for those connected by an equivalence. Actually, this is funny as the absence of this issue in W2 reveals another bug there: it seems the equivalences are not applied there correctly, and the broken code never gets called :) I'll open a separate ticked for this...

Now, only two issues remain on my list:

  • A bounds violation in guess_color_flow
  • Dito in whizard_event.

comment:9 Changed 15 years ago by Christian Speckner

The issue in whizard_events is fixed in r1827. mc_process_index is frequently looped over from 1 to mc_number_prcesses, leaving it set to mc_number_processes + 1. Workaround by setting it to mc_number_processes after every such loop.

comment:10 Changed 15 years ago by Christian Speckner

The guess_color_flow issue is fixed in r1828. For some reason, col_flow and acl_flow were created with the second index going from 1 to n_flv_out, while guess_color_flow iterated from 1 to n_flv (which makes perfect sense for me), so I am now allocating them as 1:n_flv. Of course, it may be that I just don't understand the logic behind the algorithm, but as the color flow information in event files is known to be broken for flavor sums anyway, I guess no big harm is going to come out of this fix.

What remains are some complaints from valgrind about "jump or move depending on uninitialized memory", but I have a feeling of this being linked to the way gfortran implements the passing of optional parameters. In any case, unless anyone complains about unpredictable, gross misbehavior of WHIZARD (which hasn't happened so far), this is probably fine and not worth the pain of hunting it down.

comment:11 Changed 15 years ago by Christian Speckner

Resolution: fixed
Status: assignedclosed

OK, I've run a bunch of checks both with 1.93 and the current 1.xx trunk; apart from some segfaults with 1.93, both version behave similarly for me - closing the ticked.

comment:12 Changed 14 years ago by Juergen Reuter

Milestone: v1.94

Milestone v1.94 deleted

Note: See TracTickets for help on using tickets.