This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Program crashes when compiled with different optimization optionsas linked libraries


Hello, I have a problem with gcc 3.04, or to be more precise
[
Configured with: ./configure --prefix=/home/people/weber/pub
Thread model: single
gcc version 3.0.4
running on Linux stella.informatik.uni-kl.de 2.4.2-2 #11 Thu May 3 
11:39:29 CEST 2001 i686
unknown
 ]
I have a project that links several libraries (qt-2.3.2 from Trolltech 
[www.trolltech.com] , SoQt form Coin3D [www.coin3d.org] and OpenInventor 
from SGI [oss.sgi.com]). These libraries are compiled by default with an 
-O2 setting [if they are installed by ./configure;make; make install]. 
If they are linked against a simple program [for example the "standard" 
SoQtExaminerViewer demonstration program included in the SoQt 
documentation] the resulting program crashes with a segmentation 
 violation during setup (part of its window appears on the screen and 
then the program crashes). If the same program is compiled using the 
same optimizations as the libraries, i.e. if it is also compiled with an 
-O2 setting, everythings works perfetct. I am aware that this is very 
little to go on and would provide more information if you told me what 
you need, since this bug does not fit into the categories that you list 
on your bug report page. It is also problematic since it involves a 
three larger libraries, so it is difficult to come up with a simple 
short example that reproduces it.

Thank you for any help
   Gunther H Weber

PS: I initially reported this to the people at Coin3D thinking it was 
bug of their library since the problem suddenly occured with a new 
version of their library. Perhaps they can provide more help with that 
problem. Attached is the message I received from them

---- Begin message from Marius Kintel <kintel@sim.no> ----

On Thu, 14 Feb 2002, Gunther H Weber wrote:

>> 
>> [crashes in qApp-a>exec() with SoQt/Qt-2.3.2/SGI OIV]
>>
>
I've experienced the exact same thing (but with gcc-3.0.1), but haven't
tried to investigate futher.

A workaround in my case was to ensure that all components are compiled
with the same optimization settings. That probably means you should add a
-O2 to the compilation flags for the test app in question.

I think we might be looking at a bug in some component of gcc3 as it works
fine with gcc2 (both the 2.95.x and the 2.96 variants).

I also guess that some recent additions/restructuring of SoQt included
some code that trigger this bug. 
Do you know what snapshot of SoQt you succeded to build against? That
might ease the job of pinpointing this problem and notify the guilty
ones/create a workaround.

 -Marius
---- End message ----



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]