python-greenlet/greenlet — Issue #3: problems on linux-s390x
Author: schmir
Created: 2012-01-13 12:11:29+00:00
State: open

The problem happened on a SLES 11 SP1 running on IBM z196. The testsuite
throws an error and then is stuck.

```
lxdbst06:/install/gevent # python greenlet-0.3.3/run-tests.py
running build_ext
building 'greenlet' extension
creating build
creating build/temp.linux-s390x-2.6
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -I/usr/local/include/python2.6 -c greenlet.c -o
build/temp.linux-s390x-2.6/greenlet.o
creating build/lib.linux-s390x-2.6
gcc -pthread -shared build/temp.linux-s390x-2.6/greenlet.o -o
build/lib.linux-s390x-2.6/greenlet.so
Linking
/install/gevent/greenlet-0.3.3/build/lib.linux-s390x-2.6/greenlet.so to
/install/gevent/greenlet-0.3.3/greenlet.so
python 2.6.1 (64 bit) using greenlet 0.3.3 from
/install/gevent/greenlet-0.3.3/greenlet.so
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for
Ada/C/ObjC but not for C++
test_dealloc (tests.test_greenlet.GreenletTests) ... ERROR
test_dealloc_other_thread (tests.test_greenlet.GreenletTests) ...
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/local/lib/python2.6/threading.py", line 522, in
__bootstrap_inner
self.run()
File "/usr/local/lib/python2.6/threading.py", line 477, in run
self.__target(*self.__args, **self.__kwargs)
SystemError: error return without exception set

^C
^C

^C
^C
^C
Terminated
```

Compiling with -O0/-Os also doesn't work:

```
lxdbst06:/install/gevent/greenlet-0.3.3 # rm -rf build; CFLAGS=-O0 python
run-tests.py
running build_ext
building 'greenlet' extension
creating build
creating build/temp.linux-s390x-2.6
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -O0 -fPIC
-I/usr/local/include/python2.6 -c greenlet.c -o
build/temp.linux-s390x-2.6/greenlet.o
platform/switch_s390_unix.h: Assembler messages:
platform/switch_s390_unix.h:29: Error: operand out of range (168 is not
between 0 and 15)
platform/switch_s390_unix.h:29: Error: syntax error; expected ,
platform/switch_s390_unix.h:29: Error: junk at end of line: `(%r11),15'
error: command 'gcc' failed with exit status 1
Traceback (most recent call last):
File "run-tests.py", line 53, in
spawn(cmd, search_path=0)
File "/usr/local/lib/python2.6/distutils/spawn.py", line 37, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/usr/local/lib/python2.6/distutils/spawn.py", line 167, in
_spawn_posix
(cmd[0], exit_status)
distutils.errors.DistutilsExecError: command '/usr/local/bin/python'
failed with exit status 1

lxdbst06:/install/gevent/greenlet-0.3.3 # rm -rf build; CFLAGS=-Os python
run-tests.py
running build_ext
building 'greenlet' extension
creating build
creating build/temp.linux-s390x-2.6
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Os -fPIC
-I/usr/local/include/python2.6 -c greenlet.c -o
build/temp.linux-s390x-2.6/greenlet.o
greenlet.c: In function âinitgreenletâ:
greenlet.c:1337: warning: dereferencing type-punned pointer will break
strict-aliasing rules
creating build/lib.linux-s390x-2.6
gcc -pthread -shared -Os build/temp.linux-s390x-2.6/greenlet.o -o
build/lib.linux-s390x-2.6/greenlet.so
Linking
/install/gevent/greenlet-0.3.3/build/lib.linux-s390x-2.6/greenlet.so to
/install/gevent/greenlet-0.3.3/greenlet.so
python 2.6.1 (64 bit) using greenlet 0.3.3 from
/install/gevent/greenlet-0.3.3/greenlet.so
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for
Ada/C/ObjC but not for C++
test_dealloc (tests.test_greenlet.GreenletTests) ... ERROR
test_dealloc_other_thread (tests.test_greenlet.GreenletTests) ...
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/local/lib/python2.6/threading.py", line 522, in
__bootstrap_inner
self.run()
File "/usr/local/lib/python2.6/threading.py", line 477, in run
self.__target(*self.__args, **self.__kwargs)
File "/install/gevent/greenlet-0.3.3/tests/test_greenlet.py", line 138,
in f
g1.switch(seen)
MemoryError

lxdbst06:/install/gevent/greenlet-0.3.3 # gcc -v
Using built-in specs.
Target: s390x-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64
--enable-languages=c,c++,objc,fortran,obj-c++,java
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.3
--enable-ssp --disable-libssp --with-bugurl=http://bugs.opensuse.org/
--with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap
--with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit
--enable-libstdcxx-allocator=new --disable-libstdcxx-pch
--enable-version-specific-runtime-libs --program-suffix=-4.3
--enable-linux-futex --without-system-libunwind --with-tune=z9-109
--with-arch=z900 --with-long-double-128 --enable-decimal-float
--build=s390x-suse-linux
Thread model: posix
gcc version 4.3.4 [gcc-4_3-branch revision 152973] (SUSE Linux)
```