[antlr-interest] Bug in 64bit C backend

Jason Nielsen jdn at math.carleton.ca
Wed Jul 30 14:59:22 PDT 2008


Hello,

I believe there is a bug in the 64 bit version of the C backend runtime since 
using the 32bit version works as expected (or it could be that I've done 
something foolish that works in 32 bit mode and not in 64 bit). I've attached a 
tar.gz with code that illustrates the problem and was as simple as I could make 
it.  The output is also below for your convenience.

With regards,
Jason


VERSION
=====================================================================
ANTLR Parser Generator  Version 3.1b2 (July 17, 2008)  1989-2008

OUTPUT
=====================================================================
Nodes: (VAR_DEF char c) (VAR_DEF int x) (FUNC_DECL (FUNC_HDR void bar (ARG_DEF 
int x))) (FUNC_DEF (FUNC_HDR int foo (ARG_DEF int y) (ARG_DEF char d)) (BLOCK 
(VAR_DEF int i) (for (= i 0) (< i 3) (= i (+ i 1)) (BLOCK (= x 3) (= y 5)))))
*** glibc detected *** ./a.out: free(): invalid pointer: 0x0000000000412888 ***
======= Backtrace: =========
/lib/libc.so.6[0x2aea72f24b0a]
/lib/libc.so.6(cfree+0x8c)[0x2aea72f286fc]
./a.out[0x40fd8f]
./a.out[0x400d94]
./a.out[0x400ca5]
/lib/libc.so.6(__libc_start_main+0xf4)[0x2aea72ed0b44]
./a.out[0x400bf9]
======= Memory map: ========
00400000-0041b000 r-xp 00000000 08:16 20414825 /home/jdn/work/antlr/test/a.out
0061a000-0061c000 rw-p 0001a000 08:16 20414825 /home/jdn/work/antlr/test/a.out
0061c000-006f9000 rw-p 0061c000 00:00 0 [heap]
2aea72c95000-2aea72cb2000 r-xp 00000000 08:15 2195523 /lib/ld-2.6.1.so
2aea72cb2000-2aea72cb6000 rw-p 2aea72cb2000 00:00 0
2aea72eb1000-2aea72eb3000 rw-p 0001c000 08:15 2195523 /lib/ld-2.6.1.so
2aea72eb3000-2aea73005000 r-xp 00000000 08:15 2195970 /lib/libc-2.6.1.so
2aea73005000-2aea73204000 ---p 00152000 08:15 2195970 /lib/libc-2.6.1.so
2aea73204000-2aea73207000 r--p 00151000 08:15 2195970 /lib/libc-2.6.1.so
2aea73207000-2aea73209000 rw-p 00154000 08:15 2195970 /lib/libc-2.6.1.so
2aea73209000-2aea7320f000 rw-p 2aea73209000 00:00 0
2aea7320f000-2aea7321c000 r-xp 00000000 08:15 2195522 /lib/libgcc_s.so.1
2aea7321c000-2aea7341c000 ---p 0000d000 08:15 2195522 /lib/libgcc_s.so.1
2aea7341c000-2aea7341d000 rw-p 0000d000 08:15 2195522 /lib/libgcc_s.so.1
2aea74000000-2aea74021000 rw-p 2aea74000000 00:00 0
2aea74021000-2aea78000000 ---p 2aea74021000 00:00 0
7fff37e00000-7fff37e15000 rw-p 7fff37e00000 00:00 0 [stack]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vdso]
Aborted (core dumped)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.tar.gz
Type: application/octet-stream
Size: 2274 bytes
Desc: 
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20080730/000dbf74/attachment.obj 


More information about the antlr-interest mailing list