Opened 8 years ago

Closed 7 years ago

Last modified 5 years ago

#143 closed defect - failed assert (fixed)

table read no longer verifies input gracefully, throws assert instead

Reported by: Gary J. Ferland Owned by: nobody
Priority: blocker Milestone: c13 release
Component: input parser Version: trunk
Keywords: Cc:

Description (last modified by peter)

the test suite includes the test func_trans_punch.in to create a transmitted continuum data file called func_trans_punch.trn, and a second test func_trans_read.in which reads it in.

the transmitted continuum file may be damaged or come from an inappropriate version of cloudy. the table read command used to verify the continuum file before trying any operations on it. there were print statements which would try to explain what it found wrong.

I used a damaged transmitted continuum file - the code now throws an assert. to see this do the following:

run func_trans_punch to create func_trans_punch.trn

edit func_trans_punch.trn and delete some continuum point in the middle. i deleted two for good measure.

run func_trans_read - it will throw an assert with no indication of what was wrong.

user input data must be treated as a dangerous source of noise - anything can come in. the code should validate the input and explain what was wrong. it should not crash because of invalid input data.

this was broken since c08 - i tried the same thing with c08 and it performs correctly - here is the output:

 DISASTER ReadTable: The energy mesh of the file read in by the TABLE READ command does not agree with this version of Cloudy.
 DISASTER ReadTable: Was the file generated by an older version of the code?
 DISASTER ReadTable: Did the first model do more than one iteration, but the LAST option was missing on PUNCH LAST TRANSMITTED CONTINUUM?
 DISASTER ReadTable: Number of points read in= 3830
 ReadTable: input, internal energies=  7.0310e+06  6.6214e+06
 [Stop in ReadTable at ../cont_ffun.cpp:453, something went wrong]

Change History (6)

comment:1 Changed 7 years ago by Gary J. Ferland

2010 aug 08, at r4118

table read does not throw an assert but rather emits this unhelpful message if the energy grid does not agree:

PROBLEM DISASTER Photon number sum in QINTR is 0.000e+00 This source has no ionizing radiation, and the number of ionizing photons was specified. This was continuum source number 0 Sorry, but I cannot go on. ANU and FLUX arrays follow. Enjoy.

1.00e-08 0.00e+00 1.01e-08 0.00e+00 1.01e-08 0.00e+00 1

comment:2 Changed 7 years ago by peter

This bug has been fixed on the trunk in r4173.

comment:3 Changed 7 years ago by peter

Description: modified (diff)

comment:4 Changed 7 years ago by peter

Description: modified (diff)

The bug-fix in r4173 on the trunk was amended in r4180 to also include the energy grid resolution scale factor in the output so that that can be tested. This was overlooked in the initial fix.

comment:5 Changed 7 years ago by peter

Resolution: fixed
Status: newclosed

The bug fix was merged to c10_branch in r4182.

comment:6 Changed 5 years ago by Ryan Porter

Milestone: C10 releasec13 release

Milestone C10 release deleted

Note: See TracTickets for help on using tickets.