Core File Not Being Generated in AIX | Unix Linux Forums | Programming

  Go Back    


Programming Post questions about C, C++, Java, SQL, and other programming languages here.

Core File Not Being Generated in AIX

Programming


Tags
linux, solaris

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 09-17-2003
S.P.Prasad S.P.Prasad is offline
Registered User
 
Join Date: Jan 2002
Last Activity: 19 June 2007, 12:39 PM EDT
Location: India
Posts: 111
Thanks: 0
Thanked 0 Times in 0 Posts
Core File Not Being Generated in AIX

I have created an executable using my login session in an AIX Version 5 Unix system. After to which I have change the file mode to set uid and rwsrwx--x and ownership to root:system by using the following Standard C Library functions.

chmod (name, S_ISUID|S_IRWXU|S_IRWXG|S_IXOTH|S_IROTH)
chown (name, 0, 1)

where name is the name of the executable whose permissions needs to be changed. When I execute my executable using my login session, the executable gives a segmentation fault but the core file is not being generated. When I saw the man page of core in the system it said that "A process with a saved user ID that differs from the real user ID does not produce a memory image. The same holds true for the group ID (GID) and effective
group ID" .

Is it possible that we can generate a core file through some technique which would aid me in tracing the cause of the segmentation fault.
Sponsored Links
    #2  
Old 09-17-2003
davidg's Avatar
davidg davidg is offline
Registered User
 
Join Date: Jul 2003
Last Activity: 23 February 2004, 11:09 AM EST
Location: Holland
Posts: 207
Thanks: 0
Thanked 1 Time in 1 Post
Hi,

You could truss or tusc the process when you start the program.
In Solaris/HP-ux it goes like :

truss /program/to/start/myprog

When debugging an already running program you can do :

truss -p <processid>


There is one note :

AIX 5.1 has 'truss'.

AIX 4.3.3 and earlier you can use the 'trace' command - but it's a pain because it's a system-level trace from which you can then extract the information for the process you cared about.


Regs David
Sponsored Links
    #3  
Old 09-17-2003
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon (Administrator Emeritus)
 
Join Date: Aug 2001
Last Activity: 20 November 2014, 5:33 PM EST
Location: Ashburn, Virginia
Posts: 9,930
Thanks: 64
Thanked 438 Times in 261 Posts
On AIX, isn't there a way to allow a process to write a core file? (Assuming it dies as the result of the default action of an appropiate signal)

It may be that the program drops core (or dies trying) once in a blue moon. You can't run truss hundreds or thousands of times.
    #4  
Old 09-18-2003
S.P.Prasad S.P.Prasad is offline
Registered User
 
Join Date: Jan 2002
Last Activity: 19 June 2007, 12:39 PM EDT
Location: India
Posts: 111
Thanks: 0
Thanked 0 Times in 0 Posts
As per Perderabo advice, I tried various options by using the 'smit' tool in AIX for "a proces to allow to creat a core file .." but was incapable to do so. I am unable to proceed further cause of this.

I would appreciate if someone could provide me accurate information or solution for the existing issue.
Sponsored Links
    #5  
Old 09-18-2003
csejl csejl is offline
Registered User
 
Join Date: Apr 2002
Last Activity: 1 May 2006, 12:35 PM EDT
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
I don't know too much about AIX but on Linux you have to play with 'ulimit' to set the size of core file allowed on your system. If the size of core file being generated is bigger than the limit specified it won't be created. Is there something like this on AIX?
Sponsored Links
    #6  
Old 09-19-2003
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon (Administrator Emeritus)
 
Join Date: Aug 2001
Last Activity: 20 November 2014, 5:33 PM EST
Location: Ashburn, Virginia
Posts: 9,930
Thanks: 64
Thanked 438 Times in 261 Posts
Dang! I saw AIX in the original post and I just moved on since I don't know AIX. But now I just read the post....

The program is suid to root! If you run it as an ordinary user, it will not drop core. This is a security feature in most versions of unix.

Remove the suid bit or sign on as root to run it.
Sponsored Links
    #7  
Old 09-23-2003
S.P.Prasad S.P.Prasad is offline
Registered User
 
Join Date: Jan 2002
Last Activity: 19 June 2007, 12:39 PM EDT
Location: India
Posts: 111
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks a lot Perderabo for all your help. By removing the set uid bit the process was able to generate the core dump image file.

Thanks for all your assistance.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Log file not getting generated ajincoep UNIX for Dummies Questions & Answers 2 10-07-2010 05:58 AM
Core file not getting generated!! ashokd001 Linux 3 03-05-2010 07:48 AM
core files not getting generated asalman.qazi Solaris 4 11-23-2009 10:10 AM
get the last generated log file ragha81 Shell Programming and Scripting 8 12-19-2006 11:02 AM
generated CSV file on AIX mpang_ Shell Programming and Scripting 0 09-06-2006 12:01 AM



All times are GMT -4. The time now is 03:49 PM.