Opened 2 years ago

Closed 12 months ago

#347 closed defect - code aborts (fixed)

save line list segfaults if wrong comment character used

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

Description

the attached will segfault quickly. The problem is that it uses % as a comment character rather than #.

Best would be to accept the same comment characters as the rest of the code. This is described in Hazy1 3.2.10 and coded at input.cpp:42.

if we only want to # then we should trap the user mistake and give a helpful comment.

Attachments (2)

linelist.in (49 bytes) - added by Gary J. Ferland 2 years ago.
input file
linelist.dat (86 bytes) - added by Gary J. Ferland 2 years ago.
the data file with the comment character

Download all attachments as: .zip

Change History (5)

Changed 2 years ago by Gary J. Ferland

Attachment: linelist.in added

input file

Changed 2 years ago by Gary J. Ferland

Attachment: linelist.dat added

the data file with the comment character

comment:1 Changed 2 years ago by peter

Component: etcinput parser
Type: defect - convergencedefect - code aborts

The segfault is caused by the code on lines 504-510 of parser.cpp@10734, more in particular the last line of that section. This code has two deficiencies. 1 - when the parser detects a syntax error it only prints an error message, but does not inform the caller. 2 - After it detects the syntax error, it then proceeds as if no syntax error had happened and accesses valstack[0] anyway. Problem 2 is easy to solve, but for problem 1, further discussion is required. Should the code inform the caller of the problem so that it can take appropriate action, or should it abort, or should it even do something else?

comment:2 Changed 2 years ago by rjrw

Fixed at r10735 -- code now prints diagnostic and halts.

comment:3 Changed 12 months ago by mchatzikos

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.