[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] "import pygame" crashes with svn build



Hi,

René Dudfield wrote:
hrmm,

you figured this out yet?


unfortunately not.

Easiest way to work around it...
  Comment out import transform lines in the file:
      site-packages/pygame/__init__.py


I'll do that for now.


What gcc version are you using?  Also what cpu do you have?

gcc --version
gcc (Gentoo 4.3.3-r2 p1.1, pie-10.1.5) 4.3.3

cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Core(TM)2 CPU          6600  @ 2.40GHz
stepping        : 6
cpu MHz         : 1596.000
cache size      : 4096 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall lm constant_tsc arch_perfmon pebs bts rep_good nopl pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm
bogomips        : 4799.80
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Core(TM)2 CPU          6600  @ 2.40GHz
stepping        : 6
cpu MHz         : 1596.000
cache size      : 4096 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
apicid          : 1
initial apicid  : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall lm constant_tsc arch_perfmon pebs bts rep_good nopl pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm
bogomips        : 4799.58
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

That's an Intel Core 2 Duo



What is the gcc line you are using to compile transform.so?  eg.

touch src/transform.c
python setup.py build

gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp
-mno-fused-madd -fno-common -dynamic -DNDEBUG -g -Os -Wall
-Wstrict-prototypes -DMACOSX -I/usr/include/ffi -DENABLE_DTRACE -arch
i386 -arch ppc -pipe -Ddarwin
-I/Library/Frameworks/SDL.framework/Versions/Current/Headers
-I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5
-c src/transform.c -o build/temp.macosx-10.5-i386-2.5/src/transform.o
gcc -Wl,-F. -bundle -undefined dynamic_lookup -arch i386 -arch ppc
build/temp.macosx-10.5-i386-2.5/src/transform.o
build/temp.macosx-10.5-i386-2.5/src/rotozoom.o
build/temp.macosx-10.5-i386-2.5/src/scale2x.o
build/temp.macosx-10.5-i386-2.5/src/scale_mmx.o -o
build/lib.macosx-10.5-i386-2.5/pygame/transform.so -framework SDL
-F/Library/Frameworks/




$ touch src/transform.c
$ python setup.py build
running build
running build_py
running build_ext
building 'pygame.transform' extension
x86_64-pc-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -fPIC -D_REENTRANT -I/usr/X11R6/include -I/usr/include/SDL -I/usr/include/python2.6 -c src/transform.c -o build/temp.linux-x86_64-2.6/src/transform.o
x86_64-pc-linux-gnu-gcc -pthread -shared build/temp.linux-x86_64-2.6/src/transform.o build/temp.linux-x86_64-2.6/src/rotozoom.o build/temp.linux-x86_64-2.6/src/scale2x.o build/temp.linux-x86_64-2.6/src/scale_mmx.o -L/usr/lib64 -lSDL -lpthread -lpython2.6 -o build/lib.linux-x86_64-2.6/pygame/transform.so


Perhaps try commenting out the sse/mmx parts?


I'll try that some other time. Right now I'm preparing to leave for a week.
Thanks again for your help.

//Lorenz




On Sun, May 31, 2009 at 1:34 AM, Lorenz Quack <don@xxxxxxxxxxxxxxxxx> wrote:
René Dudfield wrote:
On Sat, May 30, 2009 at 9:07 AM, Lorenz Quack <don@xxxxxxxxxxxxxxxxx>
wrote:


Hi,

I have a problem running pygame from the current svn sources. building
and
 installing works fine but when I import pygame it crashes:

import pygame
Fatal Python error: (pygame parachute) Segmentation Fault Aborted

If I run it through pdb I get the following result:

pdb.run("import pygame")
<string>(1)<module>()->None
(Pdb) s [...]
/usr/lib64/python2.6/site-packages/pygame/__init__.py(214)<module>()
-> try: import pygame.time (Pdb) n
/usr/lib64/python2.6/site-packages/pygame/__init__.py(217)<module>()
-> try: import pygame.transform (Pdb) s Fatal Python error: (pygame
parachute) Segmentation Fault Aborted

it seems to crash right after the inittransform function. I have no idea
what's going on. Any help is appreciated.

some information about my system that may be relevant: $ uname -a Linux
horst 2.6.27-gentoo-r4 #9 SMP Sat Jan 10 19:56:02 CET 2009 x86_64 Intel(R)
 Core(TM)2 CPU 6600 @ 2.40GHz GenuineIntel GNU/Linux

$ python Python 2.6.2 (r262:71600, May  1 2009, 15:24:32) [GCC 4.3.3] on
linux2

pygame revision: 2282


sincerely yours Lorenz


PS: the latest ebuild available in portage is for pygame-1.8.1 and works
fine.


Hi,

can get a stack trace with gdb?


$ gdb python (gdb) run -c "import pygame"

Then type 'where' when it crashes.

cheers,

Hi René,

here is the stacktrace. Not sure how useful it's going to be because I don't
know how to convince python to build with debug symbols. the --with-pydebug
configure option didn't do the trick.

$ gdb python
(no debugging symbols found)
(gdb) run -c "import pygame"
Starting program: /usr/bin/python -c "import pygame"
(no debugging symbols found)
[...]
(no debugging symbols found)

René Dudfield wrote:
On Sat, May 30, 2009 at 9:07 AM, Lorenz Quack <don@xxxxxxxxxxxxxxxxx>
wrote:

Hi,

I have a problem running pygame from the current svn sources. building
and
installing works fine but when I import pygame it crashes:

import pygame
Fatal Python error: (pygame parachute) Segmentation Fault Aborted

If I run it through pdb I get the following result:

pdb.run("import pygame")
<string>(1)<module>()->None
(Pdb) s [...]
/usr/lib64/python2.6/site-packages/pygame/__init__.py(214)<module>()
-> try: import pygame.time (Pdb) n
/usr/lib64/python2.6/site-packages/pygame/__init__.py(217)<module>()
-> try: import pygame.transform (Pdb) s Fatal Python error: (pygame
parachute) Segmentation Fault Aborted

it seems to crash right after the inittransform function. I have no idea
what's going on. Any help is appreciated.

some information about my system that may be relevant: $ uname -a Linux
horst 2.6.27-gentoo-r4 #9 SMP Sat Jan 10 19:56:02 CET 2009 x86_64
Intel(R)
Core(TM)2 CPU 6600 @ 2.40GHz GenuineIntel GNU/Linux

$ python Python 2.6.2 (r262:71600, May  1 2009, 15:24:32) [GCC 4.3.3] on
linux2

pygame revision: 2282


sincerely yours Lorenz


PS: the latest ebuild available in portage is for pygame-1.8.1 and works
fine.


Hi,

can get a stack trace with gdb?


$ gdb python (gdb) run -c "import pygame"

Then type 'where' when it crashes.

cheers,

Hi René,

here is the stacktrace. Not sure how useful it's going to be because I don't
know how to convince python to build with debug symbols. the --with-pydebug
configure option didn't do the trick.

$ gdb python
(no debugging symbols found)
(gdb) run -c "import pygame"
Starting program: /usr/bin/python -c "import pygame"
(no debugging symbols found)
[...]
(no debugging symbols found)

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f68590f36f0 (LWP 9638)]
0x00007f6858c3e3be in _PyImport_LoadDynamicModule () from
/usr/lib/libpython2.6.so.1.0
(gdb) where
#0  0x00007f6858c3e3be in _PyImport_LoadDynamicModule () from
/usr/lib/libpython2.6.so.1.0
#1  0x00007f6858c3bf8f in ?? () from /usr/lib/libpython2.6.so.1.0
#2  0x00007f6858c3c290 in ?? () from /usr/lib/libpython2.6.so.1.0
#3  0x00007f6858c3cb06 in ?? () from /usr/lib/libpython2.6.so.1.0
#4  0x00007f6858c3d1d5 in PyImport_ImportModuleLevel () from
/usr/lib/libpython2.6.so.1.0
#5  0x00007f6858c1b13d in ?? () from /usr/lib/libpython2.6.so.1.0
#6  0x00007f6858b64ead in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#7  0x00007f6858c1b4ba in PyEval_CallObjectWithKeywords () from
/usr/lib/libpython2.6.so.1.0
#8  0x00007f6858c20b8f in PyEval_EvalFrameEx () from
/usr/lib/libpython2.6.so.1.0
#9  0x00007f6858c27c81 in PyEval_EvalCodeEx () from
/usr/lib/libpython2.6.so.1.0
#10 0x00007f6858c27e32 in PyEval_EvalCode () from
/usr/lib/libpython2.6.so.1.0
#11 0x00007f6858c3a217 in PyImport_ExecCodeModuleEx () from
/usr/lib/libpython2.6.so.1.0
#12 0x00007f6858c3a52f in ?? () from /usr/lib/libpython2.6.so.1.0
#13 0x00007f6858c3b75d in ?? () from /usr/lib/libpython2.6.so.1.0
#14 0x00007f6858c3bf8f in ?? () from /usr/lib/libpython2.6.so.1.0
#15 0x00007f6858c3c290 in ?? () from /usr/lib/libpython2.6.so.1.0
#16 0x00007f6858c3caac in ?? () from /usr/lib/libpython2.6.so.1.0
#17 0x00007f6858c3d1d5 in PyImport_ImportModuleLevel () from
/usr/lib/libpython2.6.so.1.0
#18 0x00007f6858c1b13d in ?? () from /usr/lib/libpython2.6.so.1.0
#19 0x00007f6858b64ead in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#20 0x00007f6858c1b4ba in PyEval_CallObjectWithKeywords () from
/usr/lib/libpython2.6.so.1.0
#21 0x00007f6858c20b8f in PyEval_EvalFrameEx () from
/usr/lib/libpython2.6.so.1.0
#22 0x00007f6858c27c81 in PyEval_EvalCodeEx () from
/usr/lib/libpython2.6.so.1.0
#23 0x00007f6858c27e32 in PyEval_EvalCode () from
/usr/lib/libpython2.6.so.1.0
#24 0x00007f6858c47551 in ?? () from /usr/lib/libpython2.6.so.1.0
#25 0x00007f6858c4777c in PyRun_StringFlags () from
/usr/lib/libpython2.6.so.1.0
#26 0x00007f6858c48d60 in PyRun_SimpleStringFlags () from
/usr/lib/libpython2.6.so.1.0
#27 0x00007f6858c56f2a in Py_Main () from /usr/lib/libpython2.6.so.1.0
#28 0x00007f6857f405c6 in __libc_start_main () from /lib/libc.so.6
#29 0x0000000000400789 in _start ()


I once threw some "printf"s in "inittransfrom" function and it seemed to run
without problems to the end.

thanks for the help

//Lorenz