Project

General

Profile

Bug #8002

WServer shutting down when setting breakpoint in XCode

Added by Martin Melcher 6 months ago. Updated 6 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
01/28/2021
Due date:
% Done:

0%

Estimated time:

Description

Hi,
I'm working on an application which runs in two parallel threads. The main thread is launching the WServer, a second thread runs calculations in the background. Everything runs fine, except

  • while the application is running, the moment I set a breakpoint in XCode, the WServer shuts down and halts the entire application with a SIGABRT. Regardless of whether the program actually gets to that breakpoint or not. How can I find out what the problem is?

Here is the output:

[2021-Jan-27 19:59:33.445] 77317 - [info] "WebRequest: took 47.904 ms"
Shutdown (signal = -1)
[2021-Jan-27 19:59:38.296] 77317 - [info] "WebController: shutdown: stopping 1 sessions."
[2021-Jan-27 19:59:38.303] 77317 [/ 9OCGtr4fcH6Nk1wC] [info] "Wt: session destroyed (#sessions = 0)"
[2021-Jan-27 19:59:38.303] 77317 - [info] "WServer/wthttp: Shutdown: stopping web server."
127.0.0.1 - - [2021-Jan-27 19:59:38.303] "POST /?wtd=9OCGtr4fcH6Nk1wC HTTP/1.1" 200 0
[2021-Jan-27 19:59:38.303] 77317 - [info] "WebRequest: took 4850.98 ms"
libc++abi.dylib: terminating
(lldb) bt

  • thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT frame #0: 0x00007fff20347462 libsystem_kernel.dylib__pthread_kill + 10 frame #1: 0x00000001017f5ec4 libsystem_pthread.dylibpthread_kill + 263 frame #2: 0x00007fff202c8720 libsystem_c.dylibabort + 120 frame #3: 0x00007fff2033a418 libc++abi.dylibabort_message + 231 frame #4: 0x00007fff2032b9a3 libc++abi.dylibdemangling_terminate_handler() + 48 frame #5: 0x00007fff20339847 libc++abi.dylibstd::terminate(void (*)()) + 8 frame #6: 0x00007fff203397f8 libc++abi.dylibstd::terminate() + 56 frame #7: 0x00007fff203137ed libc++.1.dylibstd::1::thread::~thread() + 17 frame #8: 0x0000000100031f72 Simmain(argc=6, argv=0x00007ffeefbff3f8, environ=0x00007ffeefbff430) at main.cpp:1055:1 frame #9: 0x00007fff20390621 libdyld.dylibstart + 1
    • frame #10: 0x00007fff20390621 libdyld.dylib`start + 1 (lldb)
#1

Updated by Roel Standaert 6 months ago

If you're using WServer::waitForShutdown() (or WRun or WServer::run()) that will catch the signal used to temporarily interrupt the program in order to install the breakpoint and cause your process to halt. I think that's the reason. If you run with the --gdb option it will not catch all signals.

I do wonder if there isn't a way we can make the debugger still do its thing and allow clean termination. Of course, there's nothing stopping you from writing your own waitForShutdown()-like code, that's just what Wt uses by default.

Also available in: Atom PDF