Statically-linked binary SegFaults

Discussion in 'C Programming' started by David Douthitt, May 20, 2004.

  1. 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.
    David Douthitt, May 20, 2004
    #1
    1. Advertising

  2. David Douthitt

    Malcolm Guest

    "David Douthitt" <> 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.
    Malcolm, May 20, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ralph Butler

    statically linked python

    Ralph Butler, Jun 17, 2006, in forum: Python
    Replies:
    3
    Views:
    502
    Serge Orlov
    Jun 20, 2006
  2. Replies:
    2
    Views:
    1,168
  3. pratap
    Replies:
    20
    Views:
    755
    Flash Gordon
    Mar 7, 2007
  4. samsappleton
    Replies:
    0
    Views:
    310
    samsappleton
    Mar 11, 2008
  5. Andy Elvey

    Linked-list problem - compiles but segfaults

    Andy Elvey, Jul 5, 2011, in forum: C Programming
    Replies:
    13
    Views:
    672
    Shao Miller
    Jul 6, 2011
Loading...

Share This Page