Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #245724

Re: getting a regular user to dump core when a program crashes

From Greg Wooledge <greg@wooledge.org>
Newsgroups linux.debian.user
Subject Re: getting a regular user to dump core when a program crashes
Date 2022-02-28 17:40 +0100
Message-ID <DVRe1-4XeW-7@gated-at.bofh.it> (permalink)
References <DVPOV-4WxB-1@gated-at.bofh.it> <DVQhX-4WGC-1@gated-at.bofh.it> <DVR4l-4XbE-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Feb 28, 2022 at 11:25:13AM -0500, songbird wrote:
> >> me@ant(14)~$ ulimit -a
> >> real-time non-blocking time  (microseconds, -R) unlimited
> >> core file size              (blocks, -c) unlimited
> 
>   i had accomplished the ulimit change already, but the lack of 
> the proper permission on the output directory meant that a core
> file would not be generated.

What is an "output directory"?  Core files are dumped in the process's
*working* directory, which is "where you are when you run it".  Quite
often that will be $HOME, unless you opened a shell and changed
directory somewhere else, before running a command.  Or unless the
process is invoked by a dot-desktop file that specifies a special
working directory.  Or a systemd unit file is written which specifies
a WorkingDirectory= in it.  And so on.

unicorn:~$ cat coredump.c
main() {
    char *ptr = 0;
    *ptr = 'x';
    return 0;
}
unicorn:~$ gcc -o coredump coredump.c
coredump.c:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    1 | main() {
      | ^~~~
unicorn:~$ cd tmp
unicorn:~/tmp$ ../coredump >/var/tmp/outputfile
Segmentation fault (core dumped)
unicorn:~/tmp$ ls -ld core
-rw------- 1 greg greg 249856 Feb 28 11:33 core

Here, the process's binary file lives in /home/greg, its working directory
is /home/greg/tmp, and its stdout has been redirected to a file in
/var/tmp.  The core file goes in /home/greg/tmp, the working directory.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

getting a regular user to dump core when a program crashes songbird <songbird@anthive.com> - 2022-02-28 16:10 +0100
  Re: getting a regular user to dump core when a program crashes Greg Wooledge <greg@wooledge.org> - 2022-02-28 16:40 +0100
    Re: getting a regular user to dump core when a program crashes songbird <songbird@anthive.com> - 2022-02-28 17:30 +0100
      Re: getting a regular user to dump core when a program crashes Greg Wooledge <greg@wooledge.org> - 2022-02-28 17:40 +0100
        Re: getting a regular user to dump core when a program crashes The Wanderer <wanderer@fastmail.fm> - 2022-02-28 17:50 +0100
          Re: getting a regular user to dump core when a program crashes songbird <songbird@anthive.com> - 2022-02-28 18:00 +0100
          Re: getting a regular user to dump core when a program crashes Reco <recoverym4n@enotuniq.net> - 2022-02-28 18:20 +0100
          Re: getting a regular user to dump core when a program crashes Greg Wooledge <greg@wooledge.org> - 2022-02-28 18:30 +0100
            Re: getting a regular user to dump core when a program crashes songbird <songbird@anthive.com> - 2022-02-28 19:50 +0100

csiph-web