Find the answer to your Linux question:
Results 1 to 7 of 7
Hi all, I have come across a question. I have developed an application written in C, Linux well tested.. and stripped off all the symbols for final deployment. When I'm ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2009
    Posts
    85

    Red face How to debug the deployed software.


    Hi all, I have come across a question.
    I have developed an application written in C, Linux well tested.. and stripped off all the symbols for final deployment.
    When I'm testing the stripped off version of the application in the field.. here the application has got crashed. Now how to debug the application.
    Can anyone tell me how to answer this question..

    thanks in advance

  2. #2
    Linux Newbie
    Join Date
    Mar 2010
    Posts
    152
    Quote Originally Posted by maheshgupta024 View Post
    When I'm testing the stripped off version of the application in the field.. here the application has got crashed.
    Well, that depends on exactly how it crashes. Does it spit out any error messages before it dies?

    Otherwise, the problem is probably due to a difference between your development machine and whatever "in the field" machine it's running on, in which case there's no problem running an unstripped version with debugging enabled and debugging it conventionally.

  3. #3
    Just Joined!
    Join Date
    Oct 2009
    Posts
    85
    no.. this is not a siutation happend.. I have come across in of the interview.. I couldnt answer this question.. I have asked so many but no one has given answer..

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,755
    They are looking for experience in practical software development. FWIW, this sort of problem occurs because when stripping the symbols from a program, it also removes "wiggle room" from arrrays and such so that overrunning an array boundard is more likely to result in corruption of critical data. This is especially true of binaries that were compiled as "debuggable".

    As for the question of "how to debug a stripped executable", that is more complex. You need to have the memory map of the application so you can translate relative addresses to function pointers. IE, if you run the stripped version of the program in gdb and it aborts, you cannot get a list of function names from the stack trace, but you will get a list of function addresses. So, if you have compiled the application to also generate a map file, then you can determine in which function the application failed.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  6. #5
    Just Joined!
    Join Date
    Oct 2009
    Posts
    85
    Thanks for the reply rubberman.. I think I understand ...

  7. #6
    Just Joined!
    Join Date
    Oct 2009
    Posts
    85
    Can you please tell me, when I compile the source as an unstripped version, where does the symbols are stored. Is it in Code section or something else.
    If they are stored in the final image, then does the function pointer address will not change in the stripped and unstripped versions ?

  8. #7
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,755
    Stripping only removes the symbols. I'm not exactly sure where they are "stored". The names are probably in read-only static text memory. Whether or not that is in the code segment is something I can't tell you. String constants may or may not be stored in read-only memory, and that depends upon the compiler and options you may pass to it when compiling your source code, so in these cases, what is the default is not necessarily what is actually the case in any particular instance.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •