That is all backtrace..
After that ,there is have a log .
I have been try it with dispatch_async in main quque.
dispatch_async(dispatch_get_main_queue(), ^{
testView *tv = [[testView alloc] initWithWindowNibName:@"testView"];
[tv showSelfWindow];
});
-(void)showSelfWindow
{
[NSApp activateIgnoringOtherApps:YES];
[[self window] makeKeyAndOrderFront:self];
[[self window] setLevel:NSFloatingWindowLevel];
[NSApp beginModalSessionForWindow:[self window]];
}
Then,this xpc process is crashed. such as:
Process: xpcHelp [24703]
Path: /Users/USER/Library/Developer/Xcode/DerivedData/FeiTianMgr-dksrvbbveekoewdqoukdcwspttaz/Build/Products/Debug/FeiTianMgr.app/Contents/PlugIns/BrowserExt.appex/Contents/XPCServices/xpcHelp.xpc/Contents/MacOS/xpcHelp
Identifier: com.ftsafe.xpcHelp
Version: 1.0 (1)
Code Type: X86-64 (Native)
Parent Process: ??? [24682]
Responsible: BrowserExt [24688]
User ID: 501
Date/Time: 2019-02-18 11:50:05.637 +0800
OS Version: Mac OS X 10.14.3 (18D32a)
Report Version: 12
Bridge OS Version: 3.3 (16P53129a)
Anonymous UUID: 7E1DE390-4665-9E9B-5FE8-F973A45D07C5
Sleep/Wake UUID: 9424F2D7-4B0C-41F7-9917-14B1C774054C
Time Awake Since Boot: 230000 seconds
Time Since Wake: 69000 seconds
System Integrity Protection: enabled
Crashed Thread: 4 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
External Modification Warnings:
Debugger attached to process.
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow drag regions should only be invalidated on the Main Thread!'
abort() called
terminating with uncaught exception of type NSException
Application Specific Backtrace 1:
0 CoreFoundation 0x00007fff49eceecd __exceptionPreprocess + 256
1 libobjc.A.dylib 0x00007fff75f96720 objc_exception_throw + 48
2 CoreFoundation 0x00007fff49ee895d -[NSException raise] + 9
3 AppKit 0x00007fff473e9c8e -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 324
4 AppKit 0x00007fff473e707c -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1488
5 AppKit 0x00007fff473e6aa6 -[NSWindow initWithContentRect:styleMask:backing:defer:] + 45
6 AppKit 0x00007fff473e4fb7 -[NSWindowTemplate nibInstantiate] + 495
7 AppKit 0x00007fff4736004e -[NSIBObjectData instantiateObject:] + 267
8 AppKit 0x00007fff4735f3bc -[NSIBObjectData nibInstantiateWithOwner:options:topLevelObjects:] + 579
9 AppKit 0x00007fff4735d5e9 loadNib + 401
10 AppKit 0x00007fff4735cab1 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:options:withZone:ownerBundle:] + 696
11 AppKit 0x00007fff474e90d2 +[NSBundle(NSNibLoadingInternal) _loadNibFile:externalNameTable:options:withZone:] + 156
12 AppKit 0x00007fff474e8e8f -[NSWindowController loadWindow] + 322
13 AppKit 0x00007fff4744b618 -[NSWindowController window] + 84
14 xpcHelp 0x00000001099e71da -[testView showSelfWindow] + 58
15 xpcHelp 0x0000000109a3a747 __48-[xpcHelp sendToXpcWith:withUserInfo:withReply:]_block_invoke + 87
16 libdispatch.dylib 0x00007fff77015d53 _dispatch_call_block_and_release + 12
17 libdispatch.dylib 0x00007fff77016dcf _dispatch_client_callout + 8
18 libdispatch.dylib 0x00007fff7701d124 _dispatch_lane_serial_drain + 618
19 libdispatch.dylib 0x00007fff7701dc0c _dispatch_lane_invoke + 436
20 libdispatch.dylib 0x00007fff77024d26 _dispatch_root_queue_drain + 325
21 libdispatch.dylib 0x00007fff770254bd _dispatch_worker_thread2 + 90
22 libsystem_pthread.dylib 0x00007fff772576dd _pthread_wqthread + 619
23 libsystem_pthread.dylib 0x00007fff77257405 start_wqthread + 13
Thread 0:
0 libsystem_kernel.dylib 0x00007fff771a207a __semwait_signal_nocancel + 10
1 libsystem_c.dylib 0x00007fff770b7962 nanosleep$NOCANCEL + 188
2 libsystem_c.dylib 0x00007fff770ddf2a sleep$NOCANCEL + 41
3 libdispatch.dylib 0x00007fff77026838 _dispatch_queue_cleanup2 + 112
4 libsystem_pthread.dylib 0x00007fff772586c2 _pthread_tsd_cleanup + 550
5 libsystem_pthread.dylib 0x00007fff7725b679 _pthread_exit + 70
6 libsystem_pthread.dylib 0x00007fff77258473 pthread_exit + 30
7 libdispatch.dylib 0x00007fff77022291 dispatch_main + 110
8 libxpc.dylib 0x00007fff7729ceda _xpc_objc_main + 583
9 libxpc.dylib 0x00007fff7729c9bd xpc_main + 433
10 com.apple.Foundation 0x00007fff4c189ce4 -[NSXPCListener resume] + 162
11 com.ftsafe.xpcHelp 0x00000001099e73de main + 142 (main.m:47)
12 libdyld.dylib 0x00007fff77064ed9 start + 1
Thread 1:: Dispatch queue: com.apple.NSXPCConnection.user.24688
0 libsystem_kernel.dylib 0x00007fff771a1eae __semwait_signal + 10
1 libsystem_c.dylib 0x00007fff7712c830 nanosleep + 199
2 libsystem_c.dylib 0x00007fff7712c692 sleep + 41
3 com.ftsafe.xpcHelp 0x0000000109a3a603 -[xpcHelp sendToXpcWith:withUserInfo:withReply:] + 371 (xpcHelp.mm:25)
4 com.apple.Foundation 0x00007fff4c1acd93 __NSXPCCONNECTION_IS_CALLING_OUT_TO_EXPORTED_OBJECT_S3__ + 12
5 com.apple.Foundation 0x00007fff4c18bb38 -[NSXPCConnection _decodeAndInvokeMessageWithEvent:flags:] + 2609
6 com.apple.Foundation 0x00007fff4c18ae9c message_handler + 227
7 libxpc.dylib 0x00007fff77298a28 _xpc_connection_call_event_handler + 56
8 libxpc.dylib 0x00007fff772969be _xpc_connection_mach_event + 933
9 libdispatch.dylib 0x00007fff77016e6f _dispatch_client_callout4 + 9
10 libdispatch.dylib 0x00007fff7702bb0f _dispatch_mach_msg_invoke + 449
11 libdispatch.dylib 0x00007fff7701cfc9 _dispatch_lane_serial_drain + 271
12 libdispatch.dylib 0x00007fff7702c639 _dispatch_mach_invoke + 485
13 libdispatch.dylib 0x00007fff7701cfc9 _dispatch_lane_serial_drain + 271
14 libdispatch.dylib 0x00007fff7701dc0c _dispatch_lane_invoke + 436
15 libdispatch.dylib 0x00007fff77026090 _dispatch_workloop_worker_thread + 603
16 libsystem_pthread.dylib 0x00007fff7725760b _pthread_wqthread + 409
17 libsystem_pthread.dylib 0x00007fff77257405 start_wqthread + 13
Thread 2:: Dispatch queue: com.apple.root.default-qos.overcommit
0 libsystem_kernel.dylib 0x00007fff771a20a2 __sigsuspend_nocancel + 10
1 libdispatch.dylib 0x00007fff770268b5 _dispatch_sigsuspend + 21
2 libdispatch.dylib 0x00007fff770268a0 _dispatch_sig_thread + 53
Thread 3:
0 libsystem_pthread.dylib 0x00007fff772573f8 start_wqthread + 0
1 ??? 0xffffffffffffff00 0 + 18446744073709551360
Thread 4 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff771a423e __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff7725ac1c pthread_kill + 285
2 libsystem_c.dylib 0x00007fff7710d1c9 abort + 127
3 libc++abi.dylib 0x00007fff7478d231 abort_message + 231
4 libc++abi.dylib 0x00007fff7478d3cd default_terminate_handler() + 265
5 libobjc.A.dylib 0x00007fff75f98c87 _objc_terminate() + 97
6 libc++abi.dylib 0x00007fff74798dfe std::__terminate(void (*)()) + 8
7 libc++abi.dylib 0x00007fff74798e73 std::terminate() + 51
8 libdispatch.dylib 0x00007fff77016de3 _dispatch_client_callout + 28
9 libdispatch.dylib 0x00007fff7701d124 _dispatch_lane_serial_drain + 618
10 libdispatch.dylib 0x00007fff7701dc0c _dispatch_lane_invoke + 436
11 libdispatch.dylib 0x00007fff77024d26 _dispatch_root_queue_drain + 325
12 libdispatch.dylib 0x00007fff770254bd _dispatch_worker_thread2 + 90
13 libsystem_pthread.dylib 0x00007fff772576dd _pthread_wqthread + 619
14 libsystem_pthread.dylib 0x00007fff77257405 start_wqthread + 13