Debugging an app bundle on MacOSX

Henrik Brautaset Aronsen subsurface at henrik.synth.no
Sat Feb 9 09:36:37 PST 2013


I was trying to debug some stuff in Subsurface today, and stumbled upon 
some barriers when running it as an app bundle.

There are four ways of starting Subsurface:

1) Run the binary directly from the Terminal:  ./subsurface
2) Start the app bundle from the Terminal, with path reference:  open 
/Applications/Subsurface.app
3) Start the app bundle from the Terminal, with application reference:  
open -a Subsurface
4) Double-click the Subsurface icon in the /Applications folder.

The app bundle was generated with "make install-macosx".

Here's a simple example that I put on top of subsurface_ui_setup() in 
macos.c:

     FILE *file = fopen("/tmp/file.txt", "a+");
     if (file != NULL) {
         fprintf(file,"Silly test message");
         fclose(file);
     }
     syslog(LOG_ERR, "Another silly test message");

I had no problems when running as 1) or 2).  /tmp/file.txt was written 
to, and so was /var/log/system.log.

However, when run as 3) or 4), neither works.  Both operations fails 
silently.

Does anyone know what's going on here?  Mandatory sandboxing?  It's 
driving me quite mad.

Henrik



More information about the subsurface mailing list