[Aldor-l] Debug information
Pippijn van Steenhoven
pip88nl at gmail.com
Wed Dec 12 03:14:31 EST 2007
Hi, I collected some information that might help finding bugs.
1. Axllib testsuite
1.1 default8.as
- Message: Warning: hard assertion failed, file
/home/pippijn/rona/aldor/src/aldor/fint.c line 3559: (type ==
FOAM_Clos || type == FOAM_Word ) && (expr.fiClos != (FiClos) 0)
- Description: This test seems to trigger a compiler bug and it seems
to be known. In the sources, we can see the #if WorkAround condition
which leads to a working version of the program when asserted.
Compiling it to native code triggers the same error but without a nice
assertion failure. It just segfaults.
1.2 depend1.as
- Message: Warning: hard assertion failed, file
/home/pippijn/rona/aldor/src/aldor/fint.c line 3559: (type ==
FOAM_Clos || type == FOAM_Word ) && (expr.fiClos != (FiClos) 0)
- Description: I'm not sure how to interpret the code in this test. It
seems to export a function Z that returns a type. That makes sense,
because at the end, Z is used in a type context. I don't see a
definition of that function, though, so that might be the problem.
With TestErrorsToo asserted, I get the same output as depend1.E from
the source tree shows. Same as above: segmentation fault.
1.3 forn2.as
- Message: /usr/bin/ld: errno: TLS definition in /lib/libc.so.6
section .tbss mismatches non-TLS reference in forn2.o
- Description: This obviously only happens when compiling and might be
specific to my system. I have no idea what it means, some of you
might.
1.4 object1.as
- Message: Test 1: Program fault (segmentation violation).#1 (Error)
Program fault (segmentation violation).
- Description: As you can see, the program does run until Test 1. This
"Test 1" comes from the aldor code, so compilation succeeds, running
fails. Debugging reveals:
0x00002b2907564ac6 in fintEval (retDataObj=0x7fffa3868a00) at
/home/pippijn/rona/aldor/src/aldor/fint.c:4262
4262 fintSet(type, retDataObj, ((DataObj)(expr.fiRec))[slot]);
(gdb) p expr.fiRec
$2 = 0xe5a <Address 0xe5a out of bounds>
Memory corruption?
1.5 parse4.as
- Message: Warning: hard assertion failed, file
/home/pippijn/rona/aldor/src/aldor/fint.c line 3559: (type ==
FOAM_Clos || type == FOAM_Word ) && (expr.fiClos != (FiClos) 0)
- Description: The closure pointer is NULL. I'm not sure how that
happens, but it happens a lot and might just be an error in the aldor
source (parse4.as). Either way, though, I would say it is
inappropriate for a runtime to crash trying to run a program.
1.6
2. Runtime
The above tests were done with the following command line options when
compiling the runtime: -Q3 -Qinline-all -Qno-cc -Z db -Wcheck -Wtrap
-Wruntime
The tests themselves were compiled with the same flags but without
-Wruntime. This optimisation of the runtime code seems to be crucial.
Without those, every single file I try to run (whether compiled or
interpreted) fails with a segmentation fault and an expr.fiClos of
NULL.
3. GDB output
This is some gdb output from the NULL closures issue:
------------ BEGIN GDB OUTPUT ------------
Starting program: /home/pippijn/rona/aldor/obj/bin/aldor -g interp depend1.as
[Thread debugging using libthread_db enabled]
Warning: hard assertion failed, file
/home/pippijn/rona/aldor/src/aldor/fint.c line 3559: (type ==
FOAM_Clos || type == FOAM_Word ) && (expr.fiClos != (FiClos) 0)
[New Thread 0x2ac2a439dcf0 (LWP 3362)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x2ac2a439dcf0 (LWP 3362)]
0x00002ac2a33c14a4 in fintEval (retDataObj=0x7fff07a09d60) at
/home/pippijn/rona/aldor/src/aldor/fint.c:3560
3560 prog0 = (ProgInfo) expr.fiClos->prog;
(gdb) bt
#0 0x00002ac2a33c14a4 in fintEval (retDataObj=0x7fff07a09d60) at
/home/pippijn/rona/aldor/src/aldor/fint.c:3560
#1 0x00002ac2a33bc789 in fintStmt (retDataObj=0x7fff07a09f40) at
/home/pippijn/rona/aldor/src/aldor/fint.c:1628
#2 0x00002ac2a33d179f in fintExecMainUnit () at
/home/pippijn/rona/aldor/src/aldor/fint.c:6457
#3 0x00002ac2a33d1dd3 in fintFile (fname=0x642df0) at
/home/pippijn/rona/aldor/src/aldor/fint.c:6617
#4 0x00002ac2a33b89af in emitInterp (argc1=0, argv1=0x6250c0) at
/home/pippijn/rona/aldor/src/aldor/emit.c:1228
#5 0x00002ac2a339a7d7 in compFilesLoop (argc=0, argv=0x6250c0) at
/home/pippijn/rona/aldor/src/aldor/axlcomp.c:519
#6 0x00002ac2a3399a43 in compCmd (argc=4, argv=0x6250a0) at
/home/pippijn/rona/aldor/src/aldor/axlcomp.c:133
#7 0x0000000000400660 in main (argc=4, argv=0x7fff07a0a1a8) at
/home/pippijn/rona/aldor/src/frontend/main.c:15
(gdb) bt full
#0 0x00002ac2a33c14a4 in fintEval (retDataObj=0x7fff07a09d60) at
/home/pippijn/rona/aldor/src/aldor/fint.c:3560
par = {_fiNil = 0xa0fdd0 " _\232", fiWord = 10550736, fiArb =
10550736, fiPtr = 0xa0fdd0 " _\232", fiBool = 10550736, fiByte = 208
'Ð', fiHInt = -560, fiSInt = 10550736, fiChar = 208 'Ð', fiArr =
0xa0fdd0 " _\232", fiRec = 0xa0fdd0 " _\232",
fiTR = 0xa0fdd0 " _\232", fiProgPos = 10550736, fiClos = 0xa0fdd0,
fiEnv = 0xa0fdd0, fiBInt = 0xa0fdd0 " _\232", fiSFlo = 1.47847302e-38,
fiDFlo = 5.2127561959404902e-317, fiProg = 0xa0fdd0, fiFluid =
0xa0fdd0, ptr = 0xa0fdd0, labels = 0xa0fdd0, progInfo = 0xa0fdd0,
fiUnit = 0xa0fdd0, mFmt = 0xa0fdd0}
retType = 8
env = (FiEnv) 0x9a5f40
sp0 = (DataObj) 0x982180
nFluids = 0
denv = 50 '2'
prog0 = (ProgInfo) 0xa33880
oldStack = (DataObj) 0x982120
fmt = 1
tag = 78
argc = 4
n = 1
expr = {_fiNil = 0x0, fiWord = 0, fiArb = 0, fiPtr = 0x0, fiBool = 0,
fiByte = 0 '\0', fiHInt = 0, fiSInt = 0, fiChar = 0 '\0', fiArr = 0x0,
fiRec = 0x0, fiTR = 0x0, fiProgPos = 0, fiClos = 0x0, fiEnv = 0x0,
fiBInt = 0x0, fiSFlo = 0, fiDFlo = 0, fiProg = 0x0, fiFluid = 0x0, ptr
= 0x0, labels = 0x0, progInfo = 0x0, fiUnit = 0x0, mFmt = 0x0}
type = 30
myType = 15
#1 0x00002ac2a33bc789 in fintStmt (retDataObj=0x7fff07a09f40) at
/home/pippijn/rona/aldor/src/aldor/fint.c:1628
fmt = 1
tag = 78
argc = 13
n = 0
expr = {_fiNil = 0xa0fde0 "Ð_\232", fiWord = 10550752, fiArb =
10550752, fiPtr = 0xa0fde0 "Ð_\232", fiBool = 10550752, fiByte = 224
'à', fiHInt = -544, fiSInt = 10550752, fiChar = 224 'à', fiArr =
0xa0fde0 "Ð_\232", fiRec = 0xa0fde0 "Ð_\232", fiTR = 0xa0fde0
"Ð_\232", fiProgPos = 10550752, fiClos = 0xa0fde0, fiEnv = 0xa0fde0,
fiBInt = 0xa0fde0 "Ð_\232", fiSFlo = 1.47847526e-38, fiDFlo =
5.2127641009908237e-317, fiProg = 0xa0fde0, fiFluid = 0xa0fde0, ptr =
0xa0fde0, labels = 0xa0fde0, progInfo = 0xa0fde0, fiUnit = 0xa0fde0,
mFmt = 0xa0fde0}
stmtPos = 579
myType = 10682368
#2 0x00002ac2a33d179f in fintExecMainUnit () at
/home/pippijn/rona/aldor/src/aldor/fint.c:6457
frobnitz = {tag = 10681764, next = 0x0, target = 140733321354928,
value = 10681774, nStates = 2, states = 0xa0f530, machineState =
{{__jmpbuf = {6664808, -452908983475634668, 0, 140733321355680, 0, 0,
-452908983425303020, 6038685633184923156}, __mask_was_saved = 0,
__saved_mask = {__val = {10357376, 140733321354992, 47015450617213,
140733321354992, 15135790016010974555, 4294967297, 10357376, 10357376,
4294967366, 30064771079, 10699280, 140733321355088, 47015450616766,
15135790013272293376, 1, 4294967296}}}}}
state = (FiState) 0x7fff07a09e20
__fmt = 4
exn = 0
expr = {_fiNil = 0x976570 " \001\230", fiWord = 9921904, fiArb =
9921904, fiPtr = 0x976570 " \001\230", fiBool = 9921904, fiByte = 112
'p', fiHInt = 25968, fiSInt = 9921904, fiChar = 112 'p', fiArr =
0x976570 " \001\230", fiRec = 0x976570 " \001\230", fiTR = 0x976570 "
\001\230", fiProgPos = 9921904, fiClos = 0x976570, fiEnv = 0x976570,
fiBInt = 0x976570 " \001\230", fiSFlo = 1.39035488e-38, fiDFlo =
4.9020719077348475e-317, fiProg = 0x976570, fiFluid = 0x976570, ptr =
0x976570, labels = 0x976570, progInfo = 0x976570, fiUnit = 0x976570,
mFmt = 0x976570}
type = 140733321355136
denv = 5 '\005'
nFluids = 0
ok = 9921424
oldCompFintBreakHandler = (OsSignalHandler) 0
oldCompFintFaultHandler = (OsSignalHandler) 0
#3 0x00002ac2a33d1dd3 in fintFile (fname=0x642df0) at
/home/pippijn/rona/aldor/src/aldor/fint.c:6617
u = (FintUnit) 0x933e00
lib = (Lib) 0x914520
#4 0x00002ac2a33b89af in emitInterp (argc1=0, argv1=0x6250c0) at
/home/pippijn/rona/aldor/src/aldor/emit.c:1228
emitExecName = (FileName) 0x642df0
#5 0x00002ac2a339a7d7 in compFilesLoop (argc=0, argv=0x6250c0) at
/home/pippijn/rona/aldor/src/aldor/axlcomp.c:519
i = 1
iargc = 3
totErrors = 0
nErrors = 0
fn = (FileName) 0x642d78
isSolo = 1
#6 0x00002ac2a3399a43 in compCmd (argc=4, argv=0x6250a0) at
/home/pippijn/rona/aldor/src/aldor/axlcomp.c:133
echo = 0
#7 0x0000000000400660 in main (argc=4, argv=0x7fff07a0a1a8) at
/home/pippijn/rona/aldor/src/frontend/main.c:15
No locals.
------------ END OF GDB OUTPUT ------------
If anyone needs more information, please contact me. I am able to
reliably reproduce all errors on all systems I tried, but I am very
curious whether other people also get these errors. If you can't
reproduce it, I can try to provide a test environment, but I am not
sure whether I can do that.
Aldor is a great language by design and the compiler code is quite
clean. I'd love to continue working with it and I'd love to be able to
help fix bugs or to be enlightened on these issues if they are not
actually bugs.
Regards,
--
Pippijn van Steenhoven
More information about the Aldor-l
mailing list