467,888 Members | 1,637 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,888 developers. It's quick & easy.

Statically-linked binary SegFaults

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.

Nov 14 '05 #1
  • viewed: 1567
Share:
1 Reply

"David Douthitt" <dd*******@cuna.coop> 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.

Nov 14 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Rick | last post: by
3 posts views Thread by joe martin | last post: by
12 posts views Thread by Samee Zahur | last post: by
1 post views Thread by Jason | last post: by
4 posts views Thread by puzzlecracker | last post: by
19 posts views Thread by DarelRex | last post: by
2 posts views Thread by fangee | last post: by
8 posts views Thread by Gilles Ganault | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.