On Sunday, June 11, 2023 at 10:21:36 PM UTC+1, Chris M. Thomasson wrote:
>>
> > How would you go about figuring this out? I'm using the latest Ubuntu Linux on x86_64.
> Not sure. Perhaps the sanitizer creates some extra threads? Create your
> program in a release build with all sanitize stuff turned off.
>
> The main thread runs your GUI loop, right?
Just now I made a build with "-O3 -DNDEBUG", without all the address sanitizer stuff. It has 7 threads.
The main thread is managed by the wxWidgets library, it's the GUI thread. Two threads are spawned by my own code. I don't know where the other 4 have come from.
Ideally I'd like to be able to run it in a debugger and issue a command something like "find thread starts", and to have it come back with something like:
Thread 1 started in GUI_Dialog_Main.cpp on Line 57
Thread 2 started in common_callers.c on Line 89
Thread 3 started in main.cpp on Line 12
Thread 4 started inside shared library libWhatever.so
Actually just now inside the GDB debugger, I issued the command "info threads" and I got back:
(gdb) info threads
Id Target Id Frame
* 1 Thread 0x7ffff5e1ba80 (LWP 115888) "dynamo" 0x00007ffff691112f in __GI___poll (fds=0x555556432170, nfds=3, timeout=1000) at ../sysdeps/unix/sysv/linux/poll.c:29
2 Thread 0x7ffff57ff6c0 (LWP 115891) "gmain" 0x00007ffff691112f in __GI___poll (fds=0x555555d253a0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
3 Thread 0x7ffff4ffe6c0 (LWP 115892) "pool-dynamo" syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
4 Thread 0x7fffeffff6c0 (LWP 115893) "gdbus" 0x00007ffff691112f in __GI___poll (fds=0x7fffe800ffa0, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
5 Thread 0x7fffef7fe6c0 (LWP 115894) "dconf worker" 0x00007ffff691112f in __GI___poll (fds=0x555555d3e750, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
6 Thread 0x7fffee86e6c0 (LWP 115895) "dynamo" syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
7 Thread 0x7fffee06d6c0 (LWP 115896) "dynamo" syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
I tried issuing the command "thread apply all bt" but I'm not sure about what it comes back with -- it seems like some of the threads might be spawned inside libglib.