This is the mail archive of the gcc-prs@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]

c++/2009: g++ (-lGLU)



>Number:         2009
>Category:       c++
>Synopsis:       g++ (-lGLU)
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 16 10:06:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Randall Hopper
>Release:        2.95.3 20010112 (test2)
>Organization:
>Environment:
SGI IRIX 6.5, up-to-date patches
>Description:
The following simple example demonstrates the problem.
Basically, anytime you link an application compiled with
g++ with the OpenGL library GLU (very frequently used), 
your application will core dump before it ever hits main()
-- even if it doesn't use OpenGL at all!  The violation 
occurs down in the bowels of the iostream stuff.  See below
for an example.

I first saw this on 2.95.1, but repeated it on 2.95.3.test2
to verify it was still a problem before reporting it.  I 
found references to this problem in Usenet as well:

http://groups.google.com/groups?q=ios::init&hl=en&lr=&safe=off&rnum=3&seld=934608678&ic=1
http://groups.google.com/groups?q=ios::init&hl=en&lr=&safe=off&rnum=7&seld=985458986&ic=1

If you need any additional information or need some
additional tests run, let me know.  The native IRIX C++ 
compiler doesn't support ANSI casts, so g++ is
my preferred choice if we can get around this problem.

----------------------------------------
ralph : ~ > cat tst.C
#include <iostream.h>

main()
{
  cout << "Hello world\n";
}
----------------------------------------
ralph : ~ > g++ -v
Reading specs from /home/rhh/software/gcc-2.95.3.test/lib/gcc-lib/mips-sgi-irix6.5/2.95.3/specs
gcc version 2.95.3 20010112 (prerelease)
----------------------------------------
ralph : ~ > g++ -o tst tst.C
ralph : ~ > ./tst
Hello world
----------------------------------------
ralph : ~ > g++ -o tst tst.C -lGLU
ld32: WARNING 84 : /usr/lib32/libGLU.so is not used for resolving any symbol.
ralph : ~ > ./tst
Segmentation fault (core dumped)
----------------------------------------
ralph : ~ > rm core
ralph : ~ > dbx ./tst
dbx version 7.3 60152_Nov12 patchSG0003765 Nov 12 1999 02:43:21
Executable /home/rhh/./tst
(dbx) run
Process 3695626 (tst) started
Process 3695626 (tst) stopped on signal SIGSEGV: Segmentation violation (default) at [ios::init(streambuf*):35 ,0xae324f0]
         Source (of /comp88/mtibuild/v7312m/workarea/v7.3.1.2m/libC/iostreams/stream.cxx) not available for Process 3695626
(dbx) where
>  0 ios::init(streambuf*)(0x0, 0x10015098, 0x10015098, 0x2, 0x2, 0x0, 0xfbde050, 0x1) ["/comp88/mtibuild/v7312m/workarea/v7.3.1.2m/libC/iostreams/stream.cxx":35, 0xae324f0]
   1 ostream_withassign::operator=(streambuf*)(0x5ffe47f0, 0x10015098, 0x10015098, 0x2, 0x2, 0x0, 0xfbde050, 0x1) ["/comp88/mtibuild/v7312m/workarea/v7.3.1.2m/libC/iostreams/stream.cxx":290, 0xae339b8]
   2 Iostream_init::Iostream_init(void)(0x1, 0x10015098, 0x10015098, 0x2, 0x2, 0x0, 0xfbde050, 0x1) ["/comp88/mtibuild/v7312m/workarea/v7.3.1.2m/libC/iostreams/cstreams.cxx":63, 0xae25b20]
   3 ::_main(0x0, 0x10015098, 0x10015098, 0x2, 0x2, 0x0, 0xfbde050, 0x1) ["/comp88/mtibuild/v7312m/workarea/v7.3.1.2m/libC/lang_support/c++init.cxx":77, 0xae1f944]
   4 <Unknown>() [< unknown >, 0xae61b28]
(dbx) quit
----------------------------------------
>How-To-Repeat:
Compile "any" C++ application with g++ (>= 2.95.1 at least),
link it with -lGLU, and it core dumps on startup before 
it ever gets to main().
>Fix:
(No fix or workaround known.)
>Release-Note:
>Audit-Trail:
>Unformatted:


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