bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] Crash with stack trace


From: Elias Mårtenson
Subject: Re: [Bug-apl] Crash with stack trace
Date: Wed, 18 Jan 2017 22:57:47 +0800

Thanks. I think it's clear that the crash happens when Emacs requests information from the APL interpreter. The Emacs mode does that all the time, for example when computing candidates for symbol completion.

Is there a way to disable the stack trace stuff so that I can catch the crash in gdb when it happens?

Regards,
Elias

On 18 January 2017 at 22:18, Juergen Sauermann <address@hidden> wrote:
Hi Elias,

from the Assert'ions point of view it looks as if you are trying to index an empty UCS_string in  FnCommand::run_command().
I would recommend to check the size() of each UCS_string created in
FnCommand::run_command().

I am have seen problems with the Backtrace feature from time to time, giving not reproducible stack traces every
now and then. So it might be that first the assertion fails and then, when displaying the call stack for the assertion,
__cxa_demangle() makes things worse. The culprit could be backtrace_symbols(); the man page says that its
results shall be freed() but doing to segfaults from time to time.

/// Jürgen


On 01/17/2017 08:48 PM, Elias Mårtenson wrote:
I wasn't using the SQL stuff. The crash you see is happening in the code for the backend connection to Emacs. This is code that hasn't been changed (at least by me) in a very long time.

I could debug this myself, now that I noticed this, but before doing so, do you have an idea?

The crash happened a few times in a row, but I haven't seen it for a while now.

Regards,
Elias

On 18 January 2017 at 03:14, Juergen Sauermann <address@hidden> wrote:
Hi Elias,

do you by chance know if this happens with *⎕SQ**L *or with SQL as native function or both?

Looks like the dump is coming from the SQL area.

I remember that I replaced

*map<const string, Provider *> providers;**
*
in *apl-squlite.cc*

with:

*static Simple_string<Provider *, false> providers;**
**static Simple_string<Connection *, false> connections;*

in *Quad_SQL.cc*, mainly because the *map<...> *stuff crashed on start-up of apl (the *⎕SQL
*constructor is called much earlier than native functions). But maybe I did somewthing wrong,
in paricular with the *connections*.

/// Jürgen



On 01/17/2017 05:38 PM, Elias Mårtenson wrote:
I'm regularly getting a crash that I have not seen before. I don't know when it was introduced but it must be within the last few months. Here's the stack trace:

==============================================================================
Assertion failed: items
in Function:      at
in file:          ../Simple_string.hh:276

Call stack:

----------------------------------------
-- Stack trace at ../Simple_string.hh:276
----------------------------------------
0x7f148e5e65ca
0x7f148d0f0210  connection_loop(void*)
0x7f148d0f288e   NetworkConnection::run()
0x7f148d0f1f0e NetworkConnection::process_command(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
*** Error in `/home/user/src/apl/dist/bin/apl': munmap_chunk(): invalid pointer: 0x00007f148c88bfb0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7570b)[0x7f148d37c70b]
/lib64/libc.so.6(cfree+0x1a8)[0x7f148d388568]
/lib64/libstdc++.so.6(__cxa_demangle+0x108)[0x7f148dc84488]
/home/user/src/apl/dist/bin/apl(_ZN9Backtrace9show_itemEiPc+0x124)[0x45b9f4]
/home/user/src/apl/dist/bin/apl(_ZN9Backtrace4showEPKci+0x1ff)[0x45bdef]
/home/user/src/apl/dist/bin/apl(_Z9do_AssertPKcS0_S0_i+0x1c8)[0x459c38]
/home/user/src/apl/dist/lib/apl/libemacs.so(_ZN9FnCommand11run_commandER17NetworkConnectionRKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS8_EE+0x9c7)[0x7f148d0ebf97]
/home/user/src/apl/dist/lib/apl/libemacs.so(_ZN17NetworkConnection15process_commandERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x79e)[0x7f148d0f1f0e]
/home/user/src/apl/dist/lib/apl/libemacs.so(_ZN17NetworkConnection3runEv+0x2e)[0x7f148d0f288e]
/home/user/src/apl/dist/lib/apl/libemacs.so(_Z15connection_loopPv+0x10)[0x7f148d0f0210]
/lib64/libpthread.so.0(+0x75ca)[0x7f148e5e65ca]
/lib64/libc.so.6(clone+0x6d)[0x7f148d40a0ed]
======= Memory map: ========
00400000-0061c000 r-xp 00000000 ca:10 131135 /home/user/src/apl/dist/bin/apl
0081b000-0081c000 r--p 0021b000 ca:10 131135 /home/user/src/apl/dist/bin/apl
0081c000-0081f000 rw-p 0021c000 ca:10 131135 /home/user/src/apl/dist/bin/apl
0081f000-008b1000 rw-p 00000000 00:00 0
0289c000-0290d000 rw-p 00000000 00:00 0                                  [heap]
7f1480000000-7f1480021000 rw-p 00000000 00:00 0
7f1480021000-7f1484000000 ---p 00000000 00:00 0
7f1488000000-7f1488021000 rw-p 00000000 00:00 0
7f1488021000-7f148c000000 ---p 00000000 00:00 0
7f148c03d000-7f148c03e000 ---p 00000000 00:00 0
7f148c03e000-7f148c88e000 rw-p 00000000 00:00 0
7f148c88e000-7f148c88f000 ---p 00000000 00:00 0
7f148c88f000-7f148d0df000 rw-p 00000000 00:00 0
7f148d0df000-7f148d105000 r-xp 00000000 ca:10 131125 /home/user/src/apl/dist/lib/apl/libemacs.so.0.0.0
7f148d105000-7f148d305000 ---p 00026000 ca:10 131125 /home/user/src/apl/dist/lib/apl/libemacs.so.0.0.0
7f148d305000-7f148d306000 r--p 00026000 ca:10 131125 /home/user/src/apl/dist/lib/apl/libemacs.so.0.0.0
7f148d306000-7f148d307000 rw-p 00027000 ca:10 131125 /home/user/src/apl/dist/lib/apl/libemacs.so.0.0.0
7f148d307000-7f148d4c0000 r-xp 00000000 fb:00 395734                     /usr/lib64/libc-2.23.so <http://libc-2.23.so>
7f148d4c0000-7f148d6bf000 ---p 001b9000 fb:00 395734                     /usr/lib64/libc-2.23.so <http://libc-2.23.so>
7f148d6bf000-7f148d6c3000 r--p 001b8000 fb:00 395734                     /usr/lib64/libc-2.23.so <http://libc-2.23.so>
7f148d6c3000-7f148d6c5000 rw-p 001bc000 fb:00 395734                     /usr/lib64/libc-2.23.so <http://libc-2.23.so>
7f148d6c5000-7f148d6c9000 rw-p 00000000 00:00 0
7f148d6c9000-7f148d6df000 r-xp 00000000 fb:00 437012 /usr/lib64/libgcc_s-6.3.1-20161221.so.1
7f148d6df000-7f148d8de000 ---p 00016000 fb:00 437012 /usr/lib64/libgcc_s-6.3.1-20161221.so.1
7f148d8de000-7f148d8df000 r--p 00015000 fb:00 437012 /usr/lib64/libgcc_s-6.3.1-20161221.so.1
7f148d8df000-7f148d8e0000 rw-p 00016000 fb:00 437012 /usr/lib64/libgcc_s-6.3.1-20161221.so.1
7f148d8e0000-7f148d9e8000 r-xp 00000000 fb:00 395742                     /usr/lib64/libm-2.23.so <http://libm-2.23.so>
7f148d9e8000-7f148dbe7000 ---p 00108000 fb:00 395742                     /usr/lib64/libm-2.23.so <http://libm-2.23.so>
7f148dbe7000-7f148dbe8000 r--p 00107000 fb:00 395742                     /usr/lib64/libm-2.23.so <http://libm-2.23.so>
7f148dbe8000-7f148dbe9000 rw-p 00108000 fb:00 395742                     /usr/lib64/libm-2.23.so <http://libm-2.23.so>
7f148dbe9000-7f148dd61000 r-xp 00000000 fb:00 396075                     /usr/lib64/libstdc++.so.6.0.22
7f148dd61000-7f148df61000 ---p 00178000 fb:00 396075                     /usr/lib64/libstdc++.so.6.0.22
7f148df61000-7f148df6b000 r--p 00178000 fb:00 396075                     /usr/lib64/libstdc++.so.6.0.22
7f148df6b000-7f148df6d000 rw-p 00182000 fb:00 396075                     /usr/lib64/libstdc++.so.6.0.22
7f148df6d000-7f148df71000 rw-p 00000000 00:00 0
7f148df71000-7f148df87000 r-xp 00000000 fb:00 395746                     /usr/lib64/libnsl-2.23.so <http://libnsl-2.23.so>
7f148df87000-7f148e186000 ---p 00016000 fb:00 395746                     /usr/lib64/libnsl-2.23.so <http://libnsl-2.23.so>
7f148e186000-7f148e187000 r--p 00015000 fb:00 395746                     /usr/lib64/libnsl-2.23.so <http://libnsl-2.23.so>
7f148e187000-7f148e188000 rw-p 00016000 fb:00 395746                     /usr/lib64/libnsl-2.23.so <http://libnsl-2.23.so>
7f148e188000-7f148e18a000 rw-p 00000000 00:00 0
7f148e18a000-7f148e1b1000 r-xp 00000000 fb:00 396071                     /usr/lib64/libtinfo.so.6.0
7f148e1b1000-7f148e3b1000 ---p 00027000 fb:00 396071                     /usr/lib64/libtinfo.so.6.0
7f148e3b1000-7f148e3b5000 r--p 00027000 fb:00 396071                     /usr/lib64/libtinfo.so.6.0
7f148e3b5000-7f148e3b6000 rw-p 0002b000 fb:00 396071                     /usr/lib64/libtinfo.so.6.0
7f148e3b6000-7f148e3dd000 r-xp 00000000 fb:00 396061                     /usr/lib64/libncurses.so.6.0
7f148e3dd000-7f148e5dd000 ---p 00027000 fb:00 396061                     /usr/lib64/libncurses.so.6.0
7f148e5dd000-7f148e5de000 r--p 00027000 fb:00 396061                     /usr/lib64/libncurses.so.6.0
7f148e5de000-7f148e5df000 rw-p 00028000 fb:00 396061                     /usr/lib64/libncurses.so.6.0
7f148e5df000-7f148e5f6000 r-xp 00000000 fb:00 395762                     /usr/lib64/libpthread-2.23.so <http://libpthread-2.23.so>
7f148e5f6000-7f148e7f5000 ---p 00017000 fb:00 395762                     /usr/lib64/libpthread-2.23.so <http://libpthread-2.23.so>
7f148e7f5000-7f148e7f6000 r--p 00016000 fb:00 395762                     /usr/lib64/libpthread-2.23.so <http://libpthread-2.23.so>
7f148e7f6000-7f148e7f7000 rw-p 00017000 fb:00 395762                     /usr/lib64/libpthread-2.23.so <http://libpthread-2.23.so>
7f148e7f7000-7f148e7fb000 rw-p 00000000 00:00 0
7f148e7fb000-7f148e7fe000 r-xp 00000000 fb:00 395740                     /usr/lib64/libdl-2.23.so <http://libdl-2.23.so>
7f148e7fe000-7f148e9fd000 ---p 00003000 fb:00 395740                     /usr/lib64/libdl-2.23.so <http://libdl-2.23.so>
7f148e9fd000-7f148e9fe000 r--p 00002000 fb:00 395740                     /usr/lib64/libdl-2.23.so <http://libdl-2.23.so>
7f148e9fe000-7f148e9ff000 rw-p 00003000 fb:00 395740                     /usr/lib64/libdl-2.23.so <http://libdl-2.23.so>
7f148e9ff000-7f148ead0000 r-xp 00000000 fb:00 396553                     /usr/lib64/libsqlite3.so.0.8.6
7f148ead0000-7f148ecd0000 ---p 000d1000 fb:00 396553                     /usr/lib64/libsqlite3.so.0.8.6
7f148ecd0000-7f148ecd3000 r--p 000d1000 fb:00 396553                     /usr/lib64/libsqlite3.so.0.8.6
7f148ecd3000-7f148ecd5000 rw-p 000d4000 fb:00 396553                     /usr/lib64/libsqlite3.so.0.8.6
7f148ecd5000-7f148ecd6000 rw-p 00000000 00:00 0
7f148ecd6000-7f148ecfa000 r-xp 00000000 fb:00 395726                     /usr/lib64/ld-2.23.so <http://ld-2.23.so>
7f148eed6000-7f148eede000 rw-p 00000000 00:00 0
7f148eef7000-7f148eef9000 rw-p 00000000 00:00 0
7f148eef9000-7f148eefa000 r--p 00023000 fb:00 395726                     /usr/lib64/ld-2.23.so <http://ld-2.23.so>
7f148eefa000-7f148eefb000 rw-p 00024000 fb:00 395726                     /usr/lib64/ld-2.23.so <http://ld-2.23.so>
7f148eefb000-7f148eefc000 rw-p 00000000 00:00 0
7fff44368000-7fff44389000 rw-p 00000000 00:00 0                          [stack]
7fff443f1000-7fff443f3000 r--p 00000000 00:00 0                          [vvar]
7fff443f3000-7fff443f5000 r-xp 00000000 00:00 0                          [vdso]

Process apl aborted (core dumped)
Network listener started. Connection information: mode:tcp addr:44846






reply via email to

[Prev in Thread] Current Thread [Next in Thread]