Segfault in cxa allocate exception
From FIFE development wiki
[edit] Introduction
This article is meant to become a database about the segfault in cxa allocate exception issue that shows up on some Linux system. We hope that tracking down the issue becomes easier as soon as we know what kind of systems are affected by it.
Contents |
[edit] Description of the problem
- FIFE segfaults on some Linux-based systems whenever an exception is thrown.
- It only happens if you build FIFE with OpenGL support. There it seems that linking against the OpenGL libraries is part of problem.
[edit] Template
[edit] Your nickname here
- OS: Distro (32 or 64bit?)
- uname: output of uname -srvmo
- Graphics card and used driver version:
- gcc version: output of gcc -dumpversion
- libstdc++6 version:
- Result: segmentation fault or
- Result: no segmentation fault
[edit] How to reproduce
- Get latest files from FIFE SVN trunk.
- Build via scons ext=1 && scons
- cd into clients/rio_de_hola
- Run: python run.py
- In case of segfault, you can create a backtrace via:
- gdb --args python run.py
- run
- bt
[edit] Testing with VESA drivers
- Edit xorg.conf: change "fglrx" to "vesa"
- Press: ctrl + alt + backspace to restart x
- cd into clients/rio_de_hola
- Run: python run.py
[edit] 32bit Linux distros
[edit] Anxs
- OS: Ubuntu 8.04 (Hardy Heron) 32bit
- uname: Linux 2.6.24-19-generic #1 SMP Fri Jul 11 23:41:49 UTC 2008 i686 GNU/Linux
- Graphics card and used driver version: ATI Radeon 9700 PRO & fglrx ati driver
- gcc version: 4.2.3
- libstdc++6 version: 4.2.3
- Result: segmentation fault
- With workaround applied: Result: no segmentation fault
[edit] Alexv
- OS: Ubuntu 7.04
- uname Linux 2.6.20-17-generic #2 SMP Thu Jul 10 00:05:43 UTC 2008 i686 GNU/Linux
- Graphics card and used driver version: ATI Technologies Inc Radeon Mobility m300, ATI driver 8.34.8 [Feb 20 2007]
- gcc version: 4.1.2
- libstdc++6 version: 4.1.2-0ubuntu4
- Result: no segmentation fault
[edit] AVRS
- OS: Debian GNU/Linux lenny/sid (testing)
- uname: Linux 2.6.25-2-686 #1 SMP Fri Jul 18 17:46:56 UTC 2008 i686 GNU/Linux
- Graphics card and used driver version: NV43 (GeForce 6600LE 128MiB) & nouveau with gallium3d built from git (2008072x)
- gcc version: 4.3.1 (Debian 4.3.1-2)
- libstdc++6 version: 4.3.1 (Debian 4.3.1-2)
- Result: no segmentation fault
[edit] chris
- OS: Debian unstable
- uname: Linux 2.6.25-2-686 #1 SMP Fri Jul 18 17:46:56 UTC 2008 i686 GNU/Linux
- Graphics card and used driver version: ATI Technologies Inc M22 [Mobility Radeon X300], radeon
- gcc version: 4.3.1
- libstdc++6 version: 4.3.1-8
- Result: no segmentation fault
[edit] Karel
- OS: Debian unstable 32bit
- uname: Linux 2.6.25-2-686 #1 SMP Tue May 27 15:38:35 UTC 2008 i686 GNU/Linux
- Graphics card and used driver version: ATI RADEON 9600 Series, OpenGL version string: 2.1.7537 Release (Radeon 9600XT)
- gcc version: 4.3.1
- libstdc++6 version: 4.3.1-9
- Result: segmentation fault
- Note: I used FIFE_2008.1_r2512, not svn version
[edit] MADBAD
- OS: Fedora 9
- uname: Linux 2.6.25.9-76.fc9.i686 #1 SMP Fri Jun 27 16:14:35 EDT 2008 i686 GNU/Linux
- Graphics card and used driver version: OpenGL vendor string: ATI Technologies Inc., OpenGL renderer string: RADEON X800 Series, OpenGL version string: 2.1.7769 Release, ATI driver (from livna) 8.512
- gcc version: 4.3.0
- libstdc++6 version: 4.3.0-8
- Result: segmentation fault
[edit] Phiker
- OS: ArchLinux
- uname: Linux hiroshima 2.6.25-ARCH #1 SMP PREEMPT Mon Jul 14 15:25:51 UTC 2008 i686 Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz GenuineIntel GNU/Linux
- Graphics card and used driver version: 04:00.0 VGA compatible controller: nVidia Corporation G71 [GeForce 7950 GT] (rev a1) 512MB, nvidia-binary treiber 173.14.09
- gcc version: 4.3.1 20080626 (prerelease) (GCC)
- Result: no segmentation fault
[edit] Schlumpf
- OS: Ubuntu 8.04 (Hardy Heron)
- uname: Linux 2.6.24-19-generic #1 SMP Fri Jul 11 23:41:49 UTC 2008 i686 GNU/Linux
- Graphics card and used driver version: ATI Mobility Radeon X1300 & GLX version: 1.2; OpenGL version: 2.1.7412 Release
- gcc version: 4.2.3
- libstdc++6 version: 4.2.3-2ubuntu7
- Result: segmentation fault
- With workaround applied: Result: no segmentation fault
[edit] Shadowdancer
- OS: Debian GNU/Linux etch/testing/unstable
- uname: Linux 2.6.21.6-lap #2 SMP Tue Jul 31 15:27:59 CEST 2007 i686 GNU/Linux
- Graphics card and used driver version: ATI Technologies Inc Radeon Mobility X1400, ATI driver 8.39.4 [Jul 20 2007]
- gcc version: 4.2.1
- libstdc++6 version: 4.2.1 (Debian 4.2.1-5)
- Result: no segmentation fault
[edit] Ukognos
- OS: Archlinux 32bit
- uname: Linux 2.6.25-ARCH #1 SMP PREEMPT Mon Jul 14 15:25:51 UTC 2008 i686 GNU/Linux
- Graphics card and used driver version: ATI Technologies Inc Radeon Mobility X1400: OpenGL version string: 1.4 (2.1.7659 Release)
- gcc version: 4.3.1
- libstdc++5 version: 3.3.6-2
- Result: segmentation fault
- Result: no segmentation fault Works with latest svn revision! :)
[edit] 64bit Linux distros
[edit] Aanderse
- OS: ubuntu 8.04
- uname: Linux gnu 2.6.24-19-generic #1 SMP Fri Jul 11 21:01:46 UTC 2008 x86_64 GNU/Linux
- Graphics card and used driver version: Nvidia Geforce 6600 & Nvidia binary driver
- gcc version: 4:4.2.3-1ubuntu6
- libstdc++6 version: 4.2.3-2ubuntu7
- Result: no segmentation fault
[edit] DemonX
- OS: Ubuntu 8.04 Mobile AMD Athlon(tm) 64 Processor 3400+
- uname: Linux 2.6.24-16-generic #1 SMP Thu Apr 10 12:47:45 UTC 2008 x86_64 GNU/Linux
- Graphics card and used driver version: RV350 [Mobility Radeon 9600 M10] driver fglrx 8.47.3
- gcc version: 4.2.3
- libstdc++6 version: 4.2.3-2ubuntu7
- Result: segmentation fault
[edit] DemonX
- OS: Ubuntu 8.04 Mobile AMD Athlon(tm) 64 Processor 3400+
- uname: Linux 2.6.24-16-generic #1 SMP Thu Apr 10 12:47:45 UTC 2008 x86_64 GNU/Linux
- Graphics card and used driver version: RV350 [Mobility Radeon 9600 M10] driver vesa 1:1.3.0-4ubuntu4
- gcc version: 4.2.3
- libstdc++6 version: 4.2.3-2ubuntu7
- Result: segmentation fault
[edit] LinuxDonald
- OS: Ubuntu 8.04.1 64 bit
- uname: Linux ubuntu 2.6.24-19-generic #1 SMP Fri Jul 11 23:41:49 UTC 2008 i686 GNU/Linux
- Graphics card and used driver version: ATI hd3200 (onboard) & ATI 8.7 Catalyst
- gcc version: 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
- libstdc++6 version: 4.2.3
- Result: segmentation fault
- With workaround applied: Result: no segmentation fault
[edit] nihathrael
- OS: Arch Linux x86_64
- Linux 2.6.25-ARCH #1 SMP PREEMPT Mon Jul 14 14:56:27 UTC 2008 x86_64 GNU/Linux
- Graphics card and used driver version: Ati Radeon X800XL, fglrx Version 8.6
- gcc version: 4.3.1
- libstdc++6: comes with gcc (6.0.10)
- Result: segmentation fault
- With workaround applied: Result: no segmentation fault
[edit] spq
- OS: gentoo amd64
- uname: Linux dhcppc2 2.6.24-gentoo-r8 #6 SMP Sun Jun 22 14:43:24 CEST 2008 x86_64 Intel(R) Core(TM)2 Duo CPU T5250 @ 1.50GHz GenuineIntel GNU/Linux
- Graphics card and used driver version: any Nvidia x11-drivers/nvidia-drivers 173.14.09
- gcc version: Gentoo 4.1.2 p1.1
- libstdc++6 version: comes with gcc
- Result: no segmentation fault
[edit] XenThraL
- OS: Ubuntu 8.04
- uname: Linux Prometheus 2.6.24-19-generic #1 SMP Fri Jul 11 21:01:46 UTC 2008 x86_64 GNU/Linux
- Graphics card and used driver version: NV41GL [Quadro FX 1400] - binary driver, 'nvidia-glx-new-envy' package
- gcc version: gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
- libstdc++6 version: 4.2.3
- Result: no segmentation fault
[edit] Zao
- OS: Ubuntu 8.04
- uname: Linux 2.6.24-19-server #1 SMP Fri Jul 11 21:50:43 UTF 2008 x86_64 GNU/Linux
- Graphics card and used driver version: NVidia 7300 GT (G73), 173.14.09
- gcc version: 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
- libstdc++6 version: 4.2.3-2ubuntu7
- Result: no segmentation fault
[edit] Temporary conclusions
- The segfault was reported for 32 & 64bit Linux distros that are used in combination with an ATI graphics card.
- The segfault occured on systems with Nvidia cards as well but upgrading from Debian etch to Debian lenny resolved it.
- Our current guess is that the issue is caused by the ATI Linux drivers. It seems to involve thread local storage.
- ATI cards seem to work if build is built with gcc 4.1.x. It seems to be broken with gcc 4.2.x or newer though.
[edit] Workaround #1
Explicitly linking against libstdc++ before linking against the opengl libraries resolves this issue! This has been successfully tested on a number of different Linux-based systems and can be confirmed as valid workaround therefore.
[edit] Workaround #2
In some very rare cases the workaround described above does not work. In these cases you can try to run the Python application in this way:
env LD_PRELOAD=libGL.so python script.py

