Subject Re: [firebird-support] running Firebird without fbintl
Author Hamish Moffatt
On 05/07/18 22:47, 'Paul Beach' pbeach@... [firebird-support] wrote:
 


<<I suspect it is some sort of conflict between libicu linked into fbintl
and libicu used in the macOS system frameworks (and I suspect a change
to icu in macOS is why this only started with 10.13). I tried to rebuild
Firebird with a later version but didn't get very far>>

MacOS does not use a full icu implementation, so I doubt you are linking
against the system icu lib (/usr/lib/libicucore.dylib) unless of course
you are specifically requesting it.

To be honest I doubt you could build Firebird if you hadn't installed
a proper copy of icu from elsewhere.

Personally I expect the problem is elsewhere...
Does it crash on 10.13 or on earlier versions of the OS?
Have you analysed a crash dump?
What happens if you use isql on your embedded version of Firebird?
What version of Firebird are you using?


It only crashes on 10.13, not earlier versions. (I haven't tried the 10.14 beta yet.)

I'm using Firebird 2.5.7. Looking at the traces again icu is probably not relevant at all actually. (The Firebird sources includes icu 30 in extern, so I did not have to install my own.)

Firebird works fine, but invoking the Mac file open dialog causes the application to crash, and the back trace always references fbintl.

We are using Firebird via Qt. Qt dynamically loads its Firebird driver (libqsqlibase.dylib) which is linked against the Firebird framework which is dynamically loading fbintl.

It looks like the custom memory allocator that fbintl is using is involved. Perhaps it didn't get initialized properly because of the dynamic loading of the Firebird framework etc?


Here are a couple of example traces.  As you can see neither of these involve our application code, they are pure macOS framework threads, except that fbintl is in the trace.


Thread 6 Crashed:: Dispatch queue: quicklook.pluginload
0   libsystem_pthread.dylib           0x00007fff69cd73d5 pthread_mutex_lock + 0
1   fbintl                            0x0000000115339889 Firebird::Mutex::enter() + 9
2   fbintl                            0x0000000115341c9e Firebird::MemoryPool::deallocate(void*) + 62
3   fbintl                            0x0000000115342279 operator delete(void*) + 9
4   com.apple.security.csparser       0x000000011b698de9 Security::CodeSigning::Requirement const* Security::CodeSigning::parse<Security::CodeSigning::StringInputStream, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Security::CodeSigning::Requirement>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Security::CodeSigning::Requirement* (Security_CodeSigning::RequirementParser::*)(), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) + 258
5   com.apple.security.csparser       0x000000011b698166 Security::CodeSigning::stringRequirement(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) + 52
6   com.apple.security                0x00007fff4de32dd8 Security::CodeSigning::Requirement const* Security::CodeSigning::parse<Security::CodeSigning::Requirement, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Security::CodeSigning::Requirement const* (* Security::CodeSigning::AntlrPlugin::*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)) + 74
7   com.apple.security                0x00007fff4de32d58 Security::CodeSigning::RequirementParser<Security::CodeSigning::Requirement>::operator()(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 34
8   com.apple.security                0x00007fff4de06234 SecRequirementCreateWithStringAndErrors + 70
9   com.apple.QuickLookFramework      0x00007fff4d4dc76d QLCheckAppleSignature + 69
10  com.apple.QuickLookFramework      0x00007fff4d4a7fc4 _QLLoadPluginAtURL + 1267
11  com.apple.QuickLookFramework      0x00007fff4d4a74ec ___QLLaunchUpdatingThread_block_invoke + 1543
12  libdispatch.dylib                 0x00007fff69a1c591 _dispatch_call_block_and_release + 12
13  libdispatch.dylib                 0x00007fff69a14d50 _dispatch_client_callout + 8
14  libdispatch.dylib                 0x00007fff69a2920c _dispatch_queue_serial_drain + 635
15  libdispatch.dylib                 0x00007fff69a1c0fd _dispatch_queue_invoke + 373
16  libdispatch.dylib                 0x00007fff69a29f02 _dispatch_root_queue_drain_deferred_wlh + 332
17  libdispatch.dylib                 0x00007fff69a2dd16 _dispatch_workloop_worker_thread + 880
18  libsystem_pthread.dylib           0x00007fff69cd9033 _pthread_wqthread + 980
19  libsystem_pthread.dylib           0x00007fff69cd8c4d start_wqthread + 13



Thread 1 Crashed:: Dispatch queue: NSTextCheckingOperationQueue (QOS: USER_INTERACTIVE)
0   fbintl                            0x000000010f3ebcd8 Firebird::MemoryPool::deallocate(void*) + 120
1   fbintl                            0x000000010f3ec279 operator delete(void*) + 9
2   com.apple.CoreNLP                 0x00007fff3d446b03 CoreNLP::ICUTextBreakWithCustomizedRules::ICUTextBreakWithCustomizedRules(CoreNLP::TaggerContext const&, __CFURL const*, bool, bool, void (CFRange, bool&, void (NLToken*, bool*) block_pointer) block_pointer) + 323
3   com.apple.CoreNLP                 0x00007fff3d43d994 CoreNLP::DefaultSubWordTagger::DefaultSubWordTagger(CoreNLP::TaggerContext const&, CoreNLP::StringBuffer const&, unsigned long, __CFURL const*) + 282
4   com.apple.CoreNLP                 0x00007fff3d407580 CoreNLP::WordDispatchTagger::WordDispatchTagger(CoreNLP::TaggerContext&, __CFURL const*) + 220
5   com.apple.CoreNLP                 0x00007fff3d447b3d CoreNLP::WordTagger::createWordTagger(CoreNLP::TaggerContext&) + 41
6   com.apple.CoreNLP                 0x00007fff3d41a6d4 NLTokenizerCreate + 100
7   com.apple.CoreNLP                 0x00007fff3d40c920 NLStringTokenizerCreate + 388
8   com.apple.CoreFoundation          0x00007fff2a10ecf2 CFStringTokenizerCreate + 146
9   com.apple.AppKit                  0x00007fff280bb00a scoreParagraph + 185
10  com.apple.AppKit                  0x00007fff2787e2f4 NSSpellCheckerCheckString + 3952
11  com.apple.AppKit                  0x00007fff2796d071 -[NSTextCheckingOperation main] + 151
12  com.apple.Foundation              0x00007fff2c17edc2 -[__NSOperationInternal _start:] + 778
13  com.apple.Foundation              0x00007fff2c17adeb __NSOQSchedule_f + 369
14  libdispatch.dylib                 0x00007fff515e2f64 _dispatch_client_callout + 8
15  libdispatch.dylib                 0x00007fff515f6091 _dispatch_continuation_pop + 472
16  libdispatch.dylib                 0x00007fff515ed8e0 _dispatch_async_redirect_invoke + 703
17  libdispatch.dylib                 0x00007fff515e4b56 _dispatch_root_queue_drain + 515
18  libdispatch.dylib                 0x00007fff515e4902 _dispatch_worker_thread3 + 101
19  libsystem_pthread.dylib           0x00007fff518a61ca _pthread_wqthread + 1387
20  libsystem_pthread.dylib           0x00007fff518a5c4d start_wqthread + 13


Hamish