Segmentation fault error

79 views
Skip to first unread message

airween

unread,
Jan 2, 2011, 2:23:58 AM1/2/11
to PyV8
Hello,

so, I compiled the modul successfully, and I've started play with
code.

First, I've downloaded the unit test file:
http://code.google.com/p/pyv8/source/browse/trunk/PyV8.py


and when I ran that, I get a segmentation fault error. Here is the
full output with "-v":

$ ./test.py -v
2011-01-02 08:18:38,707 INFO testing PyV8 module 1.0 with V8 v3.0.2.1
testBlock (__main__.TestAST) ... ok
testCallStatements (__main__.TestAST) ... ok
testForStatement (__main__.TestAST) ... ok
testIfStatement (__main__.TestAST) ... ok
testLiterals (__main__.TestAST) ... ok
testOperations (__main__.TestAST) ... ok
testTryStatements (__main__.TestAST) ... ok
testMultiNamespace (__main__.TestContext) ... ok
testEventDispatch (__main__.TestDebug) ... 2011-01-02 08:18:38,729
DEBUG receive debug event: before compile script: <script script None
@ 0:0> : 'function test() { text = "1+2"; return eval(text) } test()'

2011-01-02 08:18:38,732 DEBUG receive debug event: after compile
script: <script script None @ 0:0> : 'function test() { text = "1+2";
return eval(text) } test()'

2011-01-02 08:18:38,735 DEBUG receive debug event: before compile
script: <script script None @ 0:0> : '1+2'
#00 test() [unnamed] line 1 column 33 (position 33)#01 [anonymous]()
[unnamed] line 1 column 53 (position 53)
2011-01-02 08:18:38,736 DEBUG receive debug event: after compile
script: <script script None @ 0:0> : '1+2'
#00 test() [unnamed] line 1 column 33 (position 33)#01 [anonymous]()
[unnamed] line 1 column 53 (position 53)
ok
testClassProperties (__main__.TestEngine) ... ok
testCompile (__main__.TestEngine) ... ok
testEval (__main__.TestEngine) ... ok
testExtension (__main__.TestEngine) ... ok
testGlobal (__main__.TestEngine) ... ok
testNativeExtension (__main__.TestEngine) ... ok
testObjectBuildInMethods (__main__.TestEngine) ... ok
testPrecompile (__main__.TestEngine) ... ok
testPythonWrapper (__main__.TestEngine) ... ok
testThis (__main__.TestEngine) ... ok
testLocker (__main__.TestMultithread) ... ok
testMultiJavascriptThread (__main__.TestMultithread) ... ok
testMultiPythonThread (__main__.TestMultithread) ... ok
testArray (__main__.TestWrapper) ... ok
testAutoConverter (__main__.TestWrapper) ... ok
testCall (__main__.TestWrapper) ... ok
testClassicStyleObject (__main__.TestWrapper) ... Segmentation fault

Ubuntu 10.04, 32bit, 2.6.32-27-generic, libc6: 2.11.1, Python: 2.6.5
(r265:79063, Apr 16 2010, 13:09:56).

What's the problem?


Thanks:


a.

Flier Lu

unread,
Jan 4, 2011, 9:24:48 AM1/4/11
to PyV8
I can't reproduce your core dump on my debian system, build with PyV8
module 1.0 (SVN trunk) with V8 v3.0.5 (r6158)

$ uname -a
Linux debian 2.6.26-2-686 #1 SMP Thu Nov 25 01:53:57 UTC 2010 i686 GNU/
Linux

Could you send me your core dump file, or dump the stack with gdb?

http://stackoverflow.com/questions/17965/generate-a-core-dump-in-linux

airween

unread,
Jan 4, 2011, 10:20:19 AM1/4/11
to PyV8
Hello,

On jan. 4, 15:24, Flier Lu <flier...@gmail.com> wrote:
> I can't reproduce your core dump on my debian system, build with PyV8
> module 1.0 (SVN trunk) with V8 v3.0.5 (r6158)

I think the V8 has been updated - last weekend that was just r6125,
but what does it mean PyV8 1.0? The version of the source is 0.9....
(in PyV8.py there is version 1.0 - do you think about that?)

btw: I have compiled those sources above (approximately), but the I
get another error, see this issue:

http://groups.google.com/group/pyv8/browse_thread/thread/ae47be3d9a07f696

Next step was I compiled an older version of V8, then I get a working
_PyV8.so - this has segfault error.

> $ uname -a
> Linux debian 2.6.26-2-686 #1 SMP Thu Nov 25 01:53:57 UTC 2010 i686 GNU/
> Linux
>
> Could you send me your core dump file, or dump the stack with gdb?

That error occurs on my home machine, at evening (in Hungary) I'll
check this.


thank you:


a.

airween

unread,
Jan 4, 2011, 2:32:42 PM1/4/11
to PyV8
Hello,

here is the output of gdb:

$ gdb python core
GNU gdb (GDB) 7.1-ubuntu

Reading symbols from /usr/bin/python...(no debugging symbols
found)...done.
[New Thread 2481]
[New Thread 2482]

...
...
Loaded symbols for /usr/lib/python2.6/lib-dynload/datetime.so
Core was generated by `python ./test.py'.
Program terminated with signal 11, Segmentation fault.
#0 0x080ed3eb in PyErr_Fetch ()
(gdb)


Thanks for your help:


a.

Flier Lu

unread,
Jan 7, 2011, 12:00:13 PM1/7/11
to PyV8
It's very strange, I have checked pyv8 code, it only use PyErr_Fetch
one time to fetch the exception information, but it should not access
any invalid memory.

Could you send me the core dump file? or build v8/pyv8 with debug
mode?

btw: did you generate the crash by your test.py script?

I found a `python ./test.py'. in your feedback

void CPythonObject::ThrowIf(void)
{
CPythonGIL python_gil;

assert(::PyErr_Occurred());

v8::HandleScope handle_scope;

PyObject *exc, *val, *trb;

::PyErr_Fetch(&exc, &val, &trb);

Ervin Hegedüs

unread,
Jan 7, 2011, 12:25:17 PM1/7/11
to py...@googlegroups.com
Hello,

> It's very strange, I have checked pyv8 code, it only use PyErr_Fetch
> one time to fetch the exception information, but it should not access
> any invalid memory.
>
> Could you send me the core dump file? or build v8/pyv8 with debug
> mode?

yes, at evening from home.

> btw: did you generate the crash by your test.py script?

yes, as I wrote my first email. As I remember I ran it with -v, so
there were some info which part of test.py generate the crash. (As I
remember there were some kind "os.getcwd()"...)


> I found a `python ./test.py'. in your feedback
>
> void CPythonObject::ThrowIf(void)
> {
>  CPythonGIL python_gil;
>
>  assert(::PyErr_Occurred());
>
>  v8::HandleScope handle_scope;
>
>  PyObject *exc, *val, *trb;
>
>  ::PyErr_Fetch(&exc, &val, &trb);

I don't know what does it mean, I'm not coding C++ :(


thanks:


a.

Flier Lu

unread,
Jan 11, 2011, 1:05:20 PM1/11/11
to PyV8
I have tried on a Amazon EC2 instance, but I can't reproduce your
crash

ubuntu@ip-10-194-250-19:~/pyv8/build/lib.linux-i686-2.6$ uname -a
Linux ip-10-194-250-19 2.6.32-309-ec2 #18-Ubuntu SMP Mon Oct 18
21:00:20 UTC 2010 i686 GNU/Linux

ubuntu@ip-10-194-250-19:~/pyv8/build/lib.linux-i686-2.6$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2

ubuntu@ip-10-194-250-19:~/pyv8/build/lib.linux-i686-2.6$ python
PyV8.py -v
2011-01-11 17:49:01,334 INFO testing PyV8 module 1.0 with V8 v3.0.7
testBlock (__main__.TestAST) ... ok

I use the default boost 1.40 to build pyv8

airween

unread,
Jan 12, 2011, 2:10:16 AM1/12/11
to PyV8
Hello,

On jan. 11, 19:05, Flier Lu <flier...@gmail.com> wrote:
> I have tried on a Amazon EC2 instance, but I can't reproduce your
> crash
>
> ubuntu@ip-10-194-250-19:~/pyv8/build/lib.linux-i686-2.6$ uname -a
> Linux ip-10-194-250-19 2.6.32-309-ec2 #18-Ubuntu SMP Mon Oct 18
> 21:00:20 UTC 2010 i686 GNU/Linux
>
> ubuntu@ip-10-194-250-19:~/pyv8/build/lib.linux-i686-2.6$ python
> Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
> [GCC 4.4.3] on linux2
>
> ubuntu@ip-10-194-250-19:~/pyv8/build/lib.linux-i686-2.6$ python
> PyV8.py -v
> 2011-01-11 17:49:01,334 INFO testing PyV8 module 1.0 with V8 v3.0.7
> testBlock (__main__.TestAST) ... ok
>
> I use the default boost 1.40 to build pyv8

thank you for your effort, I'll try to build again, and will report
for you.



a.

Flier Lu

unread,
Jan 12, 2011, 3:24:38 AM1/12/11
to py...@googlegroups.com
It's ok, I have updated the automatic build script, which may simplify
the build stage.

Thanks for your feedback and efforts :)

2011/1/12 airween <air...@gmail.com>:

> --
> You received this message because you are subscribed to the Google Groups "PyV8" group.
> To post to this group, send email to py...@googlegroups.com.
> To unsubscribe from this group, send email to pyv8+uns...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pyv8?hl=en.
>
>

airween

unread,
Jan 16, 2011, 9:41:30 AM1/16/11
to PyV8
Hello again,

so, with help of Flier I can compiled PyV8 correctly.

I checkout'd all dependeces freshly, and build v8 and pyv8:

cd v8
scons

scons ran _without_ any options, eg. mode=debug

Flier wrote the setup.py has modifies the V8 SConstruct, but as I see
it doesn't - so I patched it manually, and after I recompile v8 (scons
clean, scons)

After this I changed directory, and builds pyv8:

export V8_HOME=/path/to/v8
export BOOST_HOME=/path/to/boost-trunk/directory

sudo python setup.py install


And then the PyV8.py unittest has passed.


Thanks for all help, Flier.


a.

On jan. 12, 09:24, Flier Lu <flier...@gmail.com> wrote:
> It's ok, I have updated the automatic build script, which may simplify
> the build stage.
>
> Thanks for your feedback and efforts :)
>
> 2011/1/12 airween <airw...@gmail.com>:

Flier Lu

unread,
Jan 16, 2011, 9:42:28 AM1/16/11
to PyV8
Thanks for your sharing :)
Reply all
Reply to author
Forward
0 new messages