OSX - Qt application crashed when receiving system event QEvent::FileOpen

1

I'm using plist file to allow my Qt Application to be able to open files directly from the finder. Unfortunately sometimes and on some systems (described bellow) application crashes / freezes.

This problem occurs only on some client computers and only when I compile application on our production computer with 10.6.8 OSX. When I compile it on my 10.9.1 OSX, everything works ok.

I tried several changes and comment lot of code in our app, but application crashes also when the whole QApplication::event() method is commented. It seems to me as some bug in 10.8.6 OSX / 3.2.6 Xcode. Unfortunately right now I can't update it to newer version because of some backward compatibility issues.

I'm using latest Qt 4.8.6 from git and the same behavior was on official 4.8.2 version.

Is there any known workaround or any advice how to find/fix this bug? It's very difficult because this event can't be tested from debugger and tracing with QMessageBox crashed too no matter if event is handled or not. Also crash callstack doesn't show anything usefull (look bellow).

My Application plist file has following format:

  <key>CFBundleDocumentTypes</key>
  <array>
    <dict>
      <key>CFBundleTypeName</key>         <string>ORM Designer project file</string>
      <key>CFBundleTypeRole</key>         <string>Editor</string>
      <key>CFBundleTypeIconFile</key>     <string>@ICON@</string>
      <key>LSHandlerRank</key>            <string>Owner</string>
      <key>LSIsAppleDefaultForType</key>  <true/>
      <key>CFBundleTypeExtensions</key>   
      <array>
        <string>ormdesigner</string>
        <string>ormdes</string>
        <string>ormdesigner2</string>
        <string>ormdes2</string>
      </array>
    </dict>
  </array>

Callstack captured by Google's CrashPad:

Crash reason: EXC_BAD_ACCESS / 0x0000000d Crash address: 0x0

Thread 0 (crashed)
 0  QtCore + 0x7cd6a
    rbx = 0x00000000ffffffff   r12 = 0x6163696c7070412f
    r13 = 0x00007fff5fbfbe30   r14 = 0x00007fff5fbfbfb0
    r15 = 0x0000000000007fff   rip = 0x00000001054bed6a
    rsp = 0x00007fff5fbfbe00   rbp = 0x00007fff5fbfbe20
    Found by: given as instruction pointer in context
 1  QtCore + 0x13f2cb
    rip = 0x00000001055812cc   rsp = 0x00007fff5fbfbe30
    rbp = 0x00007fff5fbfbe70
    Found by: stack scanning
 2  QtGui + 0x38b4e
    rip = 0x00000001057b6b4f   rsp = 0x00007fff5fbfbe80
    rbp = 0x00007fff5fbfc000
    Found by: stack scanning
 3  libobjc.A.dylib + 0x78e1
    rip = 0x00007fff8cce48e2   rsp = 0x00007fff5fbfbee0
    rbp = 0x00007fff5fbfc000
    Found by: stack scanning
 4  libobjc.A.dylib + 0x121db
    rip = 0x00007fff8ccef1dc   rsp = 0x00007fff5fbfbf50
    rbp = 0x00007fff5fbfc000
    Found by: stack scanning
 5  CoreFoundation + 0x1a9eef
    rip = 0x00007fff8752aef0   rsp = 0x00007fff5fbfbf68
    rbp = 0x00007fff5fbfc000
    Found by: stack scanning

Complete callstack is posted to pastebin.

Thanks for any advice Ludek

c++
macos
qt
finder
file-association
asked on Stack Overflow Jan 6, 2014 by Ludek Vodicka • edited Jan 7, 2014 by Ludek Vodicka

1 Answer

0

We decided to reinstall two of our build machines, one to Mac OSX 10.6.8 and one to OSX 10.7.5.

We installed completely the same SW on both machines with the only difference in Xcode. On 10.6.8 it was the latest 3.2.6 and on 10.7.5 it was 4.6.3.

When we built our application on both machines, version created at 10.7 works perfectly without any crash. Application built on 10.6. crashes again. So from all what we tried (we spent about 30hours on this bug) I'm almost sure that the problem is inside the Xcode compiler.

If anyone has the similar issue, the simplest and less time consuming way how to solve it is to update his build machine to newer version.

answered on Stack Overflow Jan 7, 2014 by Ludek Vodicka

User contributions licensed under CC BY-SA 3.0