Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3773

App quit exception when a thread using a 3rd party API had been used

$
0
0

So I am in the process of moving previous console helper classes into preemptive threaded ones. These classes address measurement instruments; sometimes via Serial, sometimes through supplier APIs. For the latter ones I found DeclareLibraryMBS to be a great help; and basically the whole model works really nicely. But whenever I used such a thread class in the desktop app that’s containing it, during app quit I will always get an exception on what is very probably the thread class that was definitely stopped before.

This specific API is troublesome anyway: It is not UB on macOS, so I have to build the app for Intel. It is bound to a handful of other libraries, some of them QT, which are not easy to include: If I import them into the app before the internal code signing, Xojo will crash when it finds it cannot sign them. So I have another build step after signing to import them, and AppWrapper luckily does not encounter any issues then. Don’t know if that’s related … Crash report always looks like

Thread 7 Crashed:: EthernetThread
0 libRosettaRuntime 0x1118fb024 0x1118ad000 + 319524
1 ??? 0x109d987e0 ???
2 ??? 0x100000084 ???
3 QtCore 0x135f51849 0x135f2f000 + 141385
4 libsystem_pthread.dylib 0x7ff805cdb253 _pthread_start + 99
5 libsystem_pthread.dylib 0x7ff805cd6bef thread_start + 15

and main thread will always look like

Error Formulating Crash Report:
PC register does not match crashing frame (0x0 vs 0x1118FB024)

Thread 0:: Dispatch queue: com.apple.main-thread
0 runtime 0x7ff7ffca6d68 0x7ff7ffca3000 + 15720
1 runtime 0x7ff7ffcafad4 0x7ff7ffca3000 + 51924
2 runtime 0x7ff7ffcad324 0x7ff7ffca3000 + 41764
3 ??? 0x1098ac514 ???
4 ??? 0x1099b4bf8 ???
5 myApp.debug 0x103683f0f DeclareLibraryMBS.__exit%%o + 31
6 XojoFramework 0x112bc8113 0x11295f000 + 2527507
7 XojoFramework 0x112bc7ea5 RuntimeUnlockObject + 107
8 XojoFramework 0x112aca8ab RuntimeViewWindow::Close() + 253
9 XojoFramework 0x112accb41 RuntimeView::UnifiedClose(bool) + 529
10 XojoFramework 0x112abe4af 0x11295f000 + 1438895
11 XojoFramework 0x112c268fe IterateWindowList(unsigned char ()(Window, void*), void*) + 1176
12 XojoFramework 0x112abe368 TestApplicationQuit() + 111
13 XojoFramework 0x112abe504 ApplicationQuit(long long, unsigned char) + 13

Any ideas what might be the cause and how to fix the exception?

Pinging @Christian_Schmitz as I always see DeclareLibraryMBS.exit in the vicinity of this bug.

8 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 3773

Trending Articles