Kacper Gutowski
2017-05-06 10:26:38 UTC
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
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