pretzel generated noweb filter segfaults
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pretzel (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: pretzel
Using pretzel 2.0n-2-0.3 on Jaunty amb64, with the attached cee.fg.patch
If I try to build a noweb C filter, like this:
pretzel-it -i -d -n cee noweave-c-filter
and then run it against the attached fullexample.nw file (in two parts to aid debugging):
$ cat ./fullexample.nw | noweave -delay -index -filter 'tee /tmp/pre.nwf' - > /dev/null
$ ./noweave-c-filter < /tmp/pre.nwf
then I get a segfault after the first chunk has been output, the last few lines of console output being:
force{}\mathin {\it hp}={\it hp}\to{\it left}\mathout ;\pretzelforce{}/* look at next item of the list */\pretzeloutde
@nl
@literal \end{ppcode}
Segmentation fault
gdb reports:
Program received signal SIGSEGV, Segmentation fault.
0x00007fa986436243 in free () from /lib/libc.so.6
(gdb) bt
#0 0x00007fa986436243 in free () from /lib/libc.so.6
#1 0x0000000000409a9f in prettyprint ()
#2 0x00000000004079ef in pretty (getline=0x4076d0 <get_stripped>, in=0x7fa9867286a0, putline=0x407710 <put_stripped>, out=0x7fa986728780, make_pp=0x407600 <make_pp>, cl=0x7fff8f0f7440) at pretty.nw:107
#3 0x0000000000407c27 in main (argc=<value optimized out>, argv=<value optimized out>) at pretty.nw:236
Other files report errors like:
*** glibc detected *** ./noweave-c-filter: free(): invalid pointer: 0x00000000013fd9b8 ***
======= Backtrace: =========
/lib/libc.
/lib/libc.
./noweave-
./noweave-
./noweave-
/lib/libc.
./noweave-
======= Memory map: ========
00400000-00410000 r-xp 00000000 08:06 9077609 /home/sam/
0060f000-00610000 r--p 0000f000 08:06 9077609 /home/sam/
00610000-00611000 rw-p 00010000 08:06 9077609 /home/sam/
013fd000-0141e000 rw-p 013fd000 00:00 0 [heap]
7fb208000000-
7fb208021000-
7fb20c119000-
7fb20c281000-
7fb20c481000-
7fb20c485000-
7fb20c486000-
7fb20c48b000-
7fb20c4a1000-
7fb20c6a1000-
7fb20c6a2000-
7fb20c6a3000-
7fb20c727000-
7fb20c926000-
7fb20c927000-
7fb20c928000-
7fb20ca19000-
7fb20cc19000-
7fb20cc20000-
7fb20cc22000-
7fb20cc35000-
7fb20ce2e000-
7fb20ce4f000-
7fb20ce54000-
7fb20ce55000-
7fff14e40000-
or double frees.
I'm personally not interested in this bug anymore as I've re-written noweave in awk and am using latex lstlistings for pretty printing.