LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview crashed on Mac OS X Sierra: 'nextEventMatchingMask should only be called from the Main Thread!'

Solved!
Go to solution

I use DAQmx15.0 on Mac OS X Sierra, and the function "DAQmxBaseCreateTask" causes crashes, and I got the following error message, and stack trace. Based on the trace I found that Labview tries to call "nextEventMatchingMask" in a background thread. So this seems to be a bug in NI DAQmx and Labview. Does anyone know any way to work around or fix it?

 

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'nextEventMatchingMask should only be called from the Main Thread!'
*** First throw call stack:
(
0 CoreFoundation 0x00007fffbcd88e7b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fffd1973cad objc_exception_throw + 48
2 AppKit 0x00007fffbafab8b1 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 4471
3 LabVIEW 15.0 Runtime 0x0000000103801b91 WEventAvail + 833
4 LabVIEW 15.0 Runtime 0x000000010359ba7e Exec + 1246
5 LabVIEW 15.0 Runtime 0x0000000103590f8a _Z16DoBackgroundExeci + 202
6 LabVIEW 15.0 Runtime 0x0000000103728e6a _ZN12BGAppTask_MG11HandleTasksEi + 138
7 LabVIEW 15.0 Runtime 0x0000000103719fe3 _ZN15BGAppTask_MacUI21CheckAndHandleBGEventEv + 51
8 LabVIEW 15.0 Runtime 0x000000010371cc6d _Z33BGAppTasksRunLoopObserverCallbackP19__CFRunLoopObservermPv + 301
9 CoreFoundation 0x00007fffbcd1e397 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
10 CoreFoundation 0x00007fffbcd1e307 __CFRunLoopDoObservers + 391
11 CoreFoundation 0x00007fffbccfef5a __CFRunLoopRun + 906
12 CoreFoundation 0x00007fffbccfe974 CFRunLoopRunSpecific + 420
13 LabVIEW 15.0 Runtime 0x0000000103718387 _ZN19MainLoop_MacCocoaUI3RunEv + 279
14 LabVIEW 15.0 Runtime 0x0000000102a83a46 _Z6MGMainiPKPKc + 294
15 LabVIEW 15.0 Runtime 0x0000000102a8450d _Z11SysUIThreadPv + 13
16 LabVIEW 15.0 Runtime 0x000000010387803e _Z15ThreadCoverProcPv + 94
17 libsystem_pthread.dylib 0x00007fffd246eaab _pthread_body + 180
18 libsystem_pthread.dylib 0x00007fffd246e9f7 _pthread_body + 0
19 libsystem_pthread.dylib 0x00007fffd246e1fd thread_start + 13
)

0 Kudos
Message 1 of 20
(6,489 Views)

Hey qizheng_square,

 

If you try to Create Task and Close Task on a VI, does it still crash? What is the smallest reproducible case of this crash?

 

Saki K.
Applications Engineer
0 Kudos
Message 2 of 20
(6,429 Views)

Hi Saki,

 

Yes, it crashed. The program crashed when calling "DAQmxBaseCreateTask()".

 

You can reproduce it by running any example provied by NI-DAQmx Base on OS X Sierra. For example, I tried /Applications/National Instruments/NI-DAQmx Base/examples/ai/acquireNScans, and it has the same error.

 

Thanks!

0 Kudos
Message 3 of 20
(6,422 Views)

Have you been able to try this on other computers? I have a colleague running OS X Sierra and seemed to be able to run the DAQmx Base VIs fine. Also is it specifically the Create Task VI? If you do not need to explicitly make a task for reference later, you can simply start with creating a channel.

Madison T
0 Kudos
Message 4 of 20
(6,400 Views)

Hi Madison,

 

Thanks for your reply. 

 

I just realized that I was using the C APIs instead of the LabView VIs. So maybe the LabView VIs are working, but not the DAQmx Base shared lib provided by DAQmx 15.0.

0 Kudos
Message 5 of 20
(6,397 Views)

Are you able to use the LabVIEW VIs successfully now?

Madison T
0 Kudos
Message 6 of 20
(6,382 Views)

Hi Madison,

 

I must use the C APIs and the dylibs, so VI is not an option for me.

0 Kudos
Message 7 of 20
(6,374 Views)

Can you send a screenshot of what you are doing? I want to see if I can try to recreate it. In the meantime have you tried doing a repair or reinstall of the driver?

Madison T
0 Kudos
Message 8 of 20
(6,365 Views)

Hi,

 

Sorry for the late reply. I attached the screenshot of the code. It is acqure1Scan.c in the example code of NI-DAQmx Based provided by NI.

 

Thanks.

0 Kudos
Message 9 of 20
(6,329 Views)

I will not be able to try it today, but I will see if I am able to tomorrow. Also, it looks like the DAQmx base driver has not yet been officially tested on Sierra. Would working on a Windows computer or partition be an option for you until Sierra has been tested on?

Madison T
0 Kudos
Message 10 of 20
(6,300 Views)