Nheko-Reborn / nheko

Desktop client for Matrix using Qt and C++20.
https://nheko-reborn.github.io/
GNU General Public License v3.0
1.89k stars 199 forks source link

Exception when running on MacOS #21

Closed benparsons closed 3 years ago

benparsons commented 5 years ago

System:

Actual behavior

After running for more than an hour, I see a segfault:

Logs

Process:               nheko [13088]
Path:                  /Applications/Nheko.app/Contents/MacOS/./nheko
Identifier:            com.github.mujx.nheko
Version:               0.6.3 (0.6.3)
Code Type:             X86-64 (Native)
Parent Process:        bash [12119]
Responsible:           nheko [13088]
User ID:               501

Date/Time:             2019-02-11 15:23:22.254 +0000
OS Version:            Mac OS X 10.14 (18A391)
Report Version:        12
Anonymous UUID:        E9E65648-ABB3-1C16-990C-021560FE24F3

Sleep/Wake UUID:       6AC43F4B-54CA-4943-A159-A8F7A5BE33AD

Time Awake Since Boot: 3100000 seconds
Time Since Wake:       21000 seconds

System Integrity Protection: enabled

Crashed Thread:        4

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       EXC_I386_GPFLT
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [13088]

Thread 0:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff5e50dc2a mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff5e50e174 mach_msg + 60
2   com.apple.SkyLight              0x00007fff572a4d30 CGSWindowSynchronizeBacking + 174
3   com.apple.SkyLight              0x00007fff5733a2b5 SLSDeviceLock + 39
4   com.apple.AppKit                0x00007fff2eaa6cc8 lock_device + 64
5   com.apple.AppKit                0x00007fff2e9cf9ff __NSCGSWindowBackingStoreMark__block_invoke + 1097
6   com.apple.AppKit                0x00007fff2e9ce739 NSCGSTransactionRunPreCommitActionsForOrder_ + 269
7   com.apple.AppKit                0x00007fff2e9ce619 NSCGSTransactionRunPreCommitActions_ + 31
8   com.apple.AppKit                0x00007fff2e9ce5ee __39+[_NSCGSTransaction currentTransaction]_block_invoke + 34
9   com.apple.QuartzCore            0x00007fff3c2c11d3 CA::Transaction::run_commit_handlers(CATransactionPhase) + 49
10  com.apple.QuartzCore            0x00007fff3c2c1aa5 CA::Context::commit_transaction(CA::Transaction*) + 1949
11  com.apple.QuartzCore            0x00007fff3c2c0d20 CA::Transaction::commit() + 576
12  com.apple.QuartzCore            0x00007fff3c2c0a2c CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 66
13  com.apple.CoreFoundation        0x00007fff3139e95d __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
14  com.apple.CoreFoundation        0x00007fff3139e892 __CFRunLoopDoObservers + 452
15  com.apple.CoreFoundation        0x00007fff3133fd20 CFRunLoopRunSpecific + 523
16  com.apple.HIToolbox             0x00007fff305d9895 RunCurrentEventLoopInMode + 293
17  com.apple.HIToolbox             0x00007fff305d95cb ReceiveNextEventCommon + 618
18  com.apple.HIToolbox             0x00007fff305d9348 _BlockUntilNextEventMatchingListInModeWithFilter + 64
19  com.apple.AppKit                0x00007fff2e89695b _DPSNextEvent + 997
20  com.apple.AppKit                0x00007fff2e8956fa -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1362
21  com.apple.AppKit                0x00007fff2e88f75d -[NSApplication run] + 699
22  libqcocoa.dylib                 0x0000000115610c7d 0x1155e4000 + 183421
23  org.qt-project.QtCore           0x0000000110f4e35e QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 398
24  org.qt-project.QtCore           0x0000000110f52ee1 QCoreApplication::exec() + 369
25  com.github.mujx.nheko           0x000000010f43ca14 main + 3092
26  libdyld.dylib                   0x00007fff5e3d5085 start + 1

Thread 1:
0   libsystem_kernel.dylib          0x00007fff5e510872 __psynch_mutexwait + 10
1   libsystem_pthread.dylib         0x00007fff5e5c7da0 _pthread_mutex_firstfit_lock_wait + 96
2   libsystem_pthread.dylib         0x00007fff5e5c54c7 _pthread_mutex_firstfit_lock_slow + 226
3   libc++.1.dylib                  0x00007fff5baa7b29 std::__1::mutex::lock() + 9
4   com.github.mujx.nheko           0x000000010f3efc7c 0x10f28e000 + 1449084
5   com.github.mujx.nheko           0x000000010f3eeb35 0x10f28e000 + 1444661
6   com.github.mujx.nheko           0x000000010f358902 0x10f28e000 + 829698
7   com.github.mujx.nheko           0x000000010f37e7aa 0x10f28e000 + 985002
8   com.github.mujx.nheko           0x000000010f49da1c 0x10f28e000 + 2161180
9   com.github.mujx.nheko           0x000000010f49a8a7 0x10f28e000 + 2148519
10  com.github.mujx.nheko           0x000000010f49a5a4 0x10f28e000 + 2147748
11  com.github.mujx.nheko           0x000000010f4d8cad mtx::http::Session::on_request_complete() + 93
12  com.github.mujx.nheko           0x000000010f508582 0x10f28e000 + 2598274
13  com.github.mujx.nheko           0x000000010f509712 0x10f28e000 + 2602770
14  com.github.mujx.nheko           0x000000010f50e19b 0x10f28e000 + 2621851
15  com.github.mujx.nheko           0x000000010f50dd71 boost::asio::detail::reactive_socket_recv_op<boost::asio::mutable_buffers_1, boost::asio::ssl::detail::io_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp>, boost::asio::ssl::detail::read_op<boost::asio::mutable_buffer>, boost::beast::http::detail::read_some_op<boost::asio::ssl::stream<boost::asio::basic_stream_socket<boost::asio::ip::tcp> >, boost::beast::basic_flat_buffer<std::__1::allocator<char> >, false, boost::beast::http::parser<false, boost::beast::http::basic_string_body<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<char> >, boost::beast::http::detail::read_op<boost::asio::ssl::stream<boost::asio::basic_stream_socket<boost::asio::ip::tcp> >, boost::beast::basic_flat_buffer<std::__1::allocator<char> >, false, boost::beast::http::parser<false, boost::beast::http::basic_string_body<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<char> >, boost::beast::http::detail::parser_is_done, std::__1::__bind<void (mtx::http::Session::*)(boost::system::error_code const&, unsigned long), std::__1::shared_ptr<mtx::http::Session>, std::__1::placeholders::__ph<1> const&, std::__1::placeholders::__ph<2> const&> > > > >::do_complete(void*, boost::asio::detail::scheduler_operation*, boost::system::error_code const&, unsigned long) + 465
16  com.github.mujx.nheko           0x000000010f469bd4 0x10f28e000 + 1948628
17  com.github.mujx.nheko           0x000000010f46970a 0x10f28e000 + 1947402
18  com.github.mujx.nheko           0x000000010f469565 0x10f28e000 + 1946981
19  libboost_thread-mt.dylib        0x000000010fd4a26c 0x10fd47000 + 12908
20  libsystem_pthread.dylib         0x00007fff5e5c733d _pthread_body + 126
21  libsystem_pthread.dylib         0x00007fff5e5ca2a7 _pthread_start + 70
22  libsystem_pthread.dylib         0x00007fff5e5c6425 thread_start + 13

Thread 2:
0   libsystem_kernel.dylib          0x00007fff5e5111b2 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff5e5ca5cb _pthread_cond_wait + 724
2   com.github.mujx.nheko           0x000000010f469a6a 0x10f28e000 + 1948266
3   com.github.mujx.nheko           0x000000010f46970a 0x10f28e000 + 1947402
4   com.github.mujx.nheko           0x000000010f469565 0x10f28e000 + 1946981
5   libboost_thread-mt.dylib        0x000000010fd4a26c 0x10fd47000 + 12908
6   libsystem_pthread.dylib         0x00007fff5e5c733d _pthread_body + 126
7   libsystem_pthread.dylib         0x00007fff5e5ca2a7 _pthread_start + 70
8   libsystem_pthread.dylib         0x00007fff5e5c6425 thread_start + 13

Thread 3:
0   libsystem_kernel.dylib          0x00007fff5e511aa6 __write_nocancel + 10
1   libsystem_c.dylib               0x00007fff5e463920 _swrite + 87
2   libsystem_c.dylib               0x00007fff5e45c4e3 __sflush + 87
3   libsystem_c.dylib               0x00007fff5e45ec0f __sfvwrite + 798
4   libsystem_c.dylib               0x00007fff5e45eeed fwrite + 136
5   com.github.mujx.nheko           0x000000010f3f7a46 0x10f28e000 + 1481286
6   com.github.mujx.nheko           0x000000010f3eeb35 0x10f28e000 + 1444661
7   com.github.mujx.nheko           0x000000010f358902 0x10f28e000 + 829698
8   com.github.mujx.nheko           0x000000010f37e7aa 0x10f28e000 + 985002
9   com.github.mujx.nheko           0x000000010f49da1c 0x10f28e000 + 2161180
10  com.github.mujx.nheko           0x000000010f49a8a7 0x10f28e000 + 2148519
11  com.github.mujx.nheko           0x000000010f49a5a4 0x10f28e000 + 2147748
12  com.github.mujx.nheko           0x000000010f4d8cad mtx::http::Session::on_request_complete() + 93
13  com.github.mujx.nheko           0x000000010f508582 0x10f28e000 + 2598274
14  com.github.mujx.nheko           0x000000010f509712 0x10f28e000 + 2602770
15  com.github.mujx.nheko           0x000000010f50e19b 0x10f28e000 + 2621851
16  com.github.mujx.nheko           0x000000010f50dd71 boost::asio::detail::reactive_socket_recv_op<boost::asio::mutable_buffers_1, boost::asio::ssl::detail::io_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp>, boost::asio::ssl::detail::read_op<boost::asio::mutable_buffer>, boost::beast::http::detail::read_some_op<boost::asio::ssl::stream<boost::asio::basic_stream_socket<boost::asio::ip::tcp> >, boost::beast::basic_flat_buffer<std::__1::allocator<char> >, false, boost::beast::http::parser<false, boost::beast::http::basic_string_body<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<char> >, boost::beast::http::detail::read_op<boost::asio::ssl::stream<boost::asio::basic_stream_socket<boost::asio::ip::tcp> >, boost::beast::basic_flat_buffer<std::__1::allocator<char> >, false, boost::beast::http::parser<false, boost::beast::http::basic_string_body<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<char> >, boost::beast::http::detail::parser_is_done, std::__1::__bind<void (mtx::http::Session::*)(boost::system::error_code const&, unsigned long), std::__1::shared_ptr<mtx::http::Session>, std::__1::placeholders::__ph<1> const&, std::__1::placeholders::__ph<2> const&> > > > >::do_complete(void*, boost::asio::detail::scheduler_operation*, boost::system::error_code const&, unsigned long) + 465
17  com.github.mujx.nheko           0x000000010f469bd4 0x10f28e000 + 1948628
18  com.github.mujx.nheko           0x000000010f46970a 0x10f28e000 + 1947402
19  com.github.mujx.nheko           0x000000010f469565 0x10f28e000 + 1946981
20  libboost_thread-mt.dylib        0x000000010fd4a26c 0x10fd47000 + 12908
21  libsystem_pthread.dylib         0x00007fff5e5c733d _pthread_body + 126
22  libsystem_pthread.dylib         0x00007fff5e5ca2a7 _pthread_start + 70
23  libsystem_pthread.dylib         0x00007fff5e5c6425 thread_start + 13

Thread 4 Crashed:
0   libssl.1.0.0.dylib              0x000000010ff2e2ac 0x10ff1b000 + 78508
1   libssl.1.0.0.dylib              0x000000010ff2e1ff ssl3_setup_read_buffer + 114
2   libssl.1.0.0.dylib              0x000000010ff2c42b ssl3_read_bytes + 73
3   libssl.1.0.0.dylib              0x000000010ff2990e 0x10ff1b000 + 59662
4   com.github.mujx.nheko           0x000000010f4e1343 0x10f28e000 + 2437955
5   com.github.mujx.nheko           0x000000010f50d467 0x10f28e000 + 2618471
6   com.github.mujx.nheko           0x000000010f50e19b 0x10f28e000 + 2621851
7   com.github.mujx.nheko           0x000000010f50dd71 boost::asio::detail::reactive_socket_recv_op<boost::asio::mutable_buffers_1, boost::asio::ssl::detail::io_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp>, boost::asio::ssl::detail::read_op<boost::asio::mutable_buffer>, boost::beast::http::detail::read_some_op<boost::asio::ssl::stream<boost::asio::basic_stream_socket<boost::asio::ip::tcp> >, boost::beast::basic_flat_buffer<std::__1::allocator<char> >, false, boost::beast::http::parser<false, boost::beast::http::basic_string_body<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<char> >, boost::beast::http::detail::read_op<boost::asio::ssl::stream<boost::asio::basic_stream_socket<boost::asio::ip::tcp> >, boost::beast::basic_flat_buffer<std::__1::allocator<char> >, false, boost::beast::http::parser<false, boost::beast::http::basic_string_body<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<char> >, boost::beast::http::detail::parser_is_done, std::__1::__bind<void (mtx::http::Session::*)(boost::system::error_code const&, unsigned long), std::__1::shared_ptr<mtx::http::Session>, std::__1::placeholders::__ph<1> const&, std::__1::placeholders::__ph<2> const&> > > > >::do_complete(void*, boost::asio::detail::scheduler_operation*, boost::system::error_code const&, unsigned long) + 465
8   com.github.mujx.nheko           0x000000010f469bd4 0x10f28e000 + 1948628
9   com.github.mujx.nheko           0x000000010f46970a 0x10f28e000 + 1947402
10  com.github.mujx.nheko           0x000000010f469565 0x10f28e000 + 1946981
11  libboost_thread-mt.dylib        0x000000010fd4a26c 0x10fd47000 + 12908
12  libsystem_pthread.dylib         0x00007fff5e5c733d _pthread_body + 126
13  libsystem_pthread.dylib         0x00007fff5e5ca2a7 _pthread_start + 70
14  libsystem_pthread.dylib         0x00007fff5e5c6425 thread_start + 13
redsky17 commented 5 years ago

Hmm... looks like the crash might have occurred in libssl. I wonder if it has anything to do with the fact that Apple packages their own version of OpenSSL into the operating system.

Could you perhaps post the output of otool -L on the nheko executable so I can see which OpenSSL library it's linking against?

benparsons commented 5 years ago

Probably duplicates #19

aaronraimist commented 5 years ago

Not having this issue but here is otool. Doesn't look like it is using the system's SSL stuff.

otool -L /Applications/Nheko.app/Contents/MacOS/nheko
/Applications/Nheko.app/Contents/MacOS/nheko:
    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1349.91.0)
    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 22.0.0)
    @executable_path/../Frameworks/libboost_atomic-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    @executable_path/../Frameworks/libboost_chrono-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    @executable_path/../Frameworks/libboost_date_time-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    @executable_path/../Frameworks/libboost_iostreams-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    @executable_path/../Frameworks/libboost_random-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    @executable_path/../Frameworks/libboost_regex-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    @executable_path/../Frameworks/libboost_system-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    @executable_path/../Frameworks/libboost_thread-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    @executable_path/../Frameworks/libcmark.0.28.3.dylib (compatibility version 0.28.3, current version 0.28.3)
    @executable_path/../Frameworks/QtSvg.framework/Versions/5/QtSvg (compatibility version 5.12.0, current version 5.12.0)
    @executable_path/../Frameworks/QtConcurrent.framework/Versions/5/QtConcurrent (compatibility version 5.12.0, current version 5.12.0)
    @executable_path/../Frameworks/QtMultimedia.framework/Versions/5/QtMultimedia (compatibility version 5.12.0, current version 5.12.0)
    @executable_path/../Frameworks/liblmdb.dylib (compatibility version 0.0.0, current version 0.0.0)
    @executable_path/../Frameworks/QtMacExtras.framework/Versions/5/QtMacExtras (compatibility version 5.12.0, current version 5.12.0)
    @executable_path/../Frameworks/libsodium.23.dylib (compatibility version 26.0.0, current version 26.0.0)
    @executable_path/../Frameworks/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    @executable_path/../Frameworks/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.8)
    @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.12.0, current version 5.12.0)
    @executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.12.0, current version 5.12.0)
    @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui (compatibility version 5.12.0, current version 5.12.0)
    @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.12.0, current version 5.12.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.5.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2)
    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1504.83.101)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1349.8.0)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
            
deepbluev7 commented 4 years ago

Can anyone still reproduce this? We changed a lot of stuff, that could lead to this and I haven't heard anyone complaining about this anymore. If none speak up, I'm gonna close this the next time I'm going through our bug list. :3