Opened 19 years ago

Last modified 18 years ago

#61 closed defect (fixed)

OMC dies (SIGSEGV) on malformed within statement

Reported by: x05andre Owned by: x05andre
Priority: critical Milestone:
Component: Version:
Keywords: Cc: x05andre, Adrian Pop

Description


Change History (2)

comment:1 by x05andre, 19 years ago

When loading a file (loadFileInteractiveQualified) with this content:

within ;
package root_package
end root_package;

OMC dies with a segmentation fault.

I'm running OMC revision 2149.

The following is the output from gdb:

[x05andre@pan2 Compiler]$ gdb ./omc
GNU gdb Red Hat Linux (6.3.0.0-1.84rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db
library "/lib/libthread_db.so.1".

(gdb) run +d=interactive
Starting program: /home/x05andre/ex/omc-build/omc/Compiler/omc +d=interactive
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xb18000
[Thread debugging using libthread_db enabled]
[New Thread -1208162624 (LWP 30108)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208162624 (LWP 30108)]
0x0819cd0d in Interactiveupdate_5fprogram ()
(gdb) bt
#0 0x0819cd0d in Interactive
update_5fprogram ()
#1 0x0842d98f in lit2 ()
#2 0x00000000 in ?? ()

comment:2 by Adrian Pop, 18 years ago

Fixed it in revision 2515
within walker.g by adding a null test for "name".

within_clause returns [void *ast]
{

void * name= 0;

}

: #(WITHIN (name = name_path)? )

{

/* name_path is optional and before was no null test */
if (name == 0)

ast = Absyn_TOP;

else

ast = AbsynWITHIN(name);

}

;

Note: See TracTickets for help on using tickets.