mpictor/StepClassLibrary — Issue #101: fedex_plus segfault
Author: mpictor
Created: 2011-11-13 01:13:26+00:00
State: open

Backtrace

$ gdb --args bin/fedex_plus ../test/causes_crash.exp
GNU gdb (GDB) 7.2-debian
...
Reading symbols from /opt/step/scl/build/bin/fedex_plus...done.
(gdb) r
Starting program: /opt/step/scl/build/bin/fedex_plus ../test/causes_crash.exp
fedex_plus: /opt/step/scl/src/express/hash.c:362: HASHsearch: Assertion `CurrentSegment != ((void *)0)' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff6ea8405 in raise (sig=) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
in ../nptl/sysdeps/unix/sysv/linux/raise.c
(gdb) bt
#0 0x00007ffff6ea8405 in raise (sig=) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00007ffff6eab680 in abort () at abort.c:92
#2 0x00007ffff6ea15b1 in __assert_fail (assertion=0x7ffff79c78f9 "CurrentSegment != ((void *)0)",
file=, line=362, function=0x7ffff79c7917 "HASHsearch") at assert.c:81
#3 0x00007ffff79bd2b2 in HASHsearch (table=0x64000a, item=0x7fffffffc840, action=HASH_FIND)
at /opt/step/scl/src/express/hash.c:362
#4 0x00007ffff79bcbae in DICTlookup (dictionary=0x64000a, name=0x6bc5c0 "END_ENTITY")
at /opt/step/scl/src/express/dict.c:182
#5 0x00007ffff79baa18 in SCANprocess_identifier_or_keyword () at /opt/step/scl/src/express/lexact.c:332
#6 0x00007ffff79afd6c in yylex () at expscan.l:361
#7 0x00007ffff79aa294 in yyparse () at /opt/step/scl/build/src/express/expparse.c:2380
#8 0x00007ffff79bf7ad in PARSERrun (filename=0x6b74b0 "../test/causes_crash.exp", fp=0x6b7250)
at /opt/step/scl/src/express/express.c:435
#9 0x00007ffff79bf6fa in EXPRESSparse (model=0x673330, fp=0x6b7250,
filename=0x6b74b0 "../test/causes_crash.exp") at /opt/step/scl/src/express/express.c:415
#10 0x0000000000408fcb in main (argc=2, argv=0x7fffffffe1f8) at /opt/step/scl/src/express/fedex.c:278

Schema

(*
_Every_ change I have made to the commented-out WR1 line below has caused fedex_plus to not abort,
with one exception.

Changing the following causes fedex_plus to generate code:
- number of spaces between -- and WR1
- shortening the names of any of the entities referenced in SIZEOF

This causes an error to be printed before the crash:
- Removing the last letter of CHARACTERIZED_PRODUCT_DEFINITION causes fedex_plus to print a different error
*)

SCHEMA comment_causes_crash;

ENTITY crash_me;
-- WR1: SIZEOF(['AP210_ELECTRONIC_ASSEMBLY_INTERCONNECT_AND_PACKAGING_DESIGN_MIM_LF.CHARACTERIZED_PRODUCT_DEFINITION', 'AP210_ELECTRONIC_ASSEMBLY_INTERCONNECT_AND_PACKAGING_DESIGN_MIM_LF.CHARACTERIZED_OBJECT'] * TYPEOF(SELF\property_definition.definition)) > 0;
END_ENTITY;

END_SCHEMA;

Changing the last part of the comment to the following affects output in the same way as deleting the last letter of CHARACTERIZED_PRODUCT_DEFINITION.

This causes an error to be printed before the crash:
- Removing the last letter of CHARACTERIZED_PRODUCT_DEFINITION causes fedex_plus to print
"fedex_plus: /opt/step/scl/src/express/hash.c:362: HASHsearch: Assertion `CurrentSegment != ((void *)0)' failed."
instead of simply "Aborted"