1

I have recently been getting into linux through the Ubuntu Windows app. I need to look at the core file generated by a program that seg faults for a ctf, however no core file is being generated. Example output:

...
Segmentation fault (core dumped)
root@TroysComputer:/mnt/c/Users/Troy Neubauer/Documents/CTF#

There is no core file in the current directory (which is the same directory that the program runs in) My hard and soft limits for all shells are unlimited and unlimited:

root@TroysComputer:/mnt/c/Users/Troy Neubauer/Documents/CTF# ulimit -S -c
unlimited
root@TroysComputer:/mnt/c/Users/Troy Neubauer/Documents/CTF# ulimit -H -c
unlimited
root@TroysComputer:/mnt/c/Users/Troy Neubauer/Documents/CTF#

And I set this through the .bashrc file so that it applies to all terminals.

$HOME/.bashrc:

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
#if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
#    . /etc/bash_completion
#fi

alias ctf='cd /mnt/c/Users/Troy\ Neubauer/Documents/CTF'
ctf
ulimit -H -c unlimited
ulimit -S -c unlimited

Using prlimit I inspect the settings while the process is running but before it seg faults:

root@TroysComputer:/mnt/c/Users/Troy Neubauer/Documents/CTF# prlimit --pid 549
RESOURCE   DESCRIPTION                             SOFT      HARD UNITS
AS         address space limit                unlimited unlimited bytes
CORE       max core file size                 unlimited unlimited bytes
...

And both the hard limit and the soft limit as unlimited. However if I use:

root@TroysComputer:/mnt/c/Users/Troy Neubauer/Documents/CTF# cat /proc/549/limits
Limit                     Soft Limit           Hard Limit           Units
...
Max core file size        0                    unlimited            bytes
...

The soft limit comes back as 0. Why is this different than what prlimit reports? Does the soft limit need to be non zero in order for a limit file to be generated?

I have "UsePAM yes" in the file /etc/ssh/sshd_config, /proc/sys/kernel/core_pattern doesn't exist and /var/lib/systemd/coredump/ is empty

root@TroysComputer:/mnt/c/Users/Troy Neubauer/Documents/CTF# ls /var/lib/systemd/coredump/
root@TroysComputer:/mnt/c/Users/Troy Neubauer/Documents/CTF#

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.