Ticket #392 (new defect)

Opened 1 year ago

Last modified 1 year ago

segfault when choosing -O3 Compiler Flag

Reported by: srm@… Owned by: jorrit
Priority: major Milestone:
Component: general Version:
Keywords: Cc:

Description

Hi,

configure chooses -O3 as optimization level by default. This leads to the phenomenom that all programs (pysimp / walktest / etc.) will segfault when i try to start them (please see below for gdb-backtrace). When i force configure to use -O2 as optimization level, everything is fine. This is tested using bindingsplit branch and reproducable on 2.6.22-gentoo-r6 ppc 7447A, altivec supported PowerBook5,6 GNU/Linux using gcc (GCC) 4.1.2 (Gentoo 4.1.2 p1.0.1)

here comes the gdb 6.6 output for walktest

(gdb) r
Starting program: /home/srm/dev/source/crystalspace/bindingsplit/walktest 
[Thread debugging using libthread_db enabled]
[New Thread 805433200 (LWP 15349)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 805433200 (LWP 15349)]
CS::TiDocumentNodeChildren::Identify (this=0x3003f240, document=<value optimized out>, 
    p=0x1017e8ba "<scf>\n    <classes>\n      <class>\n        <name>crystalspace.engine.3d</name>\n        <implementation>csEngine</implementation>\n        <description>Crystal Space 3D Engine</description>\n        <requ"...) at ./include/csutil/array.h:386
386         { c = (in_capacity > 0 ? in_capacity : 0); }

now the backtrace

(gdb) backtrace
#0  CS::TiDocumentNodeChildren::Identify (this=0x3003f240, document=<value optimized out>, 
    p=0x1017e8ba "<scf>\n    <classes>\n      <class>\n        <name>crystalspace.engine.3d</name>\n        <implementation>csEngine</implementation>\n        <description>Crystal Space 3D Engine</description>\n        <requ"...) at ./include/csutil/array.h:386
#1  0x1012f05c in CS::TiXmlElement::ReadValue (this=0x3003f240, document=0x30032150, p=0xfd54114 "\002") at libs/csutil/tinypars.cpp:472
#2  0x1012e084 in CS::TiXmlElement::Parse (this=0x3003f240, document=0x1014dbd5, p=<value optimized out>) at libs/csutil/tinypars.cpp:362
#3  0x1012f5f8 in CS::TiDocument::Parse (this=0x30032150, 
    p=0x1017e8af "<plugin>\n  <scf>\n    <classes>\n      <class>\n        <name>crystalspace.engine.3d</name>\n        <implementation>csEngine</implementation>\n        <description>Crystal Space 3D Engine</description>\n  "...) at libs/csutil/tinypars.cpp:291
#4  0x10119b68 in csTinyXmlDocument::Parse (this=0x30032120, buf=0x30032150 "", collapse=true) at libs/csutil/xmltiny.cpp:598
#5  0x100ef920 in csGetPluginMetadata (fullPath=0x1 <Address 0x1 out of bounds>, metadata=@0x7ffe8ae4) at libs/csutil/unix/embedplugins.cpp:71
#6  0x100d2908 in csSCF::ScanPluginsInt (this=0x7ffe8ad8, pluginPaths=0x1013cfc8, context=0x0) at libs/csutil/scf.cpp:646
#7  0x100d74f4 in scfInitialize (argc=<value optimized out>, argv=0x3002f200) at libs/csutil/scf.cpp:696
#8  0x10078270 in csInitializer::CreateEnvironment (argc=1, argv=0x7ffe91f4) at libs/cstool/initapp.cpp:137
#9  0x100154a0 in WalkTest::Initialize (this=0x1017e008, argc=4, argv=0x30032150, 
    iConfigName=0x1017e8ba "<scf>\n    <classes>\n      <class>\n        <name>crystalspace.engine.3d</name>\n        <implementation>csEngine</implementation>\n        <description>Crystal Space 3D Engine</description>\n        <requ"...) at apps/walktest/walktest.cpp:908
#10 0x10017c3c in main (argc=269802453, argv=0x7ffe91f4) at apps/walktest/walktest.cpp:1368
#11 0x0fc547c0 in ?? () from /lib/libc.so.6
#12 0x0fc549ec in __libc_start_main () from /lib/libc.so.6
#13 0x00000000 in ?? ()

now the same for pysimp:

(gdb) r
Starting program: /home/srm/dev/source/crystalspace/bindingsplit/pysimp 
[Thread debugging using libthread_db enabled]
[New Thread 805433200 (LWP 15457)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 805433200 (LWP 15457)]
CS::TiDocumentNodeChildren::Identify (this=0x3003f240, document=<value optimized out>, 
    p=0x1011f52a "<scf>\n    <classes>\n      <class>\n        <name>crystalspace.engine.3d</name>\n        <implementation>csEngine</implementation>\n        <description>Crystal Space 3D Engine</description>\n        <requ"...) at ./include/csutil/array.h:386
386         { c = (in_capacity > 0 ? in_capacity : 0); }

the backtrace:

(gdb) backtrace
#0  CS::TiDocumentNodeChildren::Identify (this=0x3003f240, document=<value optimized out>, 
    p=0x1011f52a "<scf>\n    <classes>\n      <class>\n        <name>crystalspace.engine.3d</name>\n        <implementation>csEngine</implementation>\n        <description>Crystal Space 3D Engine</description>\n        <requ"...) at ./include/csutil/array.h:386
#1  0x100cded4 in CS::TiXmlElement::ReadValue (this=0x3003f240, document=0x30032178, p=0xfd54114 "\002") at libs/csutil/tinypars.cpp:472
#2  0x100ccefc in CS::TiXmlElement::Parse (this=0x3003f240, document=0x100f2cfd, p=<value optimized out>) at libs/csutil/tinypars.cpp:362
#3  0x100ce470 in CS::TiDocument::Parse (this=0x30032178, 
    p=0x1011f51f "<plugin>\n  <scf>\n    <classes>\n      <class>\n        <name>crystalspace.engine.3d</name>\n        <implementation>csEngine</implementation>\n        <description>Crystal Space 3D Engine</description>\n  "...) at libs/csutil/tinypars.cpp:291
#4  0x100b89e0 in csTinyXmlDocument::Parse (this=0x30032148, buf=0x30032178 "", collapse=true) at libs/csutil/xmltiny.cpp:598
#5  0x100a0c68 in csGetPluginMetadata (fullPath=0x1 <Address 0x1 out of bounds>, metadata=@0x7f831d84) at libs/csutil/unix/embedplugins.cpp:71
#6  0x10080c24 in csSCF::ScanPluginsInt (this=0x7f831d78, pluginPaths=0x100e8070, context=0x0) at libs/csutil/scf.cpp:646
#7  0x10085810 in scfInitialize (argc=<value optimized out>, argv=0x3002f228) at libs/csutil/scf.cpp:696
#8  0x1003b818 in csInitializer::CreateEnvironment (argc=1, argv=0x7f8321f4) at libs/cstool/initapp.cpp:137
#9  0x10042834 in csApplicationFramework::Main (this=0x7f831ed8, argc=1, argv=0x30032178) at libs/cstool/csapplicationframework.cpp:96
#10 0x10002688 in main (argc=1, argv=0x7f8321f4) at ./include/cstool/csapplicationframework.h:441
#11 0x0fc547c0 in ?? () from /lib/libc.so.6
#12 0x0fc549ec in __libc_start_main () from /lib/libc.so.6
#13 0x00000000 in ?? ()

Attachments

Change History

Changed 1 year ago by srm@…

sorry,maybe i should really get an account. just wanted to pass my mail adress as initial poster.

*cheers*

Changed 1 year ago by sunshine

  • reporter changed from anonymous to srm@schokokeks.org

Add/Change #392 (segfault when choosing -O3 Compiler Flag)

Author



Action
as new
 
Note: See TracTickets for help on using tickets.