On Wed, Oct 30, 2012, Leslie S Satenstein" <[email protected]> wrote:
> ... > Some of the things I tried. > > If I create a one line shell script and all it has on one line alone is > desfed, I get a segmentation error. > > if I add the path as /home/leslie/bin/desfed all works OK. > > I am beginning to suspect a faulty gcc library entry. One function I am > using is a system function realpath(), which provides for the expansion of > path names such as "../../" etc. realpath does do malloc calls. My > program, without arguments goes directly to print the info stuff. It sounds like the size of argv[0] has an effect? argv[0]=="desfed" leads to a segfault, but not the fully-qualified path? Just for fun, try adjusting the 1-line shell script as: cd /home/leslie/bin/; ./desfed ... This tests the following case: no absolute path, but more characters than just the program name. Success implies that parsing the string argv[0] is a factor. Failure implies that providing the absolute path bypassed some buggy code that would parse argv[0]. Funny thing, though, about segfaults is that the cause of the problem can be so removed from where it is caught unless you are using a bounds checker. Does the program use any library loading code like dlopen()? Is sigaction() used to redefine the behaviour of SEGV? I mentioned Electric Fence (packaged as 'electric-fence' on Debian et al.). This might help find exactly where the segmentation fault *first* happens. As a quick and dirty test without recompiling your code, you can try: LD_PRELOAD=/usr/lib/libefence.so desfed I hope you solve this one and share the solution! Best regards, Stephen Benoit [email protected] _______________________________________________ mlug mailing list [email protected] https://listes.koumbit.net/cgi-bin/mailman/listinfo/mlug-listserv.mlug.ca
