Regards  
 Leslie
 Mr. Leslie Satenstein
50 years in Information Technology and going strong.
Yesterday was a good day, today is a better day,
and tomorrow will be even better.
 
mailto:[email protected]
alternative: [email protected] 
www.itbms.biz  www.eclipseguard.com
 

--- On Tue, 10/30/12, Jérôme Oufella <[email protected]> 
wrote:

From: Jérôme Oufella <[email protected]>
Subject: Re: [MLUG] How to stop programs generating segmentation error messages 
on exit
To: "Montreal Linux Users Group" <[email protected]>
Date: Tuesday, October 30, 2012, 5:47 PM

Hi Leslie,

Have the programs been compiled on the same environment as the one they are 
running ?

Jerome

Hi Guys,

My home dir is leslie

In responding to your questions, 

Yes, I am preparing software for 32 and 64 bit systems. I have the same source 
and makefile on each system for each sized compiler. The command  echo $PATH 
shows  /home/leslie/bin as being in it with appropriate ownerships and 
accesses  With Ubuntu   /home/leslie/bin first before the rest of the $PATH 
entries.  In Fedora  it is at the end.

my program is called desfed      and without arguments, it just issues an info 
message and exits with exit(EXIT_SUCCESS);
The exit(EXIT_SUCCESS) was calling an atexit() function. I temporarily removed
the atexit() call and the same problem remains.
The code I use calls malloc, but here again, it is for dynamically fixed size 
items. Any overrun with malloc would have burped with a memory dump. This is 
not the problem as the info message does not do malloc calls, It is just a 
series of a few printf commands.

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.

Googling failed to give me the answer. So, I will be exploring what is the 
reason using the qualified name /home/leslie/bin/desfed   works whereas  
desfed   alone does not.  Otherwise the code passes all my test scripts, of 
which there are many.

I thought perhaps you had this problem before, and knew what to do.
I am running in terminal mode, under gnome 3.6 and with Unity 12,04 under the 
LTS version (both 32 and 64 bit modules produce correct results).

_______________________________________________
mlug mailing list
[email protected]
https://listes.koumbit.net/cgi-bin/mailman/listinfo/mlug-listserv.mlug.ca
_______________________________________________
mlug mailing list
[email protected]
https://listes.koumbit.net/cgi-bin/mailman/listinfo/mlug-listserv.mlug.ca

Reply via email to