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

off-topic traceback weirdness


Sorry for being off topic but I have run of ideas and people to ask.

Compiling the following code produces an executable that dumps core. The
traceback obtained with gdb contains no symbols.

rjschwei@triumph /noSymsTrace-> cat oneSOMain.C
#include <stdio.h>
 
#include <oneA.h>
 
int
main()
{
    fprintf(stderr, "This is main\n");
    A a(NULL);
    a.getNumber();
 
    return 1;
}
rjschwei@triumph /noSymsTrace-> cat oneA.h
class foo
{
 public:
    foo();
    int getNumber();
 private:
    int num;
};
 
class A
{
public:
    A(foo*);
    int getNumber();
private:
    foo* myFoo;
};
rjschwei@triumph /noSymsTrace-> cat oneA.C
#include <stdio.h>
#include <oneA.h>
 
A::A(foo* fooPtr) : myFoo(fooPtr)
{
}
 
int
A::getNumber()
{
    fprintf(stderr,"This is A\n");
    fprintf(stderr,"The numer is: %i\n", myFoo->getNumber());
 
    return 1;
}
 
foo::foo() : num(5)
{
}
 
int
foo::getNumber()
{
    return num;
}

-> g++ -c -fpic -I. oneA.C
-> g++ -L. -shared -fpic -o libOneA.so oneA.o
-> g++ -I. -L. -o stkLibsTOneSO oneSOMain.C -lOneA
-> setenv LD_LIBRARY_PATH `pwd`
rjschwei@triumph /noSymsTrace-> g++ -c -fpic -I. oneA.C
rjschwei@triumph /noSymsTrace-> g++ -L. -shared -fpic -o libOneA.so
oneA.o
rjschwei@triumph /noSymsTrace-> g++ -I. -L. -o stkLibsTOneSO oneSOMain.C
-lOneA
rjschwei@triumph /noSymsTrace-> ./stkLibsTOneSO
This is main
This is A
Segmentation fault (core dumped)
rjschwei@triumph /noSymsTrace-> gdb stkLibsTOneSO core
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i586-suse-linux"...
Core was generated by `./stkLibsTOneSO'.
Program terminated with signal 11, Segmentation fault.
#0  0x40015928 in ?? ()
(gdb) where
#0  0x40015928 in ?? ()
#1  0x400158e1 in ?? ()
#2  0x08048627 in main ()
#3  0x401238ae in ?? ()


I do not expect line numbers here, only function names. The executable
is not stripped.

rjschwei@triumph /noSymsTrace-> file stkLibsTOneSO
stkLibsTOneSO: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
dynamically linked (uses shared libs), not stripped

-> gcc --version
gcc (GCC) 3.3 20030226 (prerelease) (SuSE Linux)


rjschwei@triumph /noSymsTrace-> ldd stkLibsTOneSO
        libOneA.so => /a/rjschwei/work/noSymsTrace/libOneA.so
(0x40015000)
        libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x4002b000)
        libm.so.6 => /lib/libm.so.6 (0x400e3000)
        libgcc_s.so.1 => /a/rjschwei/local/lib/libgcc_s.so.1
(0x40105000)
        libc.so.6 => /lib/libc.so.6 (0x4010e000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

rjschwei@triumph /noSymsTrace-> /lib/libc.so.6 --version
GNU C Library stable release version 2.3.2, by Roland McGrath et al.

I am absolurely lost and have no clue whats going on here. This is on a
SuSE 8.2 system.

Any help is much appreciated. Obviously this situation is yeilds the box
pretty useless for development.

Thanks,
Robert

-- 
Robert Schweikert                   MAY THE SOURCE BE WITH YOU
rjschwei@cox.net                               LINUX



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