Crashing bug in 'do shell script' since Mac OS X 10.4.2 - with a workaround
Crashing bug in 'do shell script' since Mac OS X 10.4.2 - with a workaround
- Subject: Crashing bug in 'do shell script' since Mac OS X 10.4.2 - with a workaround
- From: "Scott Babcock" <email@hidden>
- Date: Mon, 16 Jan 2006 19:46:16 -0800
- Thread-topic: Crashing bug in 'do shell script' since Mac OS X 10.4.2 - with a workaround
Apple revised 'do shell script' in 10.4.2 and 10.4.3 to improve its
performance and apparently made it thread-unsafe in the process.
I use the 'ps' utility to poll the process list so my scripts are
synchronized with the state of certain key components that I'm
automating, and I had no problems before 10.4.2. Since upgrading,
though, I've been getting random crashes in my scripts at the
synchronization points.
In addition to the scripts themselves, I'm also running a Carbon
application that polls the process list, and it appears that the
application and 'do shell script' are now sharing a single environment.
If things interact in just the wrong way, 'do shell script' gets stopped
mid-process, its data gets trashed, and it crashes when it restarts.
I've logged a RADAR bug on this, but I can't revert to 10.3.9 waiting
for the fix. The workaround is to spawn another shell to get process
isolation:
set shellCmd to "ps -xco state,command | grep -E
'^(S|I).*myProcName$'"
do shell script "sh -c " & (quoted form of shellCmd)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden