Discussion:
[Bug-apl] Crash on )copy
Kacper Gutowski
2017-05-06 10:26:38 UTC
Permalink
Having two )copy commands in loaded or copied APL script aborts the
interpreter in r940.

Consider trivial files a.apl and b.apl consisting respectively of

a.apl:
⍝!
)copy b
)copy b

b.apl:
⍝!

Then trying to load a.apl yields the following:

)copy a
DUMPED 2017-05-06 12:05:19 (GMT+2)
DUMPED 2017-05-06 12:05:17 (GMT+2)
DUMPED 2017-05-06 12:05:17 (GMT+2)
*** Error in `src/apl': double free or corruption (fasttop): 0x000056176aa177f0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x70bcb)[0x7ff807b8abcb]
/lib/x86_64-linux-gnu/libc.so.6(+0x76f96)[0x7ff807b90f96]
/lib/x86_64-linux-gnu/libc.so.6(+0x7778e)[0x7ff807b9178e]
src/apl(_ZN9Workspace9load_DUMPERSoRK11UTF8_stringi7LX_modebP17UCS_string_vector+0x687)[0x56176918cd17]
src/apl(_ZN9Workspace7copy_WSERSo6LibRefRK10UCS_stringR17UCS_string_vectorb+0xbc)[0x56176918dedc]
src/apl(_ZN7Command8cmd_COPYERSoR17UCS_string_vectorb+0x96)[0x561769058a66]
src/apl(_ZN7Command14do_APL_commandERSoR10UCS_string+0x1ed)[0x56176906629d]
src/apl(_ZN7Command12process_lineER10UCS_string+0x4c)[0x561769066d1c]
src/apl(_ZN7Command12process_lineEv+0x7f)[0x561769066e1f]
src/apl(_ZN9Workspace19immediate_executionEb+0x3d)[0x5617691858ad]
src/apl(main+0x35)[0x56176901e065]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0x7ff807b3a2b1]
src/apl(_start+0x2a)[0x5617690239da]
======= Memory map: ========
561768f95000-5617691f3000 r-xp 00000000 08:05 48234866 /home/ztest/tmp/apl/src/apl
5617693f3000-56176940f000 r--p 0025e000 08:05 48234866 /home/ztest/tmp/apl/src/apl
56176940f000-561769412000 rw-p 0027a000 08:05 48234866 /home/ztest/tmp/apl/src/apl
561769412000-5617694a3000 rw-p 00000000 00:00 0
56176a9b6000-56176aa49000 rw-p 00000000 00:00 0 [heap]
7ff800000000-7ff800021000 rw-p 00000000 00:00 0
7ff800021000-7ff804000000 ---p 00000000 00:00 0
7ff807b1a000-7ff807caf000 r-xp 00000000 08:01 133316 /lib/x86_64-linux-gnu/libc-2.24.so
7ff807caf000-7ff807eae000 ---p 00195000 08:01 133316 /lib/x86_64-linux-gnu/libc-2.24.so
7ff807eae000-7ff807eb2000 r--p 00194000 08:01 133316 /lib/x86_64-linux-gnu/libc-2.24.so
7ff807eb2000-7ff807eb4000 rw-p 00198000 08:01 133316 /lib/x86_64-linux-gnu/libc-2.24.so
7ff807eb4000-7ff807eb8000 rw-p 00000000 00:00 0
7ff807eb8000-7ff807ece000 r-xp 00000000 08:01 132780 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ff807ece000-7ff8080cd000 ---p 00016000 08:01 132780 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ff8080cd000-7ff8080ce000 r--p 00015000 08:01 132780 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ff8080ce000-7ff8080cf000 rw-p 00016000 08:01 132780 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ff8080cf000-7ff8081d2000 r-xp 00000000 08:01 133376 /lib/x86_64-linux-gnu/libm-2.24.so
7ff8081d2000-7ff8083d1000 ---p 00103000 08:01 133376 /lib/x86_64-linux-gnu/libm-2.24.so
7ff8083d1000-7ff8083d2000 r--p 00102000 08:01 133376 /lib/x86_64-linux-gnu/libm-2.24.so
7ff8083d2000-7ff8083d3000 rw-p 00103000 08:01 133376 /lib/x86_64-linux-gnu/libm-2.24.so
7ff8083d3000-7ff808545000 r-xp 00000000 08:02 1966764 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7ff808545000-7ff808745000 ---p 00172000 08:02 1966764 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7ff808745000-7ff80874f000 r--p 00172000 08:02 1966764 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7ff80874f000-7ff808751000 rw-p 0017c000 08:02 1966764 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7ff808751000-7ff808755000 rw-p 00000000 00:00 0
7ff808755000-7ff808769000 r-xp 00000000 08:01 133438 /lib/x86_64-linux-gnu/libnsl-2.24.so
7ff808769000-7ff808969000 ---p 00014000 08:01 133438 /lib/x86_64-linux-gnu/libnsl-2.24.so
7ff808969000-7ff80896a000 r--p 00014000 08:01 133438 /lib/x86_64-linux-gnu/libnsl-2.24.so
7ff80896a000-7ff80896b000 rw-p 00015000 08:01 133438 /lib/x86_64-linux-gnu/libnsl-2.24.so
7ff80896b000-7ff80896d000 rw-p 00000000 00:00 0
7ff80896d000-7ff808992000 r-xp 00000000 08:01 131558 /lib/x86_64-linux-gnu/libtinfo.so.5.9
7ff808992000-7ff808b92000 ---p 00025000 08:01 131558 /lib/x86_64-linux-gnu/libtinfo.so.5.9
7ff808b92000-7ff808b96000 r--p 00025000 08:01 131558 /lib/x86_64-linux-gnu/libtinfo.so.5.9
7ff808b96000-7ff808b97000 rw-p 00029000 08:01 131558 /lib/x86_64-linux-gnu/libtinfo.so.5.9
7ff808b97000-7ff808bb8000 r-xp 00000000 08:01 131264 /lib/x86_64-linux-gnu/libncurses.so.5.9
7ff808bb8000-7ff808db8000 ---p 00021000 08:01 131264 /lib/x86_64-linux-gnu/libncurses.so.5.9
7ff808db8000-7ff808db9000 r--p 00021000 08:01 131264 /lib/x86_64-linux-gnu/libncurses.so.5.9
7ff808db9000-7ff808dba000 rw-p 00022000 08:01 131264 /lib/x86_64-linux-gnu/libncurses.so.5.9
7ff808dba000-7ff808dd2000 r-xp 00000000 08:01 133471 /lib/x86_64-linux-gnu/libpthread-2.24.so
7ff808dd2000-7ff808fd1000 ---p 00018000 08:01 133471 /lib/x86_64-linux-gnu/libpthread-2.24.so
7ff808fd1000-7ff808fd2000 r--p 00017000 08:01 133471 /lib/x86_64-linux-gnu/libpthread-2.24.so
7ff808fd2000-7ff808fd3000 rw-p 00018000 08:01 133471 /lib/x86_64-linux-gnu/libpthread-2.24.so
7ff808fd3000-7ff808fd7000 rw-p 00000000 00:00 0
7ff808fd7000-7ff808fda000 r-xp 00000000 08:01 133375 /lib/x86_64-linux-gnu/libdl-2.24.so
7ff808fda000-7ff8091d9000 ---p 00003000 08:01 133375 /lib/x86_64-linux-gnu/libdl-2.24.so
7ff8091d9000-7ff8091da000 r--p 00002000 08:01 133375 /lib/x86_64-linux-gnu/libdl-2.24.so
7ff8091da000-7ff8091db000 rw-p 00003000 08:01 133375 /lib/x86_64-linux-gnu/libdl-2.24.so
7ff8091db000-7ff8091fe000 r-xp 00000000 08:01 132934 /lib/x86_64-linux-gnu/ld-2.24.so
7ff8093db000-7ff8093e2000 rw-p 00000000 00:00 0
7ff8093f9000-7ff8093fa000 rw-p 00000000 00:00 0
7ff8093fa000-7ff8093fb000 r--s 00000000 08:05 40894639 /home/ztest/workspaces/b.apl
7ff8093fb000-7ff8093fe000 rw-p 00000000 00:00 0
7ff8093fe000-7ff8093ff000 r--p 00023000 08:01 132934 /lib/x86_64-linux-gnu/ld-2.24.so
7ff8093ff000-7ff809400000 rw-p 00024000 08:01 132934 /lib/x86_64-linux-gnu/ld-2.24.so
7ff809400000-7ff809401000 rw-p 00000000 00:00 0
7ffc186a5000-7ffc186c6000 rw-p 00000000 00:00 0 [stack]
7ffc187b1000-7ffc187b4000 r--p 00000000 00:00 0 [vvar]
7ffc187b4000-7ffc187b6000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]


-k
Juergen Sauermann
2017-05-06 15:18:42 UTC
Permalink
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font face="Helvetica, Arial, sans-serif">Hi Kacper,<br>
<br>
thanks. Unfortunately I cannot reproduce this problem on my box:<br>
<br>
<font face="Courier New, Courier, monospace"><b>***@server66:~$
cat workspaces/a.apl </b><b><br>
</b><b>⍝!</b><b><br>
</b><b>)copy b</b><b><br>
</b><b>)copy b</b><b><br>
</b><b><br>
</b><b>***@server66:~$ cat workspaces/b.apl </b><b><br>
</b><b>⍝!</b><b><br>
</b><b>***@server66:~$ projects/juergen/apl-1.7/src/apl</b><b><br>
</b><b>                                       </b><b><br>
</b><b>                    ______ _   __ __  __    ___    
____   __ </b><b><br>
</b><b>                   / ____// | / // / / /   /   |   / __ \
/ / </b><b><br>
</b><b>                  / / __ /  |/ // / / /   / /| |  / /_/
// /  </b><b><br>
</b><b>                 / /_/ // /|  // /_/ /   / ___ | / ____//
/___</b><b><br>
</b><b>                 \____//_/ |_/ \____/   /_/  |_|/_/   
/_____/</b><b><br>
</b><b>                                       </b><b><br>
</b><b>                 Welcome to GNU APL version 1.7 /
12814:12815M</b><b><br>
</b><b>                                       </b><b><br>
</b><b>                Copyright (C) 2008-2016  Dr. Jürgen
Sauermann</b><b><br>
</b><b>                       Banner by FIGlet: <a class="moz-txt-link-abbreviated" href="http://www.figlet.org">www.figlet.org</a></b><b><br>
</b><b>                                       </b><b><br>
</b><b>                This program comes with ABSOLUTELY NO
WARRANTY;</b><b><br>
</b><b>           for details run:
projects/juergen/apl-1.7/src/apl --gpl.</b><b><br>
</b><b>                                       </b><b><br>
</b><b>     This program is free software, and you are welcome
to redistribute it</b><b><br>
</b><b>         according to the GNU Public License (GPL)
version 3 or later.</b><b><br>
</b><b>                                       </b><b><br>
</b><b>      )load a</b><b><br>
</b><b>DUMPED 2017-05-06 16:29:25 (GMT+2)</b><b><br>
</b><b>DUMPED 2017-05-06 16:30:13 (GMT+2)</b><b><br>
</b><b>DUMPED 2017-05-06 16:30:13 (GMT+2)</b><b><br>
</b><b>      </b><b><br>
</b><b>      )off</b><b><br>
</b></font><br>
However, I may have located and fixed it in <b>SVN 942</b>.<br>
<br>
Best Regards,<br>
Jürgen Sauermann<br>
<br>
</font><br>
<div class="moz-cite-prefix">On 05/06/2017 12:26 PM, Kacper Gutowski
wrote:<br>
</div>
<blockquote cite="mid:***@gmail.com"
type="cite">
<pre wrap="">Having two )copy commands in loaded or copied APL script aborts the
interpreter in r940.

Consider trivial files a.apl and b.apl consisting respectively of

a.apl:
⍝!
)copy b
)copy b

b.apl:
⍝!

Then trying to load a.apl yields the following:

)copy a
DUMPED 2017-05-06 12:05:19 (GMT+2)
DUMPED 2017-05-06 12:05:17 (GMT+2)
DUMPED 2017-05-06 12:05:17 (GMT+2)
*** Error in `src/apl': double free or corruption (fasttop): 0x000056176aa177f0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x70bcb)[0x7ff807b8abcb]
/lib/x86_64-linux-gnu/libc.so.6(+0x76f96)[0x7ff807b90f96]
/lib/x86_64-linux-gnu/libc.so.6(+0x7778e)[0x7ff807b9178e]
src/apl(_ZN9Workspace9load_DUMPERSoRK11UTF8_stringi7LX_modebP17UCS_string_vector+0x687)[0x56176918cd17]
src/apl(_ZN9Workspace7copy_WSERSo6LibRefRK10UCS_stringR17UCS_string_vectorb+0xbc)[0x56176918dedc]
src/apl(_ZN7Command8cmd_COPYERSoR17UCS_string_vectorb+0x96)[0x561769058a66]
src/apl(_ZN7Command14do_APL_commandERSoR10UCS_string+0x1ed)[0x56176906629d]
src/apl(_ZN7Command12process_lineER10UCS_string+0x4c)[0x561769066d1c]
src/apl(_ZN7Command12process_lineEv+0x7f)[0x561769066e1f]
src/apl(_ZN9Workspace19immediate_executionEb+0x3d)[0x5617691858ad]
src/apl(main+0x35)[0x56176901e065]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0x7ff807b3a2b1]
src/apl(_start+0x2a)[0x5617690239da]
======= Memory map: ========
561768f95000-5617691f3000 r-xp 00000000 08:05 48234866 /home/ztest/tmp/apl/src/apl
5617693f3000-56176940f000 r--p 0025e000 08:05 48234866 /home/ztest/tmp/apl/src/apl
56176940f000-561769412000 rw-p 0027a000 08:05 48234866 /home/ztest/tmp/apl/src/apl
561769412000-5617694a3000 rw-p 00000000 00:00 0
56176a9b6000-56176aa49000 rw-p 00000000 00:00 0 [heap]
7ff800000000-7ff800021000 rw-p 00000000 00:00 0
7ff800021000-7ff804000000 ---p 00000000 00:00 0
7ff807b1a000-7ff807caf000 r-xp 00000000 08:01 133316 /lib/x86_64-linux-gnu/libc-2.24.so
7ff807caf000-7ff807eae000 ---p 00195000 08:01 133316 /lib/x86_64-linux-gnu/libc-2.24.so
7ff807eae000-7ff807eb2000 r--p 00194000 08:01 133316 /lib/x86_64-linux-gnu/libc-2.24.so
7ff807eb2000-7ff807eb4000 rw-p 00198000 08:01 133316 /lib/x86_64-linux-gnu/libc-2.24.so
7ff807eb4000-7ff807eb8000 rw-p 00000000 00:00 0
7ff807eb8000-7ff807ece000 r-xp 00000000 08:01 132780 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ff807ece000-7ff8080cd000 ---p 00016000 08:01 132780 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ff8080cd000-7ff8080ce000 r--p 00015000 08:01 132780 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ff8080ce000-7ff8080cf000 rw-p 00016000 08:01 132780 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ff8080cf000-7ff8081d2000 r-xp 00000000 08:01 133376 /lib/x86_64-linux-gnu/libm-2.24.so
7ff8081d2000-7ff8083d1000 ---p 00103000 08:01 133376 /lib/x86_64-linux-gnu/libm-2.24.so
7ff8083d1000-7ff8083d2000 r--p 00102000 08:01 133376 /lib/x86_64-linux-gnu/libm-2.24.so
7ff8083d2000-7ff8083d3000 rw-p 00103000 08:01 133376 /lib/x86_64-linux-gnu/libm-2.24.so
7ff8083d3000-7ff808545000 r-xp 00000000 08:02 1966764 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7ff808545000-7ff808745000 ---p 00172000 08:02 1966764 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7ff808745000-7ff80874f000 r--p 00172000 08:02 1966764 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7ff80874f000-7ff808751000 rw-p 0017c000 08:02 1966764 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7ff808751000-7ff808755000 rw-p 00000000 00:00 0
7ff808755000-7ff808769000 r-xp 00000000 08:01 133438 /lib/x86_64-linux-gnu/libnsl-2.24.so
7ff808769000-7ff808969000 ---p 00014000 08:01 133438 /lib/x86_64-linux-gnu/libnsl-2.24.so
7ff808969000-7ff80896a000 r--p 00014000 08:01 133438 /lib/x86_64-linux-gnu/libnsl-2.24.so
7ff80896a000-7ff80896b000 rw-p 00015000 08:01 133438 /lib/x86_64-linux-gnu/libnsl-2.24.so
7ff80896b000-7ff80896d000 rw-p 00000000 00:00 0
7ff80896d000-7ff808992000 r-xp 00000000 08:01 131558 /lib/x86_64-linux-gnu/libtinfo.so.5.9
7ff808992000-7ff808b92000 ---p 00025000 08:01 131558 /lib/x86_64-linux-gnu/libtinfo.so.5.9
7ff808b92000-7ff808b96000 r--p 00025000 08:01 131558 /lib/x86_64-linux-gnu/libtinfo.so.5.9
7ff808b96000-7ff808b97000 rw-p 00029000 08:01 131558 /lib/x86_64-linux-gnu/libtinfo.so.5.9
7ff808b97000-7ff808bb8000 r-xp 00000000 08:01 131264 /lib/x86_64-linux-gnu/libncurses.so.5.9
7ff808bb8000-7ff808db8000 ---p 00021000 08:01 131264 /lib/x86_64-linux-gnu/libncurses.so.5.9
7ff808db8000-7ff808db9000 r--p 00021000 08:01 131264 /lib/x86_64-linux-gnu/libncurses.so.5.9
7ff808db9000-7ff808dba000 rw-p 00022000 08:01 131264 /lib/x86_64-linux-gnu/libncurses.so.5.9
7ff808dba000-7ff808dd2000 r-xp 00000000 08:01 133471 /lib/x86_64-linux-gnu/libpthread-2.24.so
7ff808dd2000-7ff808fd1000 ---p 00018000 08:01 133471 /lib/x86_64-linux-gnu/libpthread-2.24.so
7ff808fd1000-7ff808fd2000 r--p 00017000 08:01 133471 /lib/x86_64-linux-gnu/libpthread-2.24.so
7ff808fd2000-7ff808fd3000 rw-p 00018000 08:01 133471 /lib/x86_64-linux-gnu/libpthread-2.24.so
7ff808fd3000-7ff808fd7000 rw-p 00000000 00:00 0
7ff808fd7000-7ff808fda000 r-xp 00000000 08:01 133375 /lib/x86_64-linux-gnu/libdl-2.24.so
7ff808fda000-7ff8091d9000 ---p 00003000 08:01 133375 /lib/x86_64-linux-gnu/libdl-2.24.so
7ff8091d9000-7ff8091da000 r--p 00002000 08:01 133375 /lib/x86_64-linux-gnu/libdl-2.24.so
7ff8091da000-7ff8091db000 rw-p 00003000 08:01 133375 /lib/x86_64-linux-gnu/libdl-2.24.so
7ff8091db000-7ff8091fe000 r-xp 00000000 08:01 132934 /lib/x86_64-linux-gnu/ld-2.24.so
7ff8093db000-7ff8093e2000 rw-p 00000000 00:00 0
7ff8093f9000-7ff8093fa000 rw-p 00000000 00:00 0
7ff8093fa000-7ff8093fb000 r--s 00000000 08:05 40894639 /home/ztest/workspaces/b.apl
7ff8093fb000-7ff8093fe000 rw-p 00000000 00:00 0
7ff8093fe000-7ff8093ff000 r--p 00023000 08:01 132934 /lib/x86_64-linux-gnu/ld-2.24.so
7ff8093ff000-7ff809400000 rw-p 00024000 08:01 132934 /lib/x86_64-linux-gnu/ld-2.24.so
7ff809400000-7ff809401000 rw-p 00000000 00:00 0
7ffc186a5000-7ffc186c6000 rw-p 00000000 00:00 0 [stack]
7ffc187b1000-7ffc187b4000 r--p 00000000 00:00 0 [vvar]
7ffc187b4000-7ffc187b6000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]


-k


</pre>
</blockquote>
<br>
</body>
</html>
Kacper Gutowski
2017-05-07 02:47:50 UTC
Permalink
[...]
However, I may have located and fixed it in SVN 942.
I'm still seeing it in 944.
I'll try to find the cause myself, then.

The backtrace from gdb looks like this:

Program received signal SIGABRT, Aborted.
__GI_raise (sig=***@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=***@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007ff863b813fa in __GI_abort () at abort.c:89
#2 0x00007ff863bbdbd0 in __libc_message (do_abort=***@entry=2, fmt=***@entry=0x7ff863cb2bd0 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175
#3 0x00007ff863bc3f96 in malloc_printerr (action=3, str=0x7ff863cb2d28 "double free or corruption (fasttop)", ptr=<optimized out>, ar_ptr=<optimized out>) at malloc.c:5046
#4 0x00007ff863bc478e in _int_free (av=0x7ff863ee5b00 <main_arena>, p=0x555941479040, have_lock=0) at malloc.c:3902
#5 0x000055593f67c7f7 in Simple_string<unsigned char, false>::deallocate (this=0x555941477eb0) at Simple_string.hh:258
#6 Simple_string<unsigned char, false>::operator= (other=..., this=0x555941477eb0) at Simple_string.hh:104
#7 UTF8_string::operator= (this=0x555941477eb0) at UTF8_string.hh:40
#8 InputFile::operator= (this=0x555941477ea8) at InputFile.hh:30
#9 Simple_string<InputFile, false>::insert_before (t=..., pos=0, this=<optimized out>) at Simple_string.hh:156
#10 Workspace::load_DUMP (out=..., filename=..., fd=<optimized out>, with_LX=***@entry=no_LX, silent=***@entry=false, object_filter=***@entry=0x7ffeb1b9f6c0) at Workspace.cc:710
#11 0x000055593f67d9ac in Workspace::copy_WS (out=..., libref=***@entry=LIB0, wsname=..., lib_ws_objects=..., protection=***@entry=false) at Workspace.cc:997
#12 0x000055593f547e34 in Command::cmd_COPY (out=..., args=..., protection=***@entry=false) at Command.cc:676
#13 0x000055593f555835 in Command::do_APL_command (out=..., line=...) at Command.def:27
#14 0x000055593f5569fc in Command::process_line (line=...) at Command.cc:76
#15 0x000055593f556aff in Command::process_line () at Command.cc:64
#16 0x000055593f67537d in Workspace::immediate_execution (exit_on_error=false) at Workspace.cc:178
#17 0x000055593f50d0d5 in main (argc=<optimized out>, argv=<optimized out>) at main.cc:479
(gdb)


-k
Juergen Sauermann
2017-05-07 11:33:46 UTC
Permalink
<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font face="Helvetica, Arial, sans-serif">Hi Kacper,<br>
<br>
thanks, the backtrace below was very important. I believe that<br>
I have found the reason now. <b>SVN 945</b>.<br>
</font><br>
/// Jürgen<br>
<br>
<br>
<div class="moz-cite-prefix">On 05/07/2017 04:47 AM, Kacper Gutowski
wrote:<br>
</div>
<blockquote cite="mid:***@gmail.com"
type="cite">
<pre wrap="">On Sat, May 06, 2017 at 05:18:42PM +0200, Juergen Sauermann wrote:
</pre>
<blockquote type="cite">
<pre wrap="">thanks. Unfortunately I cannot reproduce this problem on my box:
</pre>
</blockquote>
<pre wrap="">[...]
</pre>
<blockquote type="cite">
<pre wrap="">However, I may have located and fixed it in SVN 942.
</pre>
</blockquote>
<pre wrap="">
I'm still seeing it in 944.
I'll try to find the cause myself, then.

The backtrace from gdb looks like this:

Program received signal SIGABRT, Aborted.
__GI_raise (sig=***@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=***@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007ff863b813fa in __GI_abort () at abort.c:89
#2 0x00007ff863bbdbd0 in __libc_message (do_abort=***@entry=2, fmt=***@entry=0x7ff863cb2bd0 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175
#3 0x00007ff863bc3f96 in malloc_printerr (action=3, str=0x7ff863cb2d28 "double free or corruption (fasttop)", ptr=&lt;optimized out&gt;, ar_ptr=&lt;optimized out&gt;) at malloc.c:5046
#4 0x00007ff863bc478e in _int_free (av=0x7ff863ee5b00 &lt;main_arena&gt;, p=0x555941479040, have_lock=0) at malloc.c:3902
#5 0x000055593f67c7f7 in Simple_string&lt;unsigned char, false&gt;::deallocate (this=0x555941477eb0) at Simple_string.hh:258
#6 Simple_string&lt;unsigned char, false&gt;::operator= (other=..., this=0x555941477eb0) at Simple_string.hh:104
#7 UTF8_string::operator= (this=0x555941477eb0) at UTF8_string.hh:40
#8 InputFile::operator= (this=0x555941477ea8) at InputFile.hh:30
#9 Simple_string&lt;InputFile, false&gt;::insert_before (t=..., pos=0, this=&lt;optimized out&gt;) at Simple_string.hh:156
#10 Workspace::load_DUMP (out=..., filename=..., fd=&lt;optimized out&gt;, with_LX=***@entry=no_LX, silent=***@entry=false, object_filter=***@entry=0x7ffeb1b9f6c0) at Workspace.cc:710
#11 0x000055593f67d9ac in Workspace::copy_WS (out=..., libref=***@entry=LIB0, wsname=..., lib_ws_objects=..., protection=***@entry=false) at Workspace.cc:997
#12 0x000055593f547e34 in Command::cmd_COPY (out=..., args=..., protection=***@entry=false) at Command.cc:676
#13 0x000055593f555835 in Command::do_APL_command (out=..., line=...) at Command.def:27
#14 0x000055593f5569fc in Command::process_line (line=...) at Command.cc:76
#15 0x000055593f556aff in Command::process_line () at Command.cc:64
#16 0x000055593f67537d in Workspace::immediate_execution (exit_on_error=false) at Workspace.cc:178
#17 0x000055593f50d0d5 in main (argc=&lt;optimized out&gt;, argv=&lt;optimized out&gt;) at main.cc:479
(gdb)


-k

</pre>
</blockquote>
<br>
</body>
</html>
Kacper Gutowski
2017-05-07 14:57:07 UTC
Permalink
Post by Juergen Sauermann
thanks, the backtrace below was very important. I believe that
I have found the reason now. SVN 945.
Thank you! It no longer happens in 945.

In the meantime I could reconfirm the problem with g++ 5.2, 6.2, 6.3, but it
didn't appear to occur with clang++ for some reason. It seemed that assignment
attempted to free the memory previously freed in dtor call at Simple_string.hh:155.

-k

Continue reading on narkive:
Loading...