Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 789685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:33:46+00:00 2026-05-14T21:33:46+00:00

As i understood, the threads provided by GCD do have a runloop but no

  • 0

As i understood, the threads provided by GCD do have a runloop but no source/port. Now i use some of methods that call AppleScripts thru AppleEvents inside an NSOperationQueue. And sometimes my app crashes with following stacktrace.

my questions:

  • Usage of AppleScript inside a NSInvocationOperation or NSBlockOperation
  • Usage of AppleEvents inside GCD-Threads
  • do i have to add a source / port to a runloop of a gcd-thread before using AppleEvents?
  • do i have to add a source / port to a runloop of a gcd-thread before using [CATransaction commit]?
  • do i have to add a source / port to a runloop of a gcd-thread before using [NSObject performSelectorAfterDelay…] ?
  • if yes, how?
  • can i simply call CFRunLoopRunInMode(kCFRunLoopDefaultMode, 5.0, false); /// or 30 or the defined timeout of appleevent?
..

Thread 9: Dispatch queue: com.apple.root.default-priority
0 libSystem.B.dylib 0x00007fff88276e82 semaphore_wait_signal_trap 10
1 libSystem.B.dylib 0x00007fff8827c3cd pthread_mutex_lock 469
2 com.apple.applescript 0x000000011d3d461f AppleScriptComponent 50
3 com.apple.applescript 0x000000011d3edbcc AGenericCall::Delegate(ComponentInstanceRecord*) 46
4 com.apple.applescript 0x000000011d3ed520 AGenericManager::HandleOSACall(ComponentParameters*) 54
5 com.apple.applescript 0x000000011d3ed4b0 GenericComponent 219
6 com.apple.openscripting 0x00007fff8381c6da OSAExecuteEvent 63
7 com.apple.Foundation 0x00007fff86f320d8 -[NSAppleScript(NSPrivate) _executeAppleEvent:withMode:error:] 161
8 xxx 0x0000000100048af0 -[TCallScript callScript:withArrayOfParameters:] 480
9 xxx 0x0000000100048ffd -[TCallScript callHandler:withParameters:] 477
10 xxx 0x0000000100036032 -[ZFOpenWindowController getSafariItemForCurrentTabForWindow:] 66
11 xxx 0x00000001000346af -[ZFOpenWindowController refreshWindowList:] 1679
12 xxx 0x000000010003541c -[ZFOpenWindowController bringZFToForegroundZoomOut:orJustLinkFrontMost:toItem:] 2988
13 xxx 0x0000000100053556 __-[ZFSelectionTool openWithPreferredApplication:]_block_invoke_516 54
14 com.apple.Foundation 0x00007fff86ed87d9 -[NSBlockOperation main] 140
15 com.apple.Foundation 0x00007fff86ec906d -[__NSOperationInternal start] 681
16 com.apple.Foundation 0x00007fff86ec8d23 ____startOperations_block_invoke_2 99
17 libSystem.B.dylib 0x00007fff882b2ce8 _dispatch_call_block_and_release 15
18 libSystem.B.dylib 0x00007fff88291279 _dispatch_worker_thread2 231
19 libSystem.B.dylib 0x00007fff88290bb8 _pthread_wqthread 353
20 libSystem.B.dylib 0x00007fff88290a55 start_wqthread 13


...


Thread 11 Crashed: Dispatch queue: com.apple.root.default-priority
0 com.apple.applescript 0x000000011d40f658 BCHandleError() 182
1 com.apple.applescript 0x000000011d4059ca UASExecute1() 2546
2 com.apple.applescript 0x000000011d3dd1d5 ASExecuteEvent(AEDesc const*, unsigned int, int, unsigned int*) 695
3 ...ple.CoreServices.CarbonCore    0x00007fff85388e04 CallComponentFunction 28
4 com.apple.applescript 0x000000011d3d4cad AppleScriptComponent 1728
5 com.apple.applescript 0x000000011d3edbcc AGenericCall::Delegate(ComponentInstanceRecord*) 46
6 com.apple.applescript 0x000000011d3ed520 AGenericManager::HandleOSACall(ComponentParameters*) 54
7 com.apple.applescript 0x000000011d3ed4b0 GenericComponent 219
8 com.apple.openscripting 0x00007fff8381c6da OSAExecuteEvent 63
9 com.apple.Foundation 0x00007fff86f320d8 -[NSAppleScript(NSPrivate) _executeAppleEvent:withMode:error:] 161
10 xxx 0x0000000100048af0 -[TCallScript callScript:withArrayOfParameters:] 480
11 xxx 0x0000000100048ffd -[TCallScript callHandler:withParameters:] 477
12 xxx 0x0000000100035c67 -[ZFOpenWindowController getItemForAXDocumentOfFrontMostWindow] 119
13 xxx 0x00000001000359f1 -[ZFOpenWindowController getItemForFrontMostWindow:] 721
14 xxx 0x00000001000348ac -[ZFOpenWindowController bringZFToForegroundZoomOut:orJustLinkFrontMost:toItem:] 60
15 xxx 0x0000000100053556 __-[ZFSelectionTool openWithPreferredApplication:]_block_invoke_516 54
16 com.apple.Foundation 0x00007fff86ed87d9 -[NSBlockOperation main] 140
17 com.apple.Foundation 0x00007fff86ec906d -[__NSOperationInternal start] 681
18 com.apple.Foundation 0x00007fff86ec8d23 ____startOperations_block_invoke_2 99
19 libSystem.B.dylib 0x00007fff882b2ce8 _dispatch_call_block_and_release 15
20 libSystem.B.dylib 0x00007fff88291279 _dispatch_worker_thread2 231
21 libSystem.B.dylib 0x00007fff88290bb8 _pthread_wqthread 353
22 libSystem.B.dylib 0x00007fff88290a55 start_wqthread 13

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T21:33:47+00:00Added an answer on May 14, 2026 at 9:33 pm

    Note that the AppleScript component has limited thread safety. As of 10.6, you can use it on non-main threads, but you will need to create a new ComponentInstance for each thread. I think you can do this with OSAKit, otherwise you’ll need to resort to the gnarly Carbon API. What’s best really depends on what you’re trying to achieve (e.g. are you running user-supplied scripts, or scripts hardcoded into your application, and what’s the motivation for running them via NSOperationQueue).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I understand that requests are served by different threads, but do they all come
I understood that this Bind attribute was not necessary, but JSON type is not
I have a simple program which starts n threads and create some load on
I have developed an Android application that has 1 process and 2 services. But
I have built a standalone app version of a project that until now was
I understand that creating too many threads in an application isn't being what you
This is a short question. At some point my thread understand that it should
I am confused on the following: To use threads in a Java program, the
I understand that this is a probably a noob-ish question, but I've had no
I understand how STI works, in that I have say a Post model that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.