marylinh / pyv8

Automatically exported from code.google.com/p/pyv8
0 stars 0 forks source link

Segfault on dir(jscontext.locals) before run jscontext #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. import PyV8 in python
2. create context=PyV8.JSContext()
3. try run dir(context.locals) before context.enter()

What is the expected output? What do you see instead?

Exception in python, but i got segfault.

What version of the product are you using? On what operating system?

PyV8 0.7, Ubuntu 9.10 x64, static compiled version of V8, and own compiled 
libboost (bug in libboost-python1.38 Ubuntu 9.10). Python 2.6.4.

Original issue reported on code.google.com by mpodes...@gmail.com on 6 Nov 2009 at 9:25

GoogleCodeExporter commented 9 years ago
I will fix it later, I think the root cause is the wrong status in the context 
object :(

Original comment by flier...@gmail.com on 6 Nov 2009 at 12:33

GoogleCodeExporter commented 9 years ago
I think the root cause is v8 make a wrong assumption, so I just submitted a 
issue to 
them. I think you could check this situation before use dir at this time, and I 
will 
update the case later after v8 fix it :)

http://code.google.com/p/v8/issues/detail?id=497

Original comment by flier...@gmail.com on 7 Nov 2009 at 11:33

GoogleCodeExporter commented 9 years ago
I will check the status in the wrapper methods.

Comment 1 by ager@chromium.org, Today (25 minutes ago)
You must enter a context before using GetPropertyNames.  One of the reasons for 
this 
is that GetPropertyNames allocated a new javascript array containing the names. 
 This 
array will be allocated in the context that has been entered.

As a general rule of thumb, you have to enter a context before performing 
operations 
on objects through the V8 API.

Original comment by flier...@gmail.com on 9 Nov 2009 at 8:22