Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 344305

Summary: dev-python/greenlet-0.3.1 doesn't work with -fomit-frame-pointer
Product: Gentoo Linux Reporter: Vadim Fint <mocksoul>
Component: New packagesAssignee: Python Gentoo Team <python>
Status: RESOLVED UPSTREAM    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Fixed ebuild
Patch against greenlet-0.3.1.ebuild

Description Vadim Fint 2010-11-05 18:27:04 UTC
I have these CFLAGS set in /etc/make.conf:
CFLAGS="-O2 -march=core2 -fomit-frame-pointer -pipe"

greenlet compiles well with them, but fails to work with "python2.6: greenlet.c:278: slp_save_state: Assertion `ts_current->stack_saved == 0' failed." error on 2nd switch() request (in python code).

If compiled without -fomit-frame-pointer everything works well.

Reproducible: Always

Steps to Reproduce:
1. set -fomit-frame-pointer in /etc/make.conf
2. emerge dev-python/greenlet-0.3.1
3. try this:

from greenlet import greenlet

def test1(x, y):
    z = gr2.switch(x+y)
    print(z)

def test2(u):
    print(u)
    gr1.switch(42)

gr1 = greenlet(test1)
gr2 = greenlet(test2)
gr1.switch("hello", " world")

Actual Results:  
Fails both with 2.x and 3.x python branches with error:

python ~/tt.py
hello world
python2.6: greenlet.c:278: slp_save_state: Assertion `ts_current->stack_saved == 0' failed.
zsh: abort      python ~/tt.py

Expected Results:  
python ~/tt.py
hello world
42
Comment 1 Vadim Fint 2010-11-05 18:27:50 UTC
Created attachment 253323 [details]
Fixed ebuild

Removes -fomit-frame-pointer for greenlet compilation.
Comment 2 Vadim Fint 2010-11-05 18:28:52 UTC
Created attachment 253327 [details, diff]
Patch against greenlet-0.3.1.ebuild
Comment 3 Johan Bergström 2010-11-11 08:48:17 UTC
Vadim: Could you please open an upstream bug about this?
Comment 4 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2011-03-31 14:24:08 UTC
This bug might be specific to x86.
Comment 5 Sébastien Fabbro (RETIRED) gentoo-dev 2012-01-19 15:43:57 UTC
not reproducible on amd64. flags bugs are best reported upstream anyway.