Missing core file using ssh + command


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Missing core file using ssh + command
# 1  
Old 03-21-2008
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 06:12 PM.. Reason: cut/paste errors
# 2  
Old 03-24-2008
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  
Old 03-24-2008
Quote:
Originally Posted by sysgate
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  
Old 03-25-2008
What were the other 5 or 6 commands I wonder and what order of invocation?
fwiw I can't replicate your issue.
# 5  
Old 03-26-2008
Quote:
Originally Posted by ramen_noodle
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  
Old 03-26-2008
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

XFCE Desktop - trash, cannot execute file, command prompt here missing.

Hi there, I am using the xfce4 is already the newest version (4.12.5). thunar is already the newest version (1.8.4-1). The distribution is Linux kali 4.19.0-kali1-amd64 #1 SMP Debian 4.19.13-1kali1 (2019-01-03) x86_64 GNU/Linux However, the problem is: When I when I click on any program to... (2 Replies)
Discussion started by: alvinoo
2 Replies

2. Shell Programming and Scripting

Ssh remote command doesn't work from script file

I have 10 application servers in a distributed architecture generating their own application logs. Each server has application utility to continuously tail the log. for example following command follows tails and follows new logfiles as they are generated server1$ logutility logtype When I run... (8 Replies)
Discussion started by: indianya
8 Replies

3. UNIX for Dummies Questions & Answers

Output of ssh command from localhost - direct to local file.

Hi, i'm trying to gather details from remote hosts and want them to be written to my local linux machine from where i'm using SSH. My command looks some thing like this ssh -q remotehost 'bash -s' <command.txt where command.txt is a file in my local machine containing ps -ef |grep httpd |... (1 Reply)
Discussion started by: poga
1 Replies

4. Solaris

Solaris 10 2008 Core(ssh pkg)

hello... i'm new in solaris 10. i have installed solaris 10 core. but i need pkg ssh. anybody can help me how to install ssh. and where i can find this ssh pkg? hope somebody can give me solution... >.< searching but not found it >.<:( (6 Replies)
Discussion started by: yanto85
6 Replies

5. UNIX for Dummies Questions & Answers

File Missing When Grabbing Files from SFTP Server using SCP Command

Hi, I have this problem where sometimes my files would go missing when I schedule my crontab to run the SCP command to get file from the SFTP server. My crontab will run the scripts at an interval of 3 minutes (between the two scripts) The following is the setting in my crontab. ... (1 Reply)
Discussion started by: gingervitus
1 Replies

6. AIX

#emgr -l command output missing

Hi, I have recently started to patch all my AIX boxes. I have applied almost 28 interim fixes on those. i have the snaps of emgr -l out put showing all tha patch details and date on which those we applied. but after reboot, emgr -l comannd says "There is no efix data on this... (0 Replies)
Discussion started by: sandeepbodkhe
0 Replies

7. UNIX for Advanced & Expert Users

missing Path(in UNIX) when i launch a job on to unix machine using windows SSh

hi i want run an unix application from a windows program/application.i am using SSH(command line version)to log on to a unix machine from windows. the application has to read a configuration file inorder to run. the configuration file .CFG is in bin in my home directory. but the application... (1 Reply)
Discussion started by: megastar
1 Replies

8. UNIX for Advanced & Expert Users

How to restrict Core file generation after scp (of SSH) command executed in UNIX

Hi, I am getting core file in local machine after trasfer files to other machine by using scp (secure copy) of SSH in UNIX. Could any one please tell me how to restrict core file generatation by using scp command. (4 Replies)
Discussion started by: nrsekhar
4 Replies

9. AIX

core file missing part of call stack

It seems that since the Upgrade from aix 4.3 to 5.2 the corefiles are somehow truncated. I tried the debuggers ddd, xldb and gdb everytime the same results. i found this on the IBM site: IBM Information center: If some entries appear in the Call Stack monitor but others are missing, this... (1 Reply)
Discussion started by: Lazzar
1 Replies

10. UNIX for Dummies Questions & Answers

Command missing

I am wondering if anyone knows a place where a person can download a command for the HP-UX 9.04 OS. The machine is just sitting around, and is not being used due to the fact that it is not Y2K compliant (or so the rumor goes). The command that does not exist is "reboot", which normally resides... (6 Replies)
Discussion started by: thekid
6 Replies
Login or Register to Ask a Question