The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Urgent: How can i get the missing records from one file out of two Shiv@jad UNIX for Advanced & Expert Users 1 10-10-2007 02:43 PM
File descriptors missing on startup xnightcrawl UNIX for Advanced & Expert Users 1 12-23-2005 12:58 PM
How to restrict Core file generation after scp (of SSH) command executed in UNIX nrsekhar UNIX for Advanced & Expert Users 4 09-07-2005 02:17 AM
core file missing part of call stack Lazzar AIX 1 07-29-2005 06:50 AM
Command missing thekid UNIX for Dummies Questions & Answers 6 02-14-2002 09:02 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-21-2008
kclittle kclittle is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 3
Missing core file using ssh + command

On a 2.6.21 kernel (MontaVista, x86_pentium4), I'm failing to see expected "core.pid" files dropped.

Consider this tiny program, "dumpcore.c":
#include <stdio.h>
#include <stdlib.h>
#include <sys/prctl.h>

int main( int argc, char ** argv )
{
printf("dumpable = %d\n", prctl( PR_GET_DUMPABLE, 0, 0, 0, 0 ) );
abort();
}
Build command is equally simple:
$ gcc -m32 -g -o dumpcore32 dumpcore.c
If I ssh into the MV system, login as root, and execute the program, I see a core file generated as expected:
$ ssh root@W.X.Y.Z
Last login: Fri Mar 21 22:04:03 2008 from W.X.Y.Q
root:/# /home/klittle/dumpcore32
dumpable = 1
Aborted (core dumped)
root:/# ls -la /disk/core
total 72
drwxrwxrwx 2 root root 4096 Mar 21 22:23 .
drwxrwxrwx 11 root root 4096 Mar 4 16:10 ..
-rw------- 1 root root 143360 Mar 21 22:23 dumpcore32.3314.1206138192.
But, if I "oneshot" the command by giving it on the ssh command line:
$ ssh -t -t root@W.X.Y.Z "/home/klittle/dumpcore32;ls -la /disk/core"

dumpable = 1
bash: line 1: 3344 Aborted /home/klittle/dumpcore32
total 8
drwxrwxrwx 2 root root 4096 Mar 21 22:24 .
drwxrwxrwx 11 root root 4096 Mar 4 16:10 ..
Connection to W.X.Y.Z closed.
The core file is nowhere to be found.

ulimit in both cases is "unlimited" (I double checked). Anyone have any insight here?

TIA,
-k

Last edited by kclittle; 03-22-2008 at 05:12 PM.. Reason: cut/paste errors
  #2 (permalink)  
Old 03-24-2008
sysgate's Avatar
sysgate sysgate is offline Forum Advisor  
Unix based
  
 

Join Date: Nov 2006
Location: Bulgaria
Posts: 1,318
Strange, the ssh syntax is correct, i.e. putting " ; " around two command will work, you can try simpler commands, such as "echo string > file" and then list the file, or "touch". I think the problem may be in the interactive invocation of the coredump binary.
  #3 (permalink)  
Old 03-24-2008
kclittle kclittle is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 3
Quote:
Originally Posted by sysgate View Post
Strange, the ssh syntax is correct, i.e. putting " ; " around two command will work, you can try simpler commands, such as "echo string > file" and then list the file, or "touch".
Oh, the syntax is fine -- the original problem was discovered in a case where there were five or six shell commands strung together with ';'. All the commands execute. The only issue is the missing core file that is expected when "dumpcore32" is invoked.
Quote:
I think the problem may be in the interactive invocation of the coredump binary.
Interactive? All there is is output to stdout. If I remove that one printf(), the same thing happens: core file if I run the command while in a shell on the target system, no core file if I use "ssh .... <command>".

Weird...
  #4 (permalink)  
Old 03-25-2008
ramen_noodle ramen_noodle is offline Forum Advisor  
Registered User
  
 

Join Date: Dec 2007
Location: Virginia, USA.
Posts: 251
What were the other 5 or 6 commands I wonder and what order of invocation?
fwiw I can't replicate your issue.
  #5 (permalink)  
Old 03-26-2008
kclittle kclittle is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 3
Quote:
Originally Posted by ramen_noodle View Post
What were the other 5 or 6 commands I wonder and what order of invocation?
fwiw I can't replicate your issue.
The other commands were a "cd" to a specific location, the setting of some environment variables, then invocation of a large in-development app with a primitive debug shell, one command of which caused a call to abort() (ABORT(3)). It's a moot issue, I think, since the very simple example above is showing the exact same (and strange!) behavior as regards a core file being generated or not.

-k
  #6 (permalink)  
Old 03-26-2008
ramen_noodle ramen_noodle is offline Forum Advisor  
Registered User
  
 

Join Date: Dec 2007
Location: Virginia, USA.
Posts: 251
All I would suggest is the output of ulimit -a (or the like) between commands and then an explicit dump of environment to log in any compiled binaries. The abort() call is interesting as :
Code:
If the abort() function causes program termination, all open streams are closed and flushed.
What that means in context is TBD.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:22 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0