[launchd-dev] Mac OS-X 10.5 and "two icons bouncing in the dock" problem

Hans-Peter Jansen hpj at urpla.net
Fri Aug 14 01:31:20 PDT 2009


[Probably, this is the wrong list, but launchd is definitely involved;
 Any pointer to more appropriate lists are welcome]

Hi,

attached PyQt script demonstrates an ugly issue, I'm fighting with since a 
couple of days :-(.

Issue:
when starting the app via double click or single click on dock icon or 
dropping a plain/text file on dock or application icon, all actions lead to 
two bouncing icons. 

The one with the blue spot is the good one, that stops bouncing after 
start-up. The bad one will stop bouncing eventually, and shows "Application 
not responding" in its context menu then. As long as the bad one exists, 
dropping files on the good one will be ignored. After killing (and 
sometimes removing from the dock is necessary) all is well - one can drop 
files one the good one and on the app icon, all behaves well, up to the 
point of being terminated, then this ugly game starts again.

The issue is not depending on the arch, but on OS-X 10.5. It does not happen 
with 10.4. It may be related to pyinstaller, but since I need to deploy the 
app on arbitrary 10.4 and later systems, omitting it is not an option. 

Termination of this process is accompanied with these syslog messages:
Aug 13 19:01:26 g5 com.apple.launchd[124] 
([0x0-0x130130]..local.LaunchProb[9611]): Stray process with PGID equal to 
this dead job: PID 9612 PPID 1 LaunchProb
Aug 13 19:01:26 g5 com.apple.launchd[124] 
([0x0-0x130130]..local.LaunchProb[9611]): Exited: Terminated

BTW: pyinstaller does a fork in start up, see 
pyinstaller/source/linux/main.c around line 120;

#ifdef __APPLE__
        /* add workpath to DYLD_LIBRARY_PATH */
        exportWorkpath(workpath, "DYLD_LIBRARY_PATH");
#endif
        pid = fork();
        if (pid == 0)
            execvp(thisfile, argv);
        wait(&rc);
        rc = WEXITSTATUS(rc);

        VS("Back to parent...\n");
        if (strcmp(workpath, homepath) != 0)
            clear(workpath);

It seems to be the culprit, what what could be done to get this working 
nicely with 10.5, too? Should I set the same pgid on both processes? Any 
pointer to examples?

Pre conditions:
OS-X 10.5(.7/.8) with ppc or x86 arch
Xcode 3.1.3
Python-2.6.2
Qt-4.5.2
sip-4.8.2
PyQt-4.5.4

Build it this way:

tar xvzf launchprob.tar.gz && cd launchprob && ./build.sh -debug

This command will fetch pyinstaller's SVN trunk, build pyinstaller, generate 
the app itself: LaunchProb.app. It can be moved to any system, as long as 
all required packages are cleanly built for both archs(*) and the minimum 
OS-X release is 10.4. 

Any ideas how to solve this issue are greatly appreciated.

Thanks,
Pete

(*) I can provide more details for this on request
-------------- next part --------------
A non-text attachment was scrubbed...
Name: launchprob.tar.gz
Type: application/x-tgz
Size: 2167 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/launchd-dev/attachments/20090814/ba762135/attachment.bin>


More information about the launchd-dev mailing list