Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Statically-linked binary SegFaults

Reply
Thread Tools

Statically-linked binary SegFaults

 
 
David Douthitt
Guest
Posts: n/a
 
      05-20-2004
I have a binary statically linked application that was compiled against
Red Hat 7.3 (presumably glibc 2.2.5). The application SegFaults when
run in a Red Hat Advanced Server environment - with glibc 2.3.2.

I had another binary (Samhain - to which I have source!) which had the
same problem and exhibited the same strace. After a recompile, the
newly compiled static binary worked fine.

Why is this? The first binary I don't have source for and need to make
my case - and I'm curious besides. My initial response is "it shouldn't
matter what glibc is, it's statically linked." This appears to be
wrong. Both binaries made open/close calls to ld-linux.so.2,
libnss_files.so.2, /lib/tls/libc.so.6, and others. The segfault occurs
right after ld-linux.so.2 is opened, read, and closed.

 
Reply With Quote
 
 
 
 
Malcolm
Guest
Posts: n/a
 
      05-20-2004

"David Douthitt" <(E-Mail Removed)> wrote in message
> I have a binary statically linked application that was compiled
> against Red Hat 7.3 (presumably glibc 2.2.5). The application
> SegFaults when run in a Red Hat Advanced Server environment -
> with glibc 2.3.2.
>

We can only deal with language issues here.
If a commercial library segfaults then the problem is probably in your own
code - most likely you are passing a bad pointer, though undefined behaviour
anywhere in your program can sometimes cause a fault in a seemingly
unrelated part.
Try to comment out code until you have a minimal program that exhibits the
problem. If this doesn't lead you to the answer then try posting here, but
as I say we can't deal with UNIX internals but only tell you whether your C
is or is not Ok.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
fixing random segfaults Skeleton Man Perl 0 06-04-2006 03:35 PM
axis cpp questions ...?wsdl segfaults Rob Yampolsky Java 0 05-03-2005 03:50 PM
Weird segfaults Naveen Parihar C++ 3 04-06-2004 06:18 AM
make test segfaults with "--enable-shared" on Python 2.3.3 Berthold Hoellmann Python 10 01-03-2004 10:31 PM
sprintf segfaults Robert Mens C Programming 3 10-25-2003 11:52 PM



Advertisments