Uncaught Exception When Resizing Image in OpenCV - python-2.7

I was trying to resize an image in a function using opencv that is called within a continous loop for socket transmissions and I obtained this error
2017-04-10 15:46:47.200 python[1541:16193] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff8ce2b37b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fffa1c1f48d objc_exception_throw + 48
2 CoreFoundation 0x00007fff8cd44b5c -[__NSArrayM objectAtIndex:] + 204
3 libopencv_highgui.2.4.dylib 0x0000000114d31280 _ZN13CvCaptureFileC2EPKc + 350
4 libopencv_highgui.2.4.dylib 0x0000000114d2fcf2 _Z32cvCreateFileCapture_AVFoundationPKc + 34
5 libopencv_highgui.2.4.dylib 0x0000000114d237ee cvCreateFileCapture + 14
6 libopencv_highgui.2.4.dylib 0x0000000114d23a9e _ZN2cv12VideoCapture4openERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 64
7 libopencv_highgui.2.4.dylib 0x0000000114d238fe _ZN2cv12VideoCaptureC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 42
8 cv2.so 0x00000001144ccbce _ZL34pyopencv_VideoCapture_VideoCaptureP7_objectS0_S0_ + 275
9 libpython2.7.dylib 0x000000010e6c61bd PyEval_EvalFrameEx + 30141
10 libpython2.7.dylib 0x000000010e6be8f2 PyEval_EvalCodeEx + 1538
11 libpython2.7.dylib 0x000000010e64943c function_call + 364
12 libpython2.7.dylib 0x000000010e623333 PyObject_Call + 99
13 libpython2.7.dylib 0x000000010e6305b6 instancemethod_call + 182
14 libpython2.7.dylib 0x000000010e623333 PyObject_Call + 99
15 libpython2.7.dylib 0x000000010e6ca80d PyEval_CallObjectWithKeywords + 93
16 libpython2.7.dylib 0x000000010e62e5c6 PyInstance_New + 134
17 libpython2.7.dylib 0x000000010e623333 PyObject_Call + 99
18 libpython2.7.dylib 0x000000010e6c5e8f PyEval_EvalFrameEx + 29327
19 libpython2.7.dylib 0x000000010e6cb0b2 fast_function + 274
20 libpython2.7.dylib 0x000000010e6c5db3 PyEval_EvalFrameEx + 29107
21 libpython2.7.dylib 0x000000010e6cb0b2 fast_function + 274
22 libpython2.7.dylib 0x000000010e6c5db3 PyEval_EvalFrameEx + 29107
23 libpython2.7.dylib 0x000000010e6be8f2 PyEval_EvalCodeEx + 1538
24 libpython2.7.dylib 0x000000010e6be2e6 PyEval_EvalCode + 54
25 libpython2.7.dylib 0x000000010e6ed254 PyRun_FileExFlags + 164
26 libpython2.7.dylib 0x000000010e6ecdd1 PyRun_SimpleFileExFlags + 769
27 libpython2.7.dylib 0x000000010e702a12 Py_Main + 3154
28 python 0x000000010e610f24 start + 52
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6
The code that I used that I assume generates this error is
import numpy as np
import cv2
class video_read():
def __init__(self, filename):
self.cap = cv2.VideoCapture(filename)
def read_frames(self):
frame = self.cap.read()[1]
image = cv2.imencode('.png', frame)[1]
image_resized = cv2.resize(image, (width/10, height/10))
return image_resized
Could someone point out to me what did I do wrong that called this exception?

Related

SwiftUI crash AttributeGraph precondition failure: invalid attribute id: 83753

I got this (not particularly helpful, in my eyes) crash message and was wondered what the usual suspect was for this/where I'm best to look? I'm getting this when I navigate using a NavigationLink to another View. I know from some research that this crash tends to have a different cause each time, but I wondered if the stack trace would give any clues?
Each crash companies about the same invalid attribute id: 83753. Any way I can track something down using this ID?
Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x1c1f2584c __pthread_kill + 8
1 libsystem_pthread.dylib 0x1de7f09e8 pthread_kill + 212
2 libsystem_c.dylib 0x19ed5c8f4 abort + 100
3 AttributeGraph 0x1bd82dc7c util::Heap::Heap(void*, unsigned long, unsigned long) + 186
4 AttributeGraph 0x1bd8269f0 AG::AttributeID::size() const + 238
5 AttributeGraph 0x1bd82d530 AGGraphGetValue + 500
6 SwiftUI 0x19c9e4eb0 ResolvedTextFilter.updateValue() + 56
7 SwiftUI 0x19c4cee34 partial apply for specialized implicit closure #2 in implicit closure #1 in closure #1 in closure #1 in Attribute.init<A>(_:) + 20
8 AttributeGraph 0x1bd81714c AG::Graph::UpdateStack::update() + 484
9 AttributeGraph 0x1bd81755c AG::Graph::update_attribute(AG::data::ptr<AG::Node>, bool) + 328
10 AttributeGraph 0x1bd81c1f8 AG::Graph::value_ref(AG::AttributeID, AGSwiftMetadata const*, bool*) + 152
11 AttributeGraph 0x1bd82d468 AGGraphGetValue + 300
12 SwiftUI 0x19c6321d8 ViewGraph.sizeThatFits(_:) + 212
13 SwiftUI 0x19ca285e0 closure #1 in ViewRendererHost.sizeThatFits(_:) + 52
14 SwiftUI 0x19c5d2ec4 thunk for #callee_guaranteed (#guaranteed ViewGraph) -> (#unowned CGSize) + 24
15 SwiftUI 0x19ca2687c closure #1 in ViewRendererHost.updateViewGraph<A>(body:) + 92
16 SwiftUI 0x19ca1f0b4 ViewRendererHost.updateViewGraph<A>(body:) + 88
17 SwiftUI 0x19ca25328 ViewRendererHost.sizeThatFits(_:) + 112
18 SwiftUI 0x19cb7b980 _UIHostingView.sizeThatFits(_:) + 112
19 SwiftUI 0x19cb7b9c8 #objc _UIHostingView._baselineOffsets(at:) + 48
20 UIKitCore 0x197eadbb0 -[_UITAMICAdaptorView updateForAvailableSize] + 120
21 UIKitCore 0x197eadafc -[_UITAMICAdaptorView didMoveToWindow] + 60
22 UIKitCore 0x198dcdbc0 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 2016
23 UIKitCore 0x198dcd680 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 672
24 UIKitCore 0x198dcd680 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 672
25 UIKitCore 0x197ed2350 -[UINavigationBar _didMoveFromWindow:toWindow:] + 64
26 UIKitCore 0x198dc1ac8 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 136
27 UIKitCore 0x198dc19b4 -[UIView(Hierarchy) _postMovedFromSuperview:] + 748
28 UIKitCore 0x198dd0028 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 2132
29 UIKitCore 0x1981385d8 -[UILayoutContainerView addSubview:] + 64
30 UIKitCore 0x1981434a0 -[UINavigationController _unhideNavigationBarForEdge:] + 100
31 UIKitCore 0x1981436e8 -[UINavigationController _setNavigationBarHidden:edge:duration:] + 216
32 UIKitCore 0x198142d30 -[UINavigationController _setNavigationBarHidden:edgeIfNotNavigating:duration:] + 516
33 UIKitCore 0x1981416ac -[UINavigationController setNavigationBarHidden:animated:] + 156
34 SwiftUI 0x19cadace8 NavigationBridge_PhoneTV.hostingControllerWillAppear(transitionCoordinator:animated:) + 876
35 SwiftUI 0x19c53fc60 _UIHostingView.viewControllerWillAppear(transitionCoordinator:animated:) + 48
36 SwiftUI 0x19cb7fd20 UIHostingController.viewWillAppear(_:) + 116
37 SwiftUI 0x19cb7fc3c #objc UIHostingController.viewWillAppear(_:) + 40
38 UIKitCore 0x198210a4c -[UIViewController _setViewAppearState:isAnimating:] + 604
39 UIKitCore 0x1982111d0 -[UIViewController __viewWillAppear:] + 116
40 UIKitCore 0x19813f7e8 -[UINavigationController _startCustomTransition:] + 1344
41 UIKitCore 0x198153bb0 -[UINavigationController _startDeferredTransitionIfNeeded:] + 700
42 UIKitCore 0x198154fe0 -[UINavigationController __viewWillLayoutSubviews] + 164
43 UIKitCore 0x198137e78 -[UILayoutContainerView layoutSubviews] + 224
44 UIKitCore 0x198dd6398 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2468
45 QuartzCore 0x1992dbdf4 -[CALayer layoutSublayers] + 288
46 QuartzCore 0x1992e2398 CA::Layer::layout_if_needed(CA::Transaction*) + 520
47 QuartzCore 0x1992ed6e8 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 140
48 QuartzCore 0x199238d7c CA::Context::commit_transaction(CA::Transaction*, double, double*) + 416
49 QuartzCore 0x199262f40 CA::Transaction::commit() + 728
50 QuartzCore 0x1992641f0 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 92
51 CoreFoundation 0x195fe087c __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
52 CoreFoundation 0x195fdaf50 __CFRunLoopDoObservers + 604
53 CoreFoundation 0x195fdb498 __CFRunLoopRun + 960
54 CoreFoundation 0x195fdaba0 CFRunLoopRunSpecific + 572
55 GraphicsServices 0x1acd43598 GSEventRunModal + 160
56 UIKitCore 0x1988cc2f4 -[UIApplication _run] + 1052
57 UIKitCore 0x1988d1874 UIApplicationMain + 164
58 SwiftUI 0x19ca5a5dc closure #1 in KitRendererCommon(_:) + 108
59 SwiftUI 0x19ca5a56c runApp<A>(_:) + 176
60 SwiftUI 0x19c62bd18 static App.main() + 96
61 ProgressioniOS 0x10077f06c static ProgressionApp.$main() (<compiler-generated>)
62 ProgressioniOS 0x10077f39c main (ProgressionApp.swift)
63 libdyld.dylib 0x195cb9568 start + 4
Any thoughts appreciated.

Swift: crash at non-existing line

Hey StackOverflow detectives.
I've been pulling my hair out for a few months trying to figure out the crashes which happen at a line never exists.
In the crash log below, CustomClass.swift does exist but the line 25 doesn't.
What would be the true reason for this crash?
Hint: we run heavy processing and allocate a lot of memory (about 700MB) in the background that was written in c++, which is in OUR_CUSTOM_FRAMEWORK below.
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x00000001934c6df0 __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001933e6930 pthread_kill + 228 (pthread.c:1458)
2 libsystem_c.dylib 0x0000000193374ba4 abort + 104 (abort.c:110)
3 libsystem_malloc.dylib 0x00000001933d7fdc malloc_vreport + 564 (malloc_printf.c:183)
4 libsystem_malloc.dylib 0x00000001933d81a4 malloc_report + 64 (malloc_printf.c:192)
5 libsystem_malloc.dylib 0x00000001933cbd1c free + 436 (malloc.c:1733)
6 [OUR_CUSTOM_FRAMEWORK] 0x000000010324ccf8 0x1031a4000 + 691448
7 libsystem_c.dylib 0x0000000193355164 __cxa_finalize_ranges + 416 (atexit.c:284)
8 libsystem_c.dylib 0x00000001933554a0 exit + 28 (exit.c:81)
9 UIKitCore 0x000000019782eb88 -[UIApplication _terminateWithStatus:] + 508 (UIApplication.m:6735)
10 UIKitCore 0x0000000196f97718 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 128 (_UISceneLifecycleMultiplexer.m:765)
11 UIKitCore 0x0000000196f9737c -[_UISceneLifecycleMultiplexer forceExitWithTransitionContext:scene:] + 220 (_UISceneLifecycleMultiplexer.m:418)
12 UIKitCore 0x0000000197824ac4 -[UIApplication workspaceShouldExit:withTransitionContext:] + 216 (UIApplication.m:3725)
13 FrontBoardServices 0x000000019893bcf8 -[FBSUIApplicationWorkspaceShim workspaceShouldExit:withTransitionContext:] + 88 (FBSUIApplicationWorkspace.m:144)
14 FrontBoardServices 0x0000000198968d68 __83-[FBSWorkspaceScenesClient willTerminateWithTransitionContext:withAcknowledgement:]_block_invoke_2 + 80 (FBSWorkspaceScenesClient.m:281)
15 FrontBoardServices 0x000000019894debc -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 240 (FBSWorkspace.m:357)
16 FrontBoardServices 0x0000000198968cf4 __83-[FBSWorkspaceScenesClient willTerminateWithTransitionContext:withAcknowledgement:]_block_invoke + 140 (FBSWorkspaceScenesClient.m:278)
17 libdispatch.dylib 0x000000019338033c _dispatch_client_callout + 20 (object.m:495)
18 libdispatch.dylib 0x00000001933830d4 _dispatch_block_invoke_direct + 264 (queue.c:466)
19 FrontBoardServices 0x000000019898f6c4 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 48 (FBSSerialQueue.m:173)
20 FrontBoardServices 0x000000019898f370 -[FBSSerialQueue _queue_performNextIfPossible] + 432 (FBSSerialQueue.m:216)
21 FrontBoardServices 0x000000019898f8dc -[FBSSerialQueue _performNextFromRunLoopSource] + 32 (FBSSerialQueue.m:247)
22 CoreFoundation 0x000000019365baf4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1922)
23 CoreFoundation 0x000000019365ba48 __CFRunLoopDoSource0 + 84 (CFRunLoop.c:1956)
24 CoreFoundation 0x000000019365b198 __CFRunLoopDoSources0 + 196 (CFRunLoop.c:1992)
25 CoreFoundation 0x0000000193655f38 __CFRunLoopRun + 796 (CFRunLoop.c:2882)
26 CoreFoundation 0x00000001936558f4 CFRunLoopRunSpecific + 480 (CFRunLoop.c:3192)
27 GraphicsServices 0x000000019da6c604 GSEventRunModal + 164 (GSEvent.c:2246)
28 UIKitCore 0x0000000197829358 UIApplicationMain + 1944 (UIApplication.m:4823)
29 [APPNAME] 0x0000000100d45128 main + 68 (CustomClass.swift:25)
30 libdyld.dylib 0x00000001934d12dc start + 4

gr-dect2 - Fatal Python error: PyThreadState_Get: no current thread

I installed gnuradio via macports. I have been able to install the majority of the other blocks via macports, however I was wanting to start playing with DECT and the block was not listed on macports. So I manually went to install it via the following git location:https://github.com/pavelyazev/gr-dect2
When I installed with the standard install, gnuradio did not see the block at all. After researching I found others having success by modifying the cmake call like that below.
cd gr-dect2/
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/local ..
make
sudo make install
I was then able to see the dect2 block in gnuradio, however when I went to run the example dect2.grc project I was getting the below message:
Traceback (most recent call last):
File "/Users/krotovd/gr-dect2/grc/top_block.py", line 32, in <module>
import dect2
ImportError: No module named dect2
So I found where the other modules were installed, deleted the build directory and called the original build/install commands with a modification on cmake as shown below.
cmake -DCMAKE_INSTALL_PREFIX=/opt/local/Library/Frameworks/Python.framework/Versions/2.7
Now when I open gnuradio-companion and proceed to open the detc2.grc project it crashes with the error in the title:
Loading: "/Users/krotovd/gr-dect2/grc/dect2.grc"
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6
Has anyone been able to successfully install a dect2 block for gnuradio in Mac? Seems like this has been an issue for some time now. Anyone have any ideas on how I might be able to resolve this issue?
Below is a excerpt of my error report. I am inserting the except due to the size, but I beleive what is important should be listed.
Process: Python [1753]
Path: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Identifier: Python
Version: 2.7.13 (2.7.13)
Code Type: X86-64 (Native)
Parent Process: bash [546]
Responsible: Python [1753]
User ID: 501
Date/Time: 2017-01-23 20:38:31.511 -0500
OS Version: Mac OS X 10.12.2 (16C68)
Report Version: 12
Anonymous UUID: E0592F8C-772E-3B7D-EAF2-2AB68A3171B3
Time Awake Since Boot: 2800 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
abort() called
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fffd3291dd6 __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fffd337d787 pthread_kill + 90
2 libsystem_c.dylib 0x00007fffd31f7420 abort + 129
3 org.python.python 0x00000001280ff8ee Py_FatalError + 49
4 org.python.python 0x00000001280fede8 PyThreadState_Get + 28
5 org.python.python 0x00000001280fbce2 Py_InitModule4_64 + 62
6 _dect2_swig.so 0x0000000128002bb0 init_dect2_swig + 800
7 org.python.python 0x000000010f5372ec _PyImport_LoadDynamicModule + 140
8 org.python.python 0x000000010f535cef import_submodule + 271
9 org.python.python 0x000000010f535778 load_next + 280
10 org.python.python 0x000000010f53480e PyImport_ImportModuleLevel + 1230
11 org.python.python 0x000000010f50d7c7 builtin___import__ + 135
12 org.python.python 0x000000010f519f91 PyEval_EvalFrameEx + 29441
13 org.python.python 0x000000010f512947 PyEval_EvalCodeEx + 2119
14 org.python.python 0x000000010f51ed46 fast_function + 118
15 org.python.python 0x000000010f519e87 PyEval_EvalFrameEx + 29175
16 org.python.python 0x000000010f51ee22 fast_function + 338
17 org.python.python 0x000000010f519e87 PyEval_EvalFrameEx + 29175
18 org.python.python 0x000000010f512947 PyEval_EvalCodeEx + 2119
19 org.python.python 0x000000010f5120f6 PyEval_EvalCode + 54
20 org.python.python 0x000000010f5331a1 PyImport_ExecCodeModuleEx + 241
21 org.python.python 0x000000010f536273 load_source_module + 1059
22 org.python.python 0x000000010f535cef import_submodule + 271
23 org.python.python 0x000000010f535778 load_next + 280
24 org.python.python 0x000000010f5347b2 PyImport_ImportModuleLevel + 1138
25 org.python.python 0x000000010f50d7c7 builtin___import__ + 135
26 org.python.python 0x000000010f46f203 PyObject_Call + 99
27 org.python.python 0x000000010f518429 PyEval_EvalFrameEx + 22425
28 org.python.python 0x000000010f512947 PyEval_EvalCodeEx + 2119
29 org.python.python 0x000000010f5120f6 PyEval_EvalCode + 54
30 org.python.python 0x000000010f5331a1 PyImport_ExecCodeModuleEx + 241
31 org.python.python 0x000000010f536273 load_source_module + 1059
32 org.python.python 0x000000010f5365ef load_package + 303
33 org.python.python 0x000000010f535cef import_submodule + 271
34 org.python.python 0x000000010f535778 load_next + 280
35 org.python.python 0x000000010f5347b2 PyImport_ImportModuleLevel + 1138
36 org.python.python 0x000000010f50d7c7 builtin___import__ + 135
37 org.python.python 0x000000010f46f203 PyObject_Call + 99
38 org.python.python 0x000000010f518429 PyEval_EvalFrameEx + 22425
39 org.python.python 0x000000010f512947 PyEval_EvalCodeEx + 2119
40 org.python.python 0x000000010f5120f6 PyEval_EvalCode + 54
41 org.python.python 0x000000010f5419df PyRun_StringFlags + 127
42 org.python.python 0x000000010f51303a PyEval_EvalFrameEx + 938
43 org.python.python 0x000000010f512947 PyEval_EvalCodeEx + 2119
44 org.python.python 0x000000010f51ed46 fast_function + 118
45 org.python.python 0x000000010f519e87 PyEval_EvalFrameEx + 29175
46 org.python.python 0x000000010f51ee22 fast_function + 338
47 org.python.python 0x000000010f519e87 PyEval_EvalFrameEx + 29175
48 org.python.python 0x000000010f51ee22 fast_function + 338
49 org.python.python 0x000000010f519e87 PyEval_EvalFrameEx + 29175
50 org.python.python 0x000000010f512947 PyEval_EvalCodeEx + 2119
51 org.python.python 0x000000010f4965bb function_call + 363
52 org.python.python 0x000000010f46f203 PyObject_Call + 99
53 org.python.python 0x000000010f47d3a6 instancemethod_call + 182
54 org.python.python 0x000000010f46f203 PyObject_Call + 99
55 org.python.python 0x000000010f4ce90f slot_tp_init + 175
56 org.python.python 0x000000010f4caadb type_call + 347
57 org.python.python 0x000000010f46f203 PyObject_Call + 99
58 org.python.python 0x000000010f51a19d PyEval_EvalFrameEx + 29965
59 org.python.python 0x000000010f512947 PyEval_EvalCodeEx + 2119
60 org.python.python 0x000000010f51ed46 fast_function + 118
61 org.python.python 0x000000010f519e87 PyEval_EvalFrameEx + 29175
62 org.python.python 0x000000010f512947 PyEval_EvalCodeEx + 2119
63 org.python.python 0x000000010f51ed46 fast_function + 118
64 org.python.python 0x000000010f519e87 PyEval_EvalFrameEx + 29175
65 org.python.python 0x000000010f512947 PyEval_EvalCodeEx + 2119
66 org.python.python 0x000000010f4965bb function_call + 363
67 org.python.python 0x000000010f46f203 PyObject_Call + 99
68 org.python.python 0x000000010f47d3a6 instancemethod_call + 182
69 org.python.python 0x000000010f46f203 PyObject_Call + 99
70 org.python.python 0x000000010f51e7c5 PyEval_CallObjectWithKeywords + 165
71 _gobject.so 0x0000000112dfe5cf pyg_closure_marshal + 212
72 libgobject-2.0.0.dylib 0x0000000112bd3a0d g_closure_invoke + 258
73 libgobject-2.0.0.dylib 0x0000000112be6f6a signal_emit_unlocked_R + 1768
74 libgobject-2.0.0.dylib 0x0000000112be7cb0 g_signal_emit_valist + 2028
75 libgobject-2.0.0.dylib 0x0000000112be8362 g_signal_emit + 134
76 libgtk-x11-2.0.0.dylib 0x000000011327595f gtk_widget_activate + 73
77 libgtk-x11-2.0.0.dylib 0x000000011318a275 gtk_menu_shell_activate_item + 241
78 libgtk-x11-2.0.0.dylib 0x000000011318ae1f gtk_menu_shell_button_release + 576
79 libgtk-x11-2.0.0.dylib 0x000000011317aa48 _gtk_marshal_BOOLEAN__BOXED + 95
80 libgobject-2.0.0.dylib 0x0000000112bd3a0d g_closure_invoke + 258
81 libgobject-2.0.0.dylib 0x0000000112be70d8 signal_emit_unlocked_R + 2134
82 libgobject-2.0.0.dylib 0x0000000112be7d0c g_signal_emit_valist + 2120
83 libgobject-2.0.0.dylib 0x0000000112be8362 g_signal_emit + 134
84 libgtk-x11-2.0.0.dylib 0x000000011327576f gtk_widget_event_internal + 573
85 libgtk-x11-2.0.0.dylib 0x0000000113178d4c gtk_propagate_event + 316
86 libgtk-x11-2.0.0.dylib 0x0000000113178961 gtk_main_do_event + 784
87 libgdk-x11-2.0.0.dylib 0x00000001134b3e02 gdk_event_dispatch + 81
88 libglib-2.0.0.dylib 0x0000000112c4248e g_main_context_dispatch + 279
89 libglib-2.0.0.dylib 0x0000000112c4277d g_main_context_iterate + 413
90 libglib-2.0.0.dylib 0x0000000112c429d3 g_main_loop_run + 207
91 libgtk-x11-2.0.0.dylib 0x00000001131783b2 gtk_main + 180
92 _gtk.so 0x0000000112e6b00b _wrap_gtk_main + 243
93 org.python.python 0x000000010f519fc3 PyEval_EvalFrameEx + 29491
94 org.python.python 0x000000010f51ee22 fast_function + 338
95 org.python.python 0x000000010f519e87 PyEval_EvalFrameEx + 29175
96 org.python.python 0x000000010f51ee22 fast_function + 338
97 org.python.python 0x000000010f519e87 PyEval_EvalFrameEx + 29175
98 org.python.python 0x000000010f512947 PyEval_EvalCodeEx + 2119
99 org.python.python 0x000000010f5120f6 PyEval_EvalCode + 54
100 org.python.python 0x000000010f541824 PyRun_FileExFlags + 164
101 org.python.python 0x000000010f54135e PyRun_SimpleFileExFlags + 702
102 org.python.python 0x000000010f557b1d Py_Main + 2925
103 libdyld.dylib 0x00007fffd3163255 start + 1
Thread 1:
0 libsystem_kernel.dylib 0x00007fffd32924e2 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fffd337a5fe _pthread_wqthread + 1023
2 libsystem_pthread.dylib 0x00007fffd337a1ed start_wqthread + 13
Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000000 rbx: 0x0000000000000006 rcx: 0x00007fff5079f2d8 rdx: 0x0000000000000000
rdi: 0x0000000000000307 rsi: 0x0000000000000006 rbp: 0x00007fff5079f300 rsp: 0x00007fff5079f2d8
r8: 0x0000000000000040 r9: 0x00007fffdbf8f040 r10: 0x0000000008000000 r11: 0x0000000000000206
r12: 0x00007f8052f7aa00 r13: 0x0000000128031a10 r14: 0x00007fffdbfab3c0 r15: 0x000000010f5f4bd8
rip: 0x00007fffd3291dd6 rfl: 0x0000000000000206 cr2: 0x00007fffdbf8d128
Logical CPU: 0
Error Code: 0x02000148
Trap Number: 133
Binary Images:
0x10f45c000 - 0x10f45dff3 +org.python.python (2.7.13 - 2.7.13) <4031A4B2-CD49-3FB0-9724-9F0C756687F4> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
0x10f460000 - 0x10f59bfff +org.python.python (2.7.13, [c] 2001-2016 Python Software Foundation. - 2.7.13) <38C706B7-56D9-3A4D-A882-E7CB1BD22812> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python
0x10f822000 - 0x10f824fff +_locale.so (0) <48641A39-37F1-3CE1-84E2-D7B84805CDFE> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_locale.so
0x10f828000 - 0x10f830ff3 +libintl.8.dylib (0) <34C7A792-8F97-3B47-BE05-892044CF0A65> /opt/local/lib/libintl.8.dylib
.....
0x7fffd3364000 - 0x7fffd336dff3 libsystem_notify.dylib (165.20.1) <E7FD3A7C-DD07-36E2-9FA4-7561F9F114DA> /usr/lib/system/libsystem_notify.dylib
0x7fffd336e000 - 0x7fffd3376fe7 libsystem_platform.dylib (126.1.2) <3CA06D4E-C00A-36DE-AA65-3A390097D1F6> /usr/lib/system/libsystem_platform.dylib
0x7fffd3377000 - 0x7fffd3381ff7 libsystem_pthread.dylib (218.30.1) <C869ED7C-BE29-3532-8E69-3A8DA1447EDC> /usr/lib/system/libsystem_pthread.dylib
0x7fffd3382000 - 0x7fffd3385ff7 libsystem_sandbox.dylib (592.31.1) <7BBFDF96-293F-3DD9-B3A4-7C168280B441> /usr/lib/system/libsystem_sandbox.dylib
0x7fffd3386000 - 0x7fffd3387fff libsystem_secinit.dylib (24) <5C1F1E47-0F7D-3E25-8DEB-D9DB1F902281> /usr/lib/system/libsystem_secinit.dylib
0x7fffd3388000 - 0x7fffd338ffff libsystem_symptoms.dylib (532.30.6) <5D990CF5-B58F-39F7-B375-99B4EC62CFBD> /usr/lib/system/libsystem_symptoms.dylib
0x7fffd3390000 - 0x7fffd33b0ff7 libsystem_trace.dylib (518.30.7) <5BD4ECD4-75CA-38EA-AF5C-B481C15955F8> /usr/lib/system/libsystem_trace.dylib
0x7fffd33b1000 - 0x7fffd33b6ffb libunwind.dylib (35.3) <9F7C2AD8-A9A7-3DE4-828D-B0F0F166AAA0> /usr/lib/system/libunwind.dylib
0x7fffd33b7000 - 0x7fffd33e0ff7 libxpc.dylib (972.30.7) <65E41BB6-EBD5-3D93-B0BE-B190CEE4DD93> /usr/lib/system/libxpc.dylib
External Modification Summary:
Calls made by other processes targeting this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by all processes on this machine:
task_for_pid: 1427
thread_create: 0
thread_set_state: 0
VM Region Summary:
ReadOnly portion of Libraries: Total=485.7M resident=0K(0%) swapped_out_or_unallocated=485.7M(100%)
Writable regions: Total=265.2M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=265.2M(100%)
VIRTUAL REGION
REGION TYPE SIZE COUNT (non-coalesced)
=========== ======= =======
Activity Tracing 256K 2
Dispatch continuations 16.0M 2
Kernel Alloc Once 8K 2
MALLOC 123.4M 43
MALLOC guard page 32K 7
STACK GUARD 56.0M 3
Stack 8712K 3
VM_ALLOCATE 88.5M 113
__DATA 61.6M 476
__IMAGE 528K 2
__LINKEDIT 162.3M 222
__TEXT 323.3M 425
__UNICODE 556K 2
mapped file 27.2M 4
shared memory 336K 8
=========== ======= =======
TOTAL 868.5M 1299
Model: MacBookPro10,1, BootROM MBP101.00EE.B0B, 4 processors, Intel Core i7, 2.7 GHz, 16 GB, SMC 2.3f36
Graphics: Intel HD Graphics 4000, Intel HD Graphics 4000, Built-In
Graphics: NVIDIA GeForce GT 650M, NVIDIA GeForce GT 650M, PCIe, 1024 MB
Memory Module: BANK 0/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D5434314753364D465238432D50422020
Memory Module: BANK 1/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D5434314753364D465238432D50422020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0xEF), Broadcom BCM43xx 1.0 (7.21.171.68.1a4)
Bluetooth: Version 5.0.2f4, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
Serial ATA Device: APPLE SSD SD512E, 500.28 GB
USB Device: USB 2.0 Bus
USB Device: Hub
USB Device: FaceTime HD Camera (Built-in)
USB Device: USB 2.0 Bus
USB Device: Hub
USB Device: Hub
USB Device: Apple Internal Keyboard / Trackpad
USB Device: BRCM20702 Hub
USB Device: Bluetooth USB Host Controller
USB Device: USB 3.0 Bus
Thunderbolt Bus: MacBook Pro, Apple Inc., 23.4
try my cmake alias, it always worked for me
alias cm='cmake -DPYTHON_EXECUTABLE=/opt/local/bin/python2.7 -DPYTHON_INCLUDE_DIR=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Headers -DPYTHON_LIBRARY=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python -DGR_PYTHON_DIR=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages -DCMAKE_INSTALL_NAME_DIR=/opt/local/lib -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_INSTALL_PREFIX=/opt/local'

Python multiprocess plot issue in Mac OSX Sierra - exception type EXC_BAD_INSTRUCTION

I've developed a GitHub repo with an example of a multiprocess script in python2.7 for plotting. Basically, the script allocates one process to generate the data, and such data are passed via a queue to a second process that is responsible to generate the plot. When I run both the examples 'multiproc_processIPC.py' or 'multiproc_poolQUEUE.py' I get the following error.
Note that this error came up AFTER upgrading my mac to OSX Sierra.
Has anyone a clue of the origin of this issue?
Any help will be highly appreciated
===== ERROR REPORT =====
Process: python2.7 [82890]
Path: /Users/USER/*/python
Identifier: python2.7
Version: ???
Code Type: X86-64 (Native)
Parent Process: python2.7 [82883]
Responsible: python2.7 [82890]
User ID: 501
Date/Time: 2016-12-04 22:34:29.874 +0100
OS Version: Mac OS X 10.12.1 (16B2555)
Report Version: 12
Anonymous UUID: 689587A6-D759-0F81-671D-1079942B7C42
Time Awake Since Boot: 9000 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x0000000000000001, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Illegal instruction: 4
Termination Reason: Namespace SIGNAL, Code 0x4
Terminating Process: exc handler [0]
Application Specific Information:
BUG IN CLIENT OF LIBDISPATCH: _dispatch_main_queue_callback_4CF called from the wrong thread
crashed on child side of fork pre-exec
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libdispatch.dylib 0x00007fff8f9ddd21 _dispatch_main_queue_callback_4CF + 1291
1 com.apple.CoreFoundation 0x00007fff7a97abe9 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9
2 com.apple.CoreFoundation 0x00007fff7a93c00d __CFRunLoopRun + 2205
3 com.apple.CoreFoundation 0x00007fff7a93b514 CFRunLoopRunSpecific + 420
4 com.apple.HIToolbox 0x00007fff79ed8fbc RunCurrentEventLoopInMode + 240
5 com.apple.HIToolbox 0x00007fff79ed8df1 ReceiveNextEventCommon + 432
6 com.apple.HIToolbox 0x00007fff79ed8c26 _BlockUntilNextEventMatchingListInModeWithFilter + 71
7 com.apple.AppKit 0x00007fff785c2b79 _DPSNextEvent + 1093
8 com.apple.AppKit 0x00007fff78cd81c3 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1637
9 Tk 0x0000000104b01285 0x104a47000 + 762501
10 Tk 0x0000000104b0171f 0x104a47000 + 763679
11 Tcl 0x00000001049d75f8 Tcl_DoOneEvent + 317
12 Tk 0x0000000104a55932 0x104a47000 + 59698
13 Tcl 0x00000001049695b7 0x10495b000 + 58807
14 Tcl 0x0000000104969e46 Tcl_EvalObjv + 59
15 _tkinter.so 0x00000001037dfe39 Tkapp_Call + 617
16 libpython2.7.dylib 0x00000001000a3302 PyEval_EvalFrameEx + 3730
17 libpython2.7.dylib 0x00000001000ac913 fast_function + 179
18 libpython2.7.dylib 0x00000001000a338a PyEval_EvalFrameEx + 3866
19 libpython2.7.dylib 0x00000001000ac7dc PyEval_EvalCodeEx + 2092
20 libpython2.7.dylib 0x00000001000ac988 fast_function + 296
21 libpython2.7.dylib 0x00000001000a338a PyEval_EvalFrameEx + 3866
22 libpython2.7.dylib 0x00000001000ac7dc PyEval_EvalCodeEx + 2092
23 libpython2.7.dylib 0x00000001000ac988 fast_function + 296
24 libpython2.7.dylib 0x00000001000a338a PyEval_EvalFrameEx + 3866
25 libpython2.7.dylib 0x00000001000ac7dc PyEval_EvalCodeEx + 2092
26 libpython2.7.dylib 0x0000000100035c1b function_call + 347
27 libpython2.7.dylib 0x000000010000c761 PyObject_Call + 97
28 libpython2.7.dylib 0x00000001000a3cea PyEval_EvalFrameEx + 6266
29 libpython2.7.dylib 0x00000001000ac7dc PyEval_EvalCodeEx + 2092
30 libpython2.7.dylib 0x00000001000ac988 fast_function + 296
31 libpython2.7.dylib 0x00000001000a338a PyEval_EvalFrameEx + 3866
32 libpython2.7.dylib 0x00000001000ac7dc PyEval_EvalCodeEx + 2092
33 libpython2.7.dylib 0x0000000100035c1b function_call + 347
34 libpython2.7.dylib 0x000000010000c761 PyObject_Call + 97
35 libpython2.7.dylib 0x000000010001e7d7 instancemethod_call + 503
36 libpython2.7.dylib 0x000000010000c761 PyObject_Call + 97
37 libpython2.7.dylib 0x000000010006673a slot_tp_init + 106
38 libpython2.7.dylib 0x0000000100062465 type_call + 229
39 libpython2.7.dylib 0x000000010000c761 PyObject_Call + 97
40 libpython2.7.dylib 0x00000001000a35a5 PyEval_EvalFrameEx + 4405
41 libpython2.7.dylib 0x00000001000ac7dc PyEval_EvalCodeEx + 2092
42 libpython2.7.dylib 0x0000000100035c1b function_call + 347
43 libpython2.7.dylib 0x000000010000c761 PyObject_Call + 97
44 libpython2.7.dylib 0x000000010001e7d7 instancemethod_call + 503
45 libpython2.7.dylib 0x000000010000c761 PyObject_Call + 97
46 libpython2.7.dylib 0x000000010006673a slot_tp_init + 106
47 libpython2.7.dylib 0x0000000100062465 type_call + 229
48 libpython2.7.dylib 0x000000010000c761 PyObject_Call + 97
49 libpython2.7.dylib 0x00000001000a3cea PyEval_EvalFrameEx + 6266
50 libpython2.7.dylib 0x00000001000ac913 fast_function + 179
51 libpython2.7.dylib 0x00000001000a338a PyEval_EvalFrameEx + 3866
52 libpython2.7.dylib 0x00000001000ac913 fast_function + 179
53 libpython2.7.dylib 0x00000001000a338a PyEval_EvalFrameEx + 3866
54 libpython2.7.dylib 0x00000001000ac7dc PyEval_EvalCodeEx + 2092
55 libpython2.7.dylib 0x0000000100035c1b function_call + 347
56 libpython2.7.dylib 0x000000010000c761 PyObject_Call + 97
57 libpython2.7.dylib 0x000000010001e7d7 instancemethod_call + 503
58 libpython2.7.dylib 0x000000010000c761 PyObject_Call + 97
59 libpython2.7.dylib 0x000000010006673a slot_tp_init + 106
60 libpython2.7.dylib 0x0000000100062465 type_call + 229
61 libpython2.7.dylib 0x000000010000c761 PyObject_Call + 97
62 libpython2.7.dylib 0x00000001000a35a5 PyEval_EvalFrameEx + 4405
63 libpython2.7.dylib 0x00000001000ac913 fast_function + 179
64 libpython2.7.dylib 0x00000001000a338a PyEval_EvalFrameEx + 3866
65 libpython2.7.dylib 0x00000001000ac7dc PyEval_EvalCodeEx + 2092
66 libpython2.7.dylib 0x00000001000ac856 PyEval_EvalCode + 54
67 libpython2.7.dylib 0x00000001000cb3d4 PyRun_FileExFlags + 164
68 libpython2.7.dylib 0x00000001000cc709 PyRun_SimpleFileExFlags + 409
69 libpython2.7.dylib 0x00000001000e01ca Py_Main + 2938
70 python 0x0000000100000f14 start + 52
Thread 1:
0 libsystem_kernel.dylib 0x00007fff8fb354e6 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff8fc1d622 _pthread_wqthread + 1023
2 libsystem_pthread.dylib 0x00007fff8fc1d211 start_wqthread + 13
Thread 2:
0 libsystem_kernel.dylib 0x00007fff8fb354e6 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff8fc1d622 _pthread_wqthread + 1023
2 libsystem_pthread.dylib 0x00007fff8fc1d211 start_wqthread + 13
Thread 3:
0 libsystem_kernel.dylib 0x00007fff8fb354e6 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff8fc1d7b5 _pthread_wqthread + 1426
2 libsystem_pthread.dylib 0x00007fff8fc1d211 start_wqthread + 13
Thread 4:
0 libsystem_kernel.dylib 0x00007fff8fb34f4e __select + 10
1 Tcl 0x0000000104a08271 0x10495b000 + 709233
2 libsystem_pthread.dylib 0x00007fff8fc1daab _pthread_body + 180
3 libsystem_pthread.dylib 0x00007fff8fc1d9f7 _pthread_start + 286
4 libsystem_pthread.dylib 0x00007fff8fc1d221 thread_start + 13
Thread 5:: com.apple.NSEventThread
0 libsystem_kernel.dylib 0x00007fff8fb2d41a mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff8fb2c867 mach_msg + 55
2 libsystem_kernel.dylib 0x00007fff8fb21ed1 _kernelrpc_mach_port_set_attributes + 150
3 libdispatch.dylib 0x00007fff8f9e7739 _dispatch_runloop_queue_handle_init + 171
4 libdispatch.dylib 0x00007fff8f9d84b7 _dispatch_runloop_root_queue_create_4CF + 133
5 com.apple.CoreFoundation 0x00007fff7a9091e6 __CFRunLoopFindMode + 502
6 com.apple.CoreFoundation 0x00007fff7a909889 CFRunLoopAddSource + 201
7 com.apple.HIToolbox 0x00007fff79ed9897 AdjustCGSSourceInRunLoop(void ()(__CFRunLoop, __CFRunLoopSource*, __CFString const*), __CFRunLoop*, __CFRunLoopSource*) + 180
8 com.apple.HIToolbox 0x00007fff79ed97bb AddCGSSourceToRunLoop(__CFRunLoop*) + 78
9 com.apple.HIToolbox 0x00007fff79eecc52 _BeginEventReceiptOnThread + 181
10 com.apple.AppKit 0x00007fff7870f4f8 _NSEventThread + 37
11 libsystem_pthread.dylib 0x00007fff8fc1daab _pthread_body + 180
12 libsystem_pthread.dylib 0x00007fff8fc1d9f7 _pthread_start + 286
13 libsystem_pthread.dylib 0x00007fff8fc1d221 thread_start + 13
Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000307 rbx: 0x00000001003d93f0 rcx: 0x00007fff8f9f9530 rdx: 0x0000000000000307
rdi: 0x0000000000000001 rsi: 0x0000000000000006 rbp: 0x00007fff5fbfa160 rsp: 0x00007fff5fbfa0f0
r8: 0x0000000000000040 r9: 0x00000001003d9408 r10: 0xffffffffffffffff r11: 0x0000000000012068
r12: 0x00000001003d93e0 r13: 0x00000001003d94a0 r14: 0x00007fff986f5a80 r15: 0x0000000102076898
rip: 0x00007fff8f9ddd21 rfl: 0x0000000000010202 cr2: 0x00007fff9db1224b
Logical CPU: 3
Error Code: 0x00000000
Trap Number: 6
Binary Images:
0x100000000 - 0x100000ff7 +python (???) /Users/USER//python
0x100003000 - 0x100146ff7 +libpython2.7.dylib (2.7) <87FF0E63-058F-3190-A882-8E25F3D889C7> /Users/USER//libpython2.7.dylib
0x1002db000 - 0x1002dcff7 +_locale.so (???) /Users/USER//_locale.so
0x1002e0000 - 0x1002e6ff7 +itertools.so (???) /Users/USER//itertools.so
<<<<<< LINES OMITTED FOR BREVITY >>>>>>
0x7fff8fc2b000 - 0x7fff8fc32fff libsystem_symptoms.dylib (532.1.1) <8FB7CA37-79EF-3651-B5B9-B5E1E0947067> /usr/lib/system/libsystem_symptoms.dylib
0x7fff8fc33000 - 0x7fff8fc53ff7 libsystem_trace.dylib (518.20.8) /usr/lib/system/libsystem_trace.dylib
0x7fff8fc54000 - 0x7fff8fc59ffb libunwind.dylib (35.3) <9F7C2AD8-A9A7-3DE4-828D-B0F0F166AAA0> /usr/lib/system/libunwind.dylib
0x7fff8fc5a000 - 0x7fff8fc83ff7 libxpc.dylib (972.20.3) <85EB25FD-218F-38EE-9E69-391CC8EBE6C5> /usr/lib/system/libxpc.dylib
External Modification Summary:
Calls made by other processes targeting this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by all processes on this machine:
task_for_pid: 542465
thread_create: 0
thread_set_state: 0
VM Region Summary:
ReadOnly portion of Libraries: Total=254.5M resident=0K(0%) swapped_out_or_unallocated=254.5M(100%)
Writable regions: Total=96.5M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=96.5M(100%)
VIRTUAL REGION
REGION TYPE SIZE COUNT (non-coalesced)
=========== ======= =======
Activity Tracing 256K 2
CoreUI image file 144K 3
Dispatch continuations 8192K 2
Kernel Alloc Once 8K 2
MALLOC 61.8M 54
MALLOC guard page 32K 7
Memory Tag 242 12K 2
STACK GUARD 56.0M 7
Stack 10.1M 7
VM_ALLOCATE 48K 7
__DATA 21.0M 292
__IMAGE 528K 2
__LINKEDIT 115.0M 66
__TEXT 139.5M 288
__UNICODE 556K 2
mapped file 43.2M 9
shared memory 16.3M 12
=========== ======= =======
TOTAL 472.4M 747
Model: MacBookPro11,1, BootROM MBP111.0138.B17, 2 processors, Intel Core i5, 2,4 GHz, 8 GB, SMC 2.16f68
Graphics: Intel Iris, Intel Iris, Built-In
Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54343531533641465238412D50422020
Memory Module: BANK 1/DIMM0, 4 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54343531533641465238412D50422020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x112), Broadcom BCM43xx 1.0 (7.21.171.47.1a8)
Bluetooth: Version 5.0.1f7, 3 services, 17 devices, 1 incoming serial ports
Network Service: AirPort, AirPort, en0
Serial ATA Device: APPLE SSD SM0256F, 251 GB
USB Device: USB 3.0 Bus
USB Device: Apple Internal Keyboard / Trackpad
USB Device: BRCM20702 Hub
USB Device: Bluetooth USB Host Controller
Thunderbolt Bus: MacBook Pro, Apple Inc., 17.2
Try setting the "start method" to "spawn" instead of the default of "fork". See https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods for further details.
This worked for me on a similar problem.
Ok, more info: If I run a first process from terminal, whose script 'visl.py' is:
#!/usr/bin/env python
from multiprocessing import Process
import sys
sys.path.insert(0, './lib')
import visualizer
visualizer.Visualizer()
and then a second process from a different terminal instance, whose script 'logr.py' is:
#!/usr/bin/env python
from multiprocessing import Process
import sys
sys.path.insert(0, './lib')
import logger
args_logger = {'sampling_time_ms': 5, 'plotting_time_ms': 100}
logger.Logger(args_logger)
It works. Then: how to run two python processes from a single script?

How to use wxTreeItemData without crashing upon deletion

I'm using wxWidgets, and I have a wxTreeCtrl set up with a root and a single child. I'm setting client data on the child and it works fine until the window closes, at which point I get a bus error, which I'm assuming is coming from wxWidgets attempting to delete my client data.
Here's my client data struct:
struct MapPtrCtr {
Map* map;
MapPtrCtr(Map* map) : map(map) {}
};
Here's how I set the client data (note that here, map is std::shared_ptr<Map>):
wxTreeItemId childNode = mapTree->AppendItem(node, map->getTitle());
mapTree->SetItemData(childNode, (wxTreeItemData*) new MapPtrCtr(map.get()));
Here's the error I get:
Process: AromatherapyMapEditor [43832]
Path: /Users/USER/*/AromatherapyMapEditor
Identifier: AromatherapyMapEditor
Version: 0
Code Type: X86-64 (Native)
Parent Process: bash [805]
Responsible: Terminal [798]
User ID: 501
Date/Time: 2015-03-16 13:38:02.964 -0400
OS Version: Mac OS X 10.10.1 (14B25)
Report Version: 11
Anonymous UUID: 3887BB6D-7783-EBA5-C86C-FACE1C21094E
Sleep/Wake UUID: 9C9670EA-BBC7-4046-B544-F1CE3F184398
Time Awake Since Boot: 84000 seconds
Time Since Wake: 12000 seconds
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00007fb920f1ae80
VM Regions Near 0x7fb920f1ae80:
MALLOC_TINY 00007fb920d00000-00007fb920f00000 [ 2048K] rw-/rwx SM=PRV
--> MALLOC_TINY 00007fb920f00000-00007fb921000000 [ 1024K] rw-/rwx SM=COW
MALLOC_SMALL 00007fb921000000-00007fb921800000 [ 8192K] rw-/rwx SM=COW
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 ??? 0x00007fb920f1ae80 0 + 140433098387072
1 libwx_osx_cocoau_core-3.0.dylib 0x00000001075f6a26 wxGenericTreeItem::DeleteChildren(wxGenericTreeCtrl*) + 94
2 libwx_osx_cocoau_core-3.0.dylib 0x00000001075fabe2 wxGenericTreeCtrl::Delete(wxTreeItemId const&) + 264
3 libwx_osx_cocoau_core-3.0.dylib 0x00000001075fac64 wxGenericTreeCtrl::DeleteAllItems() + 40
4 libwx_osx_cocoau_core-3.0.dylib 0x00000001075f925c wxGenericTreeCtrl::~wxGenericTreeCtrl() + 102
5 libwx_osx_cocoau_core-3.0.dylib 0x000000010759f96b wxTreeCtrl::~wxTreeCtrl() + 15
6 libwx_osx_cocoau_core-3.0.dylib 0x00000001075a5da0 wxWindowBase::Destroy() + 40
7 libwx_osx_cocoau_core-3.0.dylib 0x00000001075a5e96 wxWindowBase::DestroyChildren() + 20
8 libwx_osx_cocoau_core-3.0.dylib 0x0000000107438d79 wxWindow::~wxWindow() + 215
9 libwx_osx_cocoau_core-3.0.dylib 0x00000001075effeb wxSplitterWindow::~wxSplitterWindow() + 15
10 libwx_osx_cocoau_core-3.0.dylib 0x00000001075a5da0 wxWindowBase::Destroy() + 40
11 libwx_osx_cocoau_core-3.0.dylib 0x00000001075a5e96 wxWindowBase::DestroyChildren() + 20
12 libwx_osx_cocoau_core-3.0.dylib 0x0000000107435121 wxNonOwnedWindow::~wxNonOwnedWindow() + 45
13 AromatherapyMapEditor 0x000000010739f913 MapeditFrame::~MapeditFrame() + 259 (frame.h:24)
14 AromatherapyMapEditor 0x000000010739e1f5 MapeditFrame::~MapeditFrame() + 21 (frame.h:24)
15 AromatherapyMapEditor 0x000000010739e219 MapeditFrame::~MapeditFrame() + 25 (frame.h:24)
16 libwx_baseu-3.0.dylib 0x000000010795ec72 wxAppConsoleBase::DeletePendingObjects() + 74
17 libwx_baseu-3.0.dylib 0x000000010795ebd3 wxAppConsoleBase::ProcessIdle() + 85
18 libwx_osx_cocoau_core-3.0.dylib 0x00000001074dcef6 wxAppBase::ProcessIdle() + 22
19 libwx_osx_cocoau_core-3.0.dylib 0x000000010746be5a wxApp::ProcessIdle() + 26
20 libwx_baseu-3.0.dylib 0x0000000107984faa wxEventLoopBase::ProcessIdle() + 28
21 libwx_baseu-3.0.dylib 0x0000000107a0d661 wxCFEventLoop::CommonModeObserverCallBack(__CFRunLoopObserver*, int) + 69
22 com.apple.CoreFoundation 0x00007fff8db02d87 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
23 com.apple.CoreFoundation 0x00007fff8db02ce0 __CFRunLoopDoObservers + 368
24 com.apple.CoreFoundation 0x00007fff8daf4f1a __CFRunLoopRun + 1178
25 com.apple.CoreFoundation 0x00007fff8daf4838 CFRunLoopRunSpecific + 296
26 com.apple.HIToolbox 0x00007fff926dd43f RunCurrentEventLoopInMode + 235
27 com.apple.HIToolbox 0x00007fff926dd1ba ReceiveNextEventCommon + 431
28 com.apple.HIToolbox 0x00007fff926dcffb _BlockUntilNextEventMatchingListInModeWithFilter + 71
29 com.apple.AppKit 0x00007fff8b6906d1 _DPSNextEvent + 964
30 com.apple.AppKit 0x00007fff8b68fe80 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 194
31 com.apple.AppKit 0x00007fff8b683e23 -[NSApplication run] + 594
32 libwx_osx_cocoau_core-3.0.dylib 0x00000001074bdd8c wxGUIEventLoop::OSXDoRun() + 106
33 libwx_baseu-3.0.dylib 0x0000000107a0db35 wxCFEventLoop::DoRun() + 39
34 libwx_baseu-3.0.dylib 0x0000000107984ed8 wxEventLoopBase::Run() + 88
35 libwx_baseu-3.0.dylib 0x000000010795ea04 wxAppConsoleBase::MainLoop() + 128
36 libwx_osx_cocoau_core-3.0.dylib 0x000000010746bea8 wxApp::OnRun() + 26
37 libwx_baseu-3.0.dylib 0x00000001079b33ae wxEntry(int&, wchar_t**) + 71
38 AromatherapyMapEditor 0x000000010738d706 main + 38 (main.cpp:15)
39 libdyld.dylib 0x00007fff916bf5c9 start + 1
Any suggestions? I'm not sure how to properly use wxTreeItemData because there's very little documentation on it. The docs say to make sure to initialize the struct with new, and I do, so I'm not sure why there's a problem.
That was quick. I figured out how to properly use wxTreeItemData: you have to subclass it, not just cast to it. The following client data class works:
class MapPtrCtr : public wxTreeItemData {
public:
Map* map;
MapPtrCtr(Map* map) : map(map) {}
};