#813 closed defect (fixed)
Rescan commands segfaults due to missing model pointer
Reported by: | Juergen Reuter | Owned by: | Juergen Reuter |
---|---|---|---|
Priority: | P1 | Milestone: | v2.5.0 |
Component: | core | Version: | 2.4.0 |
Severity: | normal | Keywords: | |
Cc: |
Description
Using the attached SINDARIN and LHE file, i.e. doing a rescan without an integration, leads to a segfault/runtime error with the following error message:
Runtime Error: hep_events.f90, line 117: Reference to disassociated POINTER MODEL Program terminated by fatal error hep_events.f90, line 117: Error occurred in HEP_EVENTS:HEPEUP_TO_EVENT eio_lhef.f90, line 594: Called by EIO_LHEF:EIO_LHEF_INPUT_EVENT event_streams.f90, line 271: Called by EVENT_STREAMS:EVENT_STREAM_ARRAY_INPUT_EVENT simulations.f90, line 1927: Called by SIMULATIONS:SIMULATION_READ_EVENT_ES_ARRAY simulations.f90, line 1775: Called by SIMULATIONS:SIMULATION_RESCAN commands.f90, line 4668: Called by COMMANDS:CMD_RESCAN_EXECUTE commands.f90, line 5835: Called by COMMANDS:COMMAND_LIST_EXECUTE whizard.f90, line 348: Called by WHIZARD:WHIZARD_PROCESS_STREAM whizard.f90, line 323: Called by WHIZARD:WHIZARD_PROCESS_FILE main.f90, line 415: Called by MAIN
Attachments (2)
Change History (12)
Changed 8 years ago by
Attachment: | rescan.sin added |
---|
Changed 8 years ago by
Attachment: | file_with_generated_events.lhe added |
---|
LHE file used for producing the error.
comment:1 Changed 8 years ago by
Owner: | changed from kilian to Juergen Reuter |
---|---|
Priority: | P3 → P1 |
Status: | new → assigned |
comment:2 Changed 8 years ago by
There is more behind the lines. In principle, a user could think of just using something like:
n_events = 100 sample_format = lhef ?write_raw = false ?read_raw = false $sample = "new_rescanned_file" rescan "file_with_generated_events" (proc) { $rescan_input_format = "lhef" }
just to convert an event file. This leads to undefined behaviour, like variables not being set. Investigating. So defining the process(es) for which that event file has been generated is the minimum requirement for this to work. Question is what the intention is for this ticket: just to catch runtime errors and point the user to improper/unintended usage or make it possible to use WHIZARD as a converter for event files? Comments welcome.
comment:3 Changed 8 years ago by
Well first of all Whizard should not segfault.
Secondly, why can't I use Whizard as a converter for event files? I mean maybe setup a dummy process but in principle for the supported read in and write out formats, this should work, right?
comment:4 Changed 8 years ago by
WHIZARD should not segfault, true. The way it is implemented at the moment, doesn't allow what you want. One had to bypass several things. I'm not sure that this is possible with the infrastructure at the moment. At the moment, the rescan is really attached to the simulation. Maybe one would have to write a converter independently from the rest of the infrastructure. Let me try to understand the missing model pointer first.
comment:5 Changed 8 years ago by
Crucial observation is that if the parameter use_process
in simulation_rescan
is set to true, then things work out, and the event file is (partially) successfully rescanned. However, sqrt(s) is not set properly.
Main question is, shall we trigger a use_process = .true.
here or not.
comment:6 Changed 8 years ago by
Just doing an init-only version of the integrate_process
does not do the job,
as WHIZARD really needs the process pointer of all entries of simulation_t to be set.
Where can this be done?
comment:7 Changed 8 years ago by
Setting the process and process_instance pointer with dummy arguments still gives the following RT error:
Runtime Error: beams.f90, line 496: ALLOCATABLE BEAM_DATA%PMATRIX is not currently allocated Program terminated by fatal error beams.f90, line 496: Error occurred in BEAMS:BEAM_INIT sf_base.f90, line 881: Called by SF_BASE:SF_CHAIN_INIT instances.f90, line 1836: Called by INSTANCES:PROCESS_INSTANCE_SETUP_SF_CHAIN instances.f90, line 1537: Called by INSTANCES:PROCESS_INSTANCE_INIT simulations.f90, line 695: Called by SIMULATIONS:ENTRY_SET_PROCESS_PTR simulations.f90, line 1483: Called by SIMULATIONS:SIMULATION_SET_PROCESS_PTR commands.f90, line 4701: Called by COMMANDS:CMD_RESCAN_EXECUTE commands.f90, line 5877: Called by COMMANDS:COMMAND_LIST_EXECUTE whizard.f90, line 348: Called by WHIZARD:WHIZARD_PROCESS_STREAM whizard.f90, line 323: Called by WHIZARD:WHIZARD_PROCESS_FILE main.f90, line 415: Called by MAIN Aborted (core dumped)
comment:8 Changed 8 years ago by
Proposed solution: if rescan in the sense of just converting event files is used, then I do a dry integration run, i.e. call integrate_process with the init_only flag and put it on the global stack under its process id. Then the conversion works. Any objections? [of course, I still have to safeguard against no process being defined at all]
comment:9 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Resolved in r7871. We actually do a dry run (init_only) call of integrate_process in order to have a valid process pointer. Some of the data like cross section, error, and sqrts are not correctly set. This might still be improved if met by a perfectionist, but the intent of avoiding the segmentation fault is fulfilled. Note that now indeed a process has to be defined,because otherwise WHIZARD will throw an error that it cannot find the process in the process library. Also sqrts has to be set for the sake of integrate_process.
SINDARIN file triggering the runtime error