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 when working with Eventlet #50

Open
GoogleCodeExporter opened this issue Dec 2, 2015 · 5 comments
Open

Segmentation Fault when working with Eventlet #50

GoogleCodeExporter opened this issue Dec 2, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
import PyV8
import eventlet

class Global(PyV8.JSClass):
    def sleep(self, seconds):
        eventlet.sleep(seconds)

def run(n):
    with PyV8.JSContext(Global()) as ctx:
        return ctx.eval("sleep(2);")

pool = eventlet.GreenPool()
for result in pool.imap(run, xrange(5)):
    print result



What is the expected output? What do you see instead?
Expected:
None
None
None
None
None

Instead:
Segmentation Fault

What version of the product are you using? On what operating system?
Eventlet 0.9.7, PyV8 0.9, V8 2.2.9, Python 2.6.2, Ubuntu 9.04


Please provide any additional information below.
Strangely enough, if I compile the "sleep(2)", then run it, it works.  Only 
when I eval() something that would cause Eventlet to cooperatively yield 
does it segfault.

Original issue reported on code.google.com by [email protected] on 14 May 2010 at 9:52

Attachments:

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 14 May 2010 at 11:14

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Another note I should probably add,

Someone from Freenode #eventlet claims they are able to run the above example 
just 
fine on X86_64 with the PyV8 binaries.  I'm on i686 and have tried both the 
PyV8 
binaries and compiling from source, but I still get a segfault.

Original comment by [email protected] on 14 May 2010 at 11:22

@GoogleCodeExporter
Copy link
Author

I think the root cause is the eventlet base on the greenlet project, which 
seems use a 
customized python stack frame for the lightweight coroutine, which may conflict 
with 
pyv8's multi-thread support. So, I need more time to study the implement 
mechanism 
of greenlet.

Original comment by [email protected] on 16 May 2010 at 4:47

  • Added labels: OpSys-All, Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

Thanks for looking at it, flier.lu.  Are you able to reproduce it?

Original comment by [email protected] on 16 May 2010 at 6:59

@GoogleCodeExporter
Copy link
Author

Sure, that's why I believe it is a mechanism issue, pyv8's multi-threading 
support is 
not too sophisticated at this time.

Original comment by [email protected] on 17 May 2010 at 1:47

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