« Controlling the Print… | Home | MBS Filemaker Plugin,… »

FileMaker crashing

Did you see FileMaker crashing?
Well, on Mac the crash reports can actually tell you where the problem may be. For example we sometimes have crash reports like this:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib     0x97c9d952 __pthread_kill + 10
1   libsystem_pthread.dylib     0x971a2167 pthread_kill + 101
2   libsystem_c.dylib     0x94d6540c __abort + 187
3   libsystem_c.dylib     0x94d65c8e __stack_chk_fail + 233
4   com.apple.CoreServices.CarbonCore     0x946aa4dc ConvertFromUnicodeToNormalized + 3023
5   com.apple.CoreServices.CarbonCore     0x9469cae2 ConvertFromUnicodeToTextImplementation + 678
6   com.filemaker.support.framework     0x027b7d4c Unicode::ConvertToUTF16(unsigned short*, unsigned long*, char const*, unsigned long, unsigned long*, Unicode::Encoding, Unicode::Composition) + 556
7   com.filemaker.support.framework     0x027b7d9c Unicode::ConvertToUTF16(unsigned short*, unsigned long*, char const*, unsigned long, Unicode::Encoding, Unicode::Composition) + 60
8   com.filemaker.support.framework     0x0279991c Draco::TextBuffer::ConvertFromNonUnichars(char const*, unsigned long, Unicode::Encoding) + 316
9   com.filemaker.fmwrapper.framework     0x19ca76dd FM_Text_AssignWithLength + 93

Here a plugin calls FM_Text_AssignWithLength to assign some text string to a text object in the plugin API. Now if you assign a normal text string, you provide an encoding hint and FileMaker will do some text conversion. And right there in the framework, the call to ConvertFromUnicodeToNormalized will overwrite the stack and cause the app to be aborted.

One of the reasons so far has been that invalid UTF-8 character sequences can cause this buffer overrun.
To fix the MBS Plugin now checks all UTF-8 marked text to have valid sequences.
09 11 13 - 10:53