whizard is hosted by Hepforge, IPPP Durham

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#146 closed defect (fixed)

Segfault on invalid tokens

Reported by: Christian Speckner Owned by: kilian
Priority: P1 Milestone:
Component: core Version: 2.0.0rc1
Severity: minor Keywords:
Cc:

Description

WHIZARD segfaults when it encounters invalid tokens. To reproduce, just enter "?" in interactive mode. Backtrace:

#0  0xb7d87da7 in token_is_valid (token=Cannot access memory at address 0x4
) at parser.f90:253
#1  0xb7d84a12 in parse_node_get_token_ptr (node=Cannot access memory at address 0x0
) at parser.f90:617
#2  0xb7d84c40 in parse_node_get_string (node=Cannot access memory at address 0x0
) at parser.f90:599
#3  0xb7f30923 in cmd_var_compile (var=0x80b8ab0, pn=..., global=...) at commands.f90:2161
#4  0xb7f39360 in command_compile (command=0x809c0f8, pn=..., global=...) at commands.f90:1453
#5  0xb7f09306 in command_list_compile (cmd_list=..., pn=..., global=...) at commands.f90:5372
#6  0xb7f46a4b in whizard_process_stream (stream=..., lexer=..., quit=3221214852, quit_code=0) at whizard.f90:190
#7  0xb7f46806 in whizard_shell (quit_code=0) at whizard.f90:231
#8  0xb7fcfff2 in MAIN__ () at main.f90:224
#9  0xb7fd094f in main (argc=2, argv=0xbfffea93 '/home/pestix/physik/local/svn/whizard/trunk/install/bin/whizard\000') at main.f90:29
#10 0x7ad6ba51 in __libc_start_main () from /lib/libc.so.6
#11 0x08048511 in _start ()

Change History (3)

comment:1 Changed 14 years ago by Juergen Reuter

Priority: P4P1

comment:2 Changed 14 years ago by kilian

Resolution: fixed
Status: newclosed

This is a generic problem with interactive mode: the Fatal Errors of batch mode are all downgraded to ordinary Error, so the WHIZARD shell can resume its command loop. However, a fatal error occurs if something goes utterly wrong, so recovery may be difficult. In this case, it was a syntax error which left the parse tree in some undefined state. If Fortran had exception handling, avoiding this problem would be simple ...

In non-interactive mode, the program would intentionally stop with a Fatal Error message.

I fixed this particular case [1579], but there may be many more of this kind. Please report them, but they need not get high priority.

comment:3 Changed 14 years ago by Juergen Reuter

Milestone: v2.0.0final

Milestone v2.0.0final deleted

Note: See TracTickets for help on using tickets.