Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when accessing python data via JavaScript #174

Open
GoogleCodeExporter opened this issue May 2, 2015 · 3 comments
Open

Crash when accessing python data via JavaScript #174

GoogleCodeExporter opened this issue May 2, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

Forgive me for not creating a minimal example of the problem yet.  Here's a 
rough explanation.

I'm creating dicts in Python and then pushing the dicts into a JavaScript 
array.  Something like this:

data = [];
for (n = 0; n < itemlen; n++) {
  item = pyfunc(n);
  data.push(item);
}

Later on I return data back to python by calling JSON.stringify(data)

In recent builds, on Mac OS (I haven't tested Windows), PyV8 crashes with a 
segmentation fault.  Interestingly, when I loop through data, passing each item 
back to Python, the crash doesn't happen.

Please let me know what I can do to help resolve this problem.

Here's the relevant part of the crash info:

Process:         Python [54082]
Path:            
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/
MacOS/Python
Identifier:      org.python.python
Version:         2.7.4 (2.7.4)
Code Type:       X86-64 (Native)
Parent Process:  bash [62168]
User ID:         501

Date/Time:       2013-05-01 23:56:37.232 -0400
OS Version:      Mac OS X 10.8.2 (12C2034)
Report Version:  10

Interval Since Last Report:          285252 sec
Crashes Since Last Report:           28
Per-App Interval Since Last Report:  626 sec
Per-App Crashes Since Last Report:   24
Anonymous UUID:                      4E302A2E-F17C-8944-CFBD-D3F305073F4F

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000098

VM Regions Near 0x98:
--> 
    __TEXT                 0000000100000000-0000000100001000 [    4K] r-x/rwx SM=COW  /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python

Application Specific Information:
Performing @selector(clickedAction:) from sender wxNSMenuItem 0x109753510

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   org.python.python               0x00000001000545c1 dict_dealloc + 33
1   _PyV8.so                        0x000000010860993a 
ObjectTracer::~ObjectTracer() + 154
2   _PyV8.so                        0x0000000108609ba9 
ObjectTracer::WeakCallback(v8::Persistent<v8::Value>, void*) + 25
3   _PyV8.so                        0x000000010872e96d 
v8::internal::GlobalHandles::Node::PostGarbageCollectionProcessing(v8::internal:
:Isolate*, v8::internal::GlobalHandles*) + 301
4   _PyV8.so                        0x000000010872dd03 
v8::internal::GlobalHandles::PostGarbageCollectionProcessing(v8::internal::Garba
geCollector, v8::internal::GCTracer*) + 115
5   _PyV8.so                        0x000000010874a289 
v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, 
v8::internal::GCTracer*) + 1817
6   _PyV8.so                        0x0000000108749a9c 
v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, 
v8::internal::GarbageCollector, char const*, char const*) + 428
7   _PyV8.so                        0x0000000108713443 
v8::internal::Factory::NewRawOneByteString(int, v8::internal::PretenureFlag) + 
131
8   _PyV8.so                        0x000000010888ec79 
v8::internal::BasicJsonStringifier::Extend() + 281
9   _PyV8.so                        0x000000010888f1de 
v8::internal::BasicJsonStringifier::SerializeString(v8::internal::Handle<v8::int
ernal::String>) + 910
10  _PyV8.so                        0x00000001088cd48b 
v8::internal::BasicJsonStringifier::Result 
v8::internal::BasicJsonStringifier::Serialize_<true>(v8::internal::Handle<v8::in
ternal::Object>, bool, v8::internal::Handle<v8::internal::Object>) + 667
11  _PyV8.so                        0x00000001088cce3f 
v8::internal::BasicJsonStringifier::Result 
v8::internal::BasicJsonStringifier::Serialize_<false>(v8::internal::Handle<v8::i
nternal::Object>, bool, v8::internal::Handle<v8::internal::Object>) + 3791
12  _PyV8.so                        0x00000001088cd9ae 
v8::internal::BasicJsonStringifier::Result 
v8::internal::BasicJsonStringifier::Serialize_<true>(v8::internal::Handle<v8::in
ternal::Object>, bool, v8::internal::Handle<v8::internal::Object>) + 1982
13  _PyV8.so                        0x00000001088cce3f 
v8::internal::BasicJsonStringifier::Result 
v8::internal::BasicJsonStringifier::Serialize_<false>(v8::internal::Handle<v8::i
nternal::Object>, bool, v8::internal::Handle<v8::internal::Object>) + 3791
14  _PyV8.so                        0x000000010888e440 
v8::internal::BasicJsonStringifier::Stringify(v8::internal::Handle<v8::internal:
:Object>) + 32
15  _PyV8.so                        0x00000001088a3431 
v8::internal::Runtime_BasicJSONStringify(int, v8::internal::Object**, 
v8::internal::Isolate*) + 225
16  ???                             0x0000023b6e80616e 0 + 2454280233326
17  ???                             0x0000023b6e839bfb 0 + 2454280444923
18  ???                             0x0000023b6e80bb14 0 + 2454280256276
19  ???                             0x0000023b6e832e4c 0 + 2454280416844
20  ???                             0x0000023b6e825b64 0 + 2454280362852
21  ???                             0x0000023b6e8077f7 0 + 2454280239095
22  _PyV8.so                        0x000000010870a91c 
v8::internal::Invoke(bool, v8::internal::Handle<v8::internal::JSFunction>, 
v8::internal::Handle<v8::internal::Object>, int, 
v8::internal::Handle<v8::internal::Object>*, bool*) + 396
23  _PyV8.so                        0x0000000108697e8a v8::Script::Run() + 490
24  _PyV8.so                        0x00000001085e256b 
CEngine::ExecuteScript(v8::Handle<v8::Script>) + 235
25  _PyV8.so                        0x00000001085e26e5 CScript::Run() + 53
26  _PyV8.so                        0x00000001085d74aa 
CContext::EvaluateW(std::basic_string<wchar_t, std::char_traits<wchar_t>, 
std::allocator<wchar_t> > const&, std::basic_string<wchar_t, 
std::char_traits<wchar_t>, std::allocator<wchar_t> >, int, int, 
boost::python::api::object) + 250
27  _PyV8.so                        0x00000001085df353 
boost::python::detail::caller_arity<6u>::impl<boost::python::api::object 
(CContext::*)(std::basic_string<wchar_t, std::char_traits<wchar_t>, 
std::allocator<wchar_t> > const&, std::basic_string<wchar_t, 
std::char_traits<wchar_t>, std::allocator<wchar_t> >, int, int, 
boost::python::api::object), boost::python::default_call_policies, 
boost::mpl::vector7<boost::python::api::object, CContext&, 
std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > 
const&, std::basic_string<wchar_t, std::char_traits<wchar_t>, 
std::allocator<wchar_t> >, int, int, boost::python::api::object> 
>::operator()(_object*, _object*) + 1155
28  libboost_python-mt.dylib        0x00000001069d237e 
boost::python::objects::function::call(_object*, _object*) const + 766
29  libboost_python-mt.dylib        0x00000001069d447a 
boost::detail::function::void_function_ref_invoker0<boost::python::objects::(ano
nymous namespace)::bind_return, 
void>::invoke(boost::detail::function::function_buffer&) + 26
30  libboost_python-mt.dylib        0x00000001069da65c 
boost::function0<void>::operator()() const + 28
31  libboost_python-mt.dylib        0x00000001069da37c 
boost::python::detail::exception_handler::operator()(boost::function0<void> 
const&) const + 28
32  _PyV8.so                        0x00000001085cee92 
boost::detail::function::function_obj_invoker2<boost::_bi::bind_t<bool, 
boost::python::detail::translate_exception<CJavascriptException, void 
(*)(CJavascriptException const&)>, boost::_bi::list3<boost::arg<1>, 
boost::arg<2>, boost::_bi::value<void (*)(CJavascriptException const&)> > >, 
bool, boost::python::detail::exception_handler const&, boost::function0<void> 
const&>::invoke(boost::detail::function::function_buffer&, 
boost::python::detail::exception_handler const&, boost::function0<void> const&) 
+ 34
33  libboost_python-mt.dylib        0x00000001069da578 
boost::python::detail::exception_handler::handle(boost::function0<void> const&) 
const + 40
34  libboost_python-mt.dylib        0x00000001069da1cd 
boost::python::handle_exception_impl(boost::function0<void>) + 29
35  libboost_python-mt.dylib        0x00000001069d3e83 function_call + 83
36  org.python.python               0x000000010000c9a2 PyObject_Call + 98
37  org.python.python               0x00000001000c0b18 PyEval_EvalFrameEx + 14024
38  org.python.python               0x00000001000c5999 PyEval_EvalCodeEx + 2137
39  org.python.python               0x00000001000c328d PyEval_EvalFrameEx + 24125
40  org.python.python               0x00000001000c5999 PyEval_EvalCodeEx + 2137
41  org.python.python               0x00000001000c328d PyEval_EvalFrameEx + 24125
42  org.python.python               0x00000001000c5999 PyEval_EvalCodeEx + 2137
43  org.python.python               0x000000010003e580 function_call + 176
44  org.python.python               0x000000010000c9a2 PyObject_Call + 98
45  org.python.python               0x000000010001f0bb instancemethod_call + 363
46  org.python.python               0x000000010000c9a2 PyObject_Call + 98
47  org.python.python               0x00000001000bc197 
PyEval_CallObjectWithKeywords + 87
48  _core_.so                       0x00000001011c88af 
wxPyCallback::EventThunker(wxEvent&) + 319
49  libwx_osx_cocoau-2.9.5.0.0.dylib    0x00000001015e50b4 
wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, 
wxEvtHandler*, wxEvent&) + 84
50  libwx_osx_cocoau-2.9.5.0.0.dylib    0x00000001015e619f 
wxEvtHandler::SearchDynamicEventTable(wxEvent&) + 111
51  libwx_osx_cocoau-2.9.5.0.0.dylib    0x00000001015e72e8 
wxEvtHandler::TryHereOnly(wxEvent&) + 40
52  libwx_osx_cocoau-2.9.5.0.0.dylib    0x00000001015e74c9 
wxEvtHandler::ProcessEvent(wxEvent&) + 265
53  libwx_osx_cocoau-2.9.5.0.0.dylib    0x00000001015e51ab 
wxEvtHandler::DoTryChain(wxEvent&) + 75
54  libwx_osx_cocoau-2.9.5.0.0.dylib    0x00000001015e73aa 
wxEvtHandler::ProcessEventLocally(wxEvent&) + 74
55  libwx_osx_cocoau-2.9.5.0.0.dylib    0x00000001015e7405 
wxEvtHandler::ProcessEvent(wxEvent&) + 69
56  libwx_osx_cocoau-2.9.5.0.0.dylib    0x00000001015e6d76 
wxEvtHandler::SafelyProcessEvent(wxEvent&) + 22
57  libwx_osx_cocoau-2.9.5.0.0.dylib    0x0000000101821670 
wxWindowBase::HandleWindowEvent(wxEvent&) const + 16
58  libwx_osx_cocoau-2.9.5.0.0.dylib    0x00000001017ceecb 
wxMenuBase::SendEvent(int, int) + 219
59  libwx_osx_cocoau-2.9.5.0.0.dylib    0x000000010164ce41 
wxMenu::HandleCommandProcess(wxMenuItem*, wxWindow*) + 97
60  com.apple.AppKit                0x00007fff88f2ea59 -[NSApplication 
sendAction:to:from:] + 342
61  com.apple.AppKit                0x00007fff8906444c -[NSMenuItem 
_corePerformAction] + 406
62  com.apple.AppKit                0x00007fff8906413a -[NSCarbonMenuImpl 
performActionWithHighlightingForItemAtIndex:] + 133
63  com.apple.AppKit                0x00007fff88d5146f -[NSMenu 
_internalPerformActionForItemAtIndex:] + 36
64  com.apple.AppKit                0x00007fff88d512f7 -[NSCarbonMenuImpl 
_carbonCommandProcessEvent:handlerCallRef:] + 135
65  com.apple.AppKit                0x00007fff8905d245 NSSLMMenuEventHandler + 
342
66  com.apple.HIToolbox             0x00007fff85225f0a 
DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 
1206
67  com.apple.HIToolbox             0x00007fff852253d9 
SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, 
HandlerCallRec*) + 410
68  com.apple.HIToolbox             0x00007fff8523b1bd SendEventToEventTarget + 
40
69  com.apple.HIToolbox             0x00007fff85271e89 
SendHICommandEvent(unsigned int, HICommand const*, unsigned int, unsigned int, 
unsigned char, void const*, OpaqueEventTargetRef*, OpaqueEventTargetRef*, 
OpaqueEventRef**) + 443
70  com.apple.HIToolbox             0x00007fff85216c11 
SendMenuCommandWithContextAndModifiers + 59
71  com.apple.HIToolbox             0x00007fff85216bc3 SendMenuItemSelectedEvent 
+ 254
72  com.apple.HIToolbox             0x00007fff85216a4f 
FinishMenuSelection(SelectionData*, MenuResult*, MenuResult*) + 94
73  com.apple.HIToolbox             0x00007fff851f2aab MenuSelectCore(MenuData*, 
Point, double, unsigned int, OpaqueMenuRef**, unsigned short*) + 605
74  com.apple.HIToolbox             0x00007fff851f20b8 _HandleMenuSelection2 + 
565
75  com.apple.AppKit                0x00007fff88f1c9c6 _NSHandleCarbonMenuEvent 
+ 245
76  com.apple.AppKit                0x00007fff88e3eb7f _DPSNextEvent + 2073
77  com.apple.AppKit                0x00007fff88e3ded2 -[NSApplication 
nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
78  com.apple.AppKit                0x00007fff88e35283 -[NSApplication run] + 517
79  libwx_osx_cocoau-2.9.5.0.0.dylib    0x00000001016e0163 wxGUIEventLoop::DoRun() 
+ 51
80  libwx_osx_cocoau-2.9.5.0.0.dylib    0x00000001015b1d07 wxCFEventLoop::Run() + 
55
81  libwx_osx_cocoau-2.9.5.0.0.dylib    0x00000001014b0008 
wxAppConsoleBase::MainLoop() + 72
82  _core_.so                       0x00000001011c372c wxPyApp::MainLoop() + 76
83  _core_.so                       0x000000010120fe3f 
wxPySizer::wxCreateObject() + 202719
84  org.python.python               0x00000001000c3b12 PyEval_EvalFrameEx + 26306
85  org.python.python               0x00000001000c5999 PyEval_EvalCodeEx + 2137
86  org.python.python               0x000000010003e580 function_call + 176
87  org.python.python               0x000000010000c9a2 PyObject_Call + 98
88  org.python.python               0x000000010001f0bb instancemethod_call + 363
89  org.python.python               0x000000010000c9a2 PyObject_Call + 98
90  org.python.python               0x00000001000c0b18 PyEval_EvalFrameEx + 14024
91  org.python.python               0x00000001000c40bd PyEval_EvalFrameEx + 27757
92  org.python.python               0x00000001000c5999 PyEval_EvalCodeEx + 2137
93  org.python.python               0x00000001000c5ab6 PyEval_EvalCode + 54
94  org.python.python               0x00000001000ea32e PyRun_FileExFlags + 174
95  org.python.python               0x00000001000ea5ca PyRun_SimpleFileExFlags + 
458
96  org.python.python               0x000000010010155d Py_Main + 3101
97  org.python.python               0x0000000100000f14 0x100000000 + 3860

Original issue reported on code.google.com by [email protected] on 2 May 2013 at 3:59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant