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

Segmentation fault #4

Closed
GoogleCodeExporter opened this issue Mar 15, 2015 · 1 comment
Closed

Segmentation fault #4

GoogleCodeExporter opened this issue Mar 15, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
On Ubuntu 8.04
1a. Use svn checkout http://v8.googlecode.com/svn/trunk/ v8
 or
1b. Use svn checkout http://v8.googlecode.com/svn/branches/bleeding_edge/ v8
2. Use svn checkout http://pyv8.googlecode.com/svn/trunk/ pyv8-read-only
3. apt-get install install libboost-python-dev
4. apt-get install scons
5. Compile v8 with 'scons' (no arguments)
6. Copy v8-debug.h, v8.h and libv8.a to the lib/v8/*/
7. python setup.py build
8. cd build/lib.linux-i686-2.5/
9. python
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyV8
>>> e = PyV8.JSEngine(object())
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
Boost.Python.ArgumentError: Python argument types in
   JSEngine.__init__(JSEngine, object)
did not match C++ signature:
   __init__(_object*)
>>> e = PyV8.JSEngine()
>>> e.eval()
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
AttributeError: 'JSEngine' object has no attribute 'eval'
>>> e.compile()
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
Boost.Python.ArgumentError: Python argument types in
   JSEngine.compile(JSEngine)
did not match C++ signature:
   compile(CEngine {lvalue}, std::string source, std::string name='',
int line=-1, int col=-1)
>>> e.compile('a=1')
Segmentation fault


What is the expected output? What do you see instead?
Anything but 'Segmentation fault'

What version of the product are you using? On what operating system?
svn versions on Ubuntu 8.04

Please provide any additional information below.

The PyV8.JSEngine().eval() is not available which is used in the pyjamas
pyv8/pyv8run.py example.

Original issue reported on code.google.com by cornelis...@gmail.com on 20 Jun 2009 at 12:39

@GoogleCodeExporter
Copy link
Author

The issue was caused by a wrong assumption, because the compile and eval 
method of JSEngine need a entered context; so, if you directly call those 
methods, 
it will crash in release mode and hit a assert in debug mode.

http://code.google.com/p/pyv8/source/detail?r=125

Now, I change the code to throw a exception instead of 'Segmentation fault'

Please ensure you have enter a context before use the JSEngine, or directly use 
JSContext as delegate

>>> import PyV8
>>> ctxt = PyV8.JSContext()          # create a context with an implicit global 
object
>>> ctxt.enter()                     # enter the context (also support with 
statement)

Original comment by flier...@gmail.com on 20 Jun 2009 at 3:44

  • Changed state: Fixed

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