[LINUX] Crash on login

If you find any bugs, please post in here. Bugs in the Linux version should be reported on Github.

[LINUX] Crash on login

Postby juuh7 » 10 Apr 2016, 11:39

Compiled from git today and when I try to login, airdcppd crashes and throws exception:
Code: Select all
OS version: Linux 3.10.96-3-ARCH (armv7l)
Client version: AirDC++w 1.0.2

airdcppd in function cow::StackTrace::generate_frames() in file /mnt/kingston/src/airdcpp-webclient/airdcppd/stacktrace.cpp:44 [0x22fe8]

airdcppd in function std::ostream_iterator<cow::StackFrame, char, std::char_traits<char> >::ostream_iterator(std::ostream_iterator<cow::StackFrame, char, std::char_traits<char> > const&) in file /usr/include/c++/5.3.0/bits/stream_iterator.h:188 [0x2e0b4]

/usr/lib/libc.so.6 in function __default_sa_restorer [0xb6454a70]

/usr/local/lib/libairdcpp-webapi.so.1.0.2 in function std::_Rb_tree_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long long, unsigned long long, double, std::allocator> > > std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long long, unsigned long long, double, std::allocator> >, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long long, unsigned long long, double, std::allocator> > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long long, unsigned long long, double, std::allocator> > > >::_M_emplace_hint_unique<std::piecewise_construct_t const&, std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>, std::tuple<> >(std::_Rb_tree_const_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long long, unsigned long long, double, std::allocator> > >, std::piecewise_construct_t const&, std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>&&, std::tuple<>&&) [0xb6df5e90]

/usr/local/lib/libairdcpp-webapi.so.1.0.2 in function nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long long, unsigned long long, double, std::allocator>::parser::parse_internal(bool) [0xb6f14908]

/usr/local/lib/libairdcpp-webapi.so.1.0.2 in function webserver::ApiRouter::handleSocketRequest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<webserver::WebSocket>&, bool) [0xb6f11290]
juuh7
 
Posts: 5
Joined: 10 Apr 2016, 11:34

Re: Crash on login

Postby maksis » 10 Apr 2016, 15:08

Seems a bit similar to https://github.com/airdcpp-web/airdcpp- ... /issues/83 that was also related to the JSON library.

Could you try replacing airdcpp-webapi/json/json.hpp with https://raw.githubusercontent.com/nlohm ... c/json.hpp ? Recompile after that.
User avatar
maksis
Site Admin
 
Posts: 829
Joined: 23 Nov 2010, 18:56

Re: Crash on login

Postby juuh7 » 11 Apr 2016, 13:49

Recompiled with your json.hpp but it still crashes on login. Exception seems to be same as in first post.
juuh7
 
Posts: 5
Joined: 10 Apr 2016, 11:34

Re: Crash on login

Postby maksis » 11 Apr 2016, 17:28

The guy who reported the other issue seems to be able to run the client with a similar CPU. One possible reason is that you are using different compilers (he's compiling with GCC 4.9 while you have GCC 5.3).

Could you try installing clang and compiling the client with it? Remember to run the following commands in the client directory before running cmake:

Code: Select all
rm -rf airdcpp-core/CMakeFiles/ && rm -rf airdcpp-webapi/CMakeFiles/ && rm -rf CMakeFiles/ && rm CMakeCache.txt
export CC=clang
export CXX=clang++


Ensure that you see the following lines in the cmake output:

Code: Select all
-- CMAKE_CXX_COMPILER_ID: Clang
-- CMAKE_C_COMPILER_ID: Clang
User avatar
maksis
Site Admin
 
Posts: 829
Joined: 23 Nov 2010, 18:56

Re: Crash on login

Postby juuh7 » 11 Apr 2016, 19:07

Code: Select all
-- CMAKE_SYSTEM: Linux-3.10.96-3-ARCH
-- CMAKE_SYSTEM_PROCESSOR: armv7l
-- CMAKE_CXX_COMPILER_ID: Clang
-- CMAKE_CXX_COMPILER_VERSION: 3.7.1
-- CMAKE_C_COMPILER_ID: Clang


With clang it doesn't even compile.
Code: Select all
[ 47%] Building CXX object airdcpp-core/CMakeFiles/airdcpp.dir/airdcpp/FileReader.cpp.o

In file included from /mnt/kingston/src/airdcpp-webclient/airdcpp-core/airdcpp/FileReader.cpp:270:
/usr/include/setjmp.h:59:12: error: conflicting types for '__sigsetjmp'
extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __THROWNL;
           ^

/usr/include/pthread.h:743:12: note: previous declaration is here
extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL;
           ^

/mnt/kingston/src/airdcpp-webclient/airdcpp-core/airdcpp/FileReader.cpp:337:7: error: no matching function for call to '__sigsetjmp'
                if (sigsetjmp(sb_env, 1)) {
                    ^~~~~~~~~~~~~~~~~~~~

/usr/include/setjmp.h:96:35: note: expanded from macro 'sigsetjmp'
# define sigsetjmp(env, savemask)       __sigsetjmp (env, savemask)
                                        ^~~~~~~~~~~

/usr/include/pthread.h:743:12: note: candidate function not viable: no known conversion from 'sigjmp_buf'
      (aka 'struct __jmp_buf_tag [1]') to 'struct __jmp_buf_tag *' for 1st argument
extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL;
           ^

2 errors generated.
airdcpp-core/CMakeFiles/airdcpp.dir/build.make:1910: recipe for target 'airdcpp-core/CMakeFiles/airdcpp.dir/airdcpp/FileReader.cpp.o' failed

make[2]: *** [airdcpp-core/CMakeFiles/airdcpp.dir/airdcpp/FileReader.cpp.o] Error 1
CMakeFiles/Makefile2:117: recipe for target 'airdcpp-core/CMakeFiles/airdcpp.dir/all' failed
make[1]: *** [airdcpp-core/CMakeFiles/airdcpp.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
juuh7
 
Posts: 5
Joined: 10 Apr 2016, 11:34

Re: Crash on login

Postby maksis » 11 Apr 2016, 19:58

Oh, the familiar system header conflict with clang. So it's probably better to solve the actual crash...

Try installing gdb and do the following to get a better crash log:

Code: Select all
$ gdb airdcppd
$ run
(make it crash)
$ thread apply all bt full


Save all text to a file.

Please create a new bug report at https://github.com/airdcpp-web/airdcpp-webclient/issues with the file attached. Managing all issues related to the Linux version is easier at Github, especially if this issue needs to be reported for the JSON library (I've also added notes on this site regarding bugs related to the Web Client as it wasn't that clear before).
User avatar
maksis
Site Admin
 
Posts: 829
Joined: 23 Nov 2010, 18:56

Re: Crash on login

Postby juuh7 » 12 Apr 2016, 14:15

I will register to github later when I have something to report... :D

Code: Select all
$gdb airdcppd
Reading symbols from airdcppd...done.
(gdb) run
Starting program: /usr/local/bin/airdcppd
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Program received signal SIGILL, Illegal instruction.
0xb6782fe8 in _armv7_tick () from /usr/lib/libcrypto.so.1.0.0


At this point airdcppd seems to be running on background but
according to netstat it isn't listening on any port so I cannot
connect and make it crash by logging in.

Code: Select all
(gdb) thread apply all bt full
Thread 1 (Thread 0xb44c1000 (LWP 795)):
#0  0xb6782fe8 in _armv7_tick () from /usr/lib/libcrypto.so.1.0.0
No symbol table info available.
#1  0xb677f0ec in OPENSSL_cpuid_setup () from /usr/lib/libcrypto.so.1.0.0
No symbol table info available.
#2  0xb6fdf318 in call_init.part () from /lib/ld-linux-armhf.so.3
No symbol table info available.
#3  0xb6fdf474 in _dl_init () from /lib/ld-linux-armhf.so.3
No symbol table info available.
#4  0xb6fcfc04 in _dl_start_user () from /lib/ld-linux-armhf.so.3
No symbol table info available.
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
juuh7
 
Posts: 5
Joined: 10 Apr 2016, 11:34

Re: Crash on login

Postby maksis » 12 Apr 2016, 17:30

User avatar
maksis
Site Admin
 
Posts: 829
Joined: 23 Nov 2010, 18:56

Re: Crash on login

Postby juuh7 » 12 Apr 2016, 18:56

maksis wrote:From https://www.raspberrypi.org/forums/view ... 33&t=15132

Code: Select all
(gdb) handle SIGILL nostop


That did the trick. If someone finds this useful here is link for github issue https://github.com/airdcpp-web/airdcpp-webclient/issues/141
juuh7
 
Posts: 5
Joined: 10 Apr 2016, 11:34


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 4 guests

cron