unable to coredump - embedded linux - embedded-linux

i did ulimit -c unlimited / some number
proc... core_pattern is core
and my rootfs and the apps are all debugversion [ not the kernel though]
any idea why iam unable to get coredumps on kill -SIGABRT/SEGV pid
thanks
Furion.

Can you try to create the core using gdb as follows?
$ gdb --pid=1234
(gdb) gcore
Saved corefile core.1234
(gdb) detatch
gdb doesn't care about the settings.
If you are wondering what is detach.
Since you have attached the process to gdb, detatch it using gdb control using detatch command

Check to see if core dumps are enabled for your kernel:
CONFIG_ELF_CORE=y
Here's some documentation of the configuration item.

Ensure the current directory (getcwd()) of the process is writable by the process and contains enough space to hold the core dump file.

Maybe the application in question itself changes the core dump size ?

i used prctl in the program to explicitly enable core dump (it sounds like a script is disabling coredumps ) and alls good now

Related

Why I need to set console to ttyS0, when booting linux on qemu-system-x86_64

I want to run linux on qemu to test some system design, I use default config for x86_64, I found that I must append "console=ttyS0" to boot arguments so that I can get kernel message, without the ttyS0 I can't get any output.
So I want to check qemu's device tree, another strange thing is that I found there is no device-tree directory under /sys/fireware.
I want to check following question:
why we need "console=ttyS0" to get output ?
doesn't x86 use device-tree during booting ?

Custom built kernel produces non-bootable initramfs on Centos 7

I've been building my own kernel (4.19.37) and have no issues during build (make) or install (make install_modules + make install). Everything seems to go fine until I execute grub2-mkconfig -o /boot/grub2/grub.cfg. When executing this command, grub finds both my existing and new vmlinuz-* kernels in /boot/ as well as their corresponding initramfs-*.img. However, at that point the system hangs indefinitely (> several hours). Ctrl+C does not seem to stop it and I must reboot. I have looked into this issue and all I have found that could be a problem is the probing of removal disks for bootable OS's, which I have eliminated by both removing them and by adding GRUB_DISABLE_OS_PROBER=true to /etc/default/grub per this SE post. Neither has helped.
Upon reboot, I end up at the grub> command line, presumably because the grub2-mkconfig never finished and corrupted the grub configuration file. Here I can load both the old and new kernel without any issue, as well as initramfs, but when I execute boot I get a kernel panic:
end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
Naturally, it is my assumption that there is something wrong with my initramfs-4.19.37.img that was created by my build process. As an experiment, I tested if I could load the new kernel, but use the old initramfs (4.19.10), and indeed it does boot into emergency mode. I however cannot do the opposite, old kernel with new initramfs. So something is fishy with my new initramfs image.
Getting smarter, my last experiment was mounting the old and new initramfs image with mount. They both mount successfully with no errors, and seem to have identical file structures. I have also compared both my new and old .config files for the kernel builds, and the differences are trivial.
A few other notes/observations:
In the image above, you can see List of all partions: produces nothing, so I am wondering if there is an issue with the file system type? My hard drive is xfs, what is the file system for the initramfs? CPIO?
At the grub> command line, ls / produces what I expect to see in /boot. It contains all my vmlinuz-* and initramfs-*.img files
My file system is xfs
I've tried various other kernel versions with same results
I have twice had successful builds and installs, once was the existing kernel (4.19.10), it was an upgrade, and a second time with the same kernel with a low-latency pre-emption model. I can't for the life of me figure out what I did differently then.
So the final question(s) are - What's wrong with the initramfs form these builds? What else can I do to validate it's integrity? Are there any .config changes I should make when building the kernel for the xfs file system?
Disclaimer: So this actually an continuation of [this question][3], but I've simplified the problem a bit. Some background info there might be relevant.
After updating the kernel using yum update, reboot the VM using the new kernel you get a kernel panic error.
Following commands will fix this problem.
yum remove kernel
yum update

Remote debuging with gdbserver for application with X (qt) environment

I have been trying to remotely debug an application which can only be run on a specific server because of hardware limitations. To normally run the program I would login to an ssh shell with X.11 forwarding enabled (-X option of ssh) and its QT interface will show up.
I have been trying to achieve the same but with no success while debugging via gdb with the gdbserver and the integrated gdb client of Eclipse IDE.
Is there a way to achieve this?
I have already tried to copy the settings of the system variables DISPLAY and XDG_RUNTIME_DIR of an ssh -X session (the later being empty) but with no success. Searching for it gives no relatable results (or I may need a hint on what to search).
It's not the cleanest solution, but you can manually set the DISPLAY variable in /etc/environment. Variables set in /etc/environment are available to the entire system. You'll need to reboot the server before gdb will see it.
See: https://help.ubuntu.com/community/EnvironmentVariables#A.2Fetc.2Fenvironment
Here's a one-liner to append your current DISPLAY variable
echo "DISPLAY=$DISPLAY" >> /etc/environment

custom Linux kernel build failure in vmware workstation

While trying to compile/build and boot custom kernel inside vmware workstation, while booting new kernel, it fails and falls to shell with error "failed to find disk by uuid".
I tried this with both ubuntu and centos.
Things I tried but didn't help
check mapping by uuid in boot entry and existence in directory.
initramfs-update
replaced root=uuid=<> with /dev/disk/sda3
is it issue with vmware workstation?
how can it be rectified..??
I had a similar fault with my own attempts to bootstrap Fedora 22 onto a blank partition using a Centos install on another partition. I never did solve it completely, but I did find the problem was in my initrd rather than the kernel.
The problem is the initrd isn't starting LVM because dracut didn't tell the initrd that it needs LVM. Therefore if you start LVM manually you should be able to boot into your system to fix it.
I believe this is the sequence of commands I ran from the emergency shell to start LVM:
vgscan
vgchange -ay
lvs
this link helped me remember
Followed by exit to resume normal boot.
You might have to mount your LVM /etc/fstab entries manually, I don't recall whether I did or not.
Try this:
sudo update-grub
Then:
mkinitcpio -p linux
It won't hurt to check your fstab file. There, you should find the UUID of your drive. Make sure you have the proper flags set in the fstab.
Also, there's a setting in the grub.cfg that has has GRUB use the old style of hexadecimal UUIDs. Check that out as well!
The issue is with creation of initramfs, after doing a
make oldconfig
and choosing default for new options, make sure the ENOUGH diskspace is available for the image to be created.
in my case the image created was not correct and hence it was failing to mount the image at boot time.
when compared; the image size was quite less than the existing image of lower version, so I added another disk with more than sufficient size and then
make bzImage
make modules
make modules_install
make install
starts working like a charm.
I wonder why the image creation got completed earlier and resulted in corrupt image (with less size) without throwing any error [every single time]

Krusader crashed on Mac OSX 10.7.2

i've installed krusader via macports but i'm unable to run krusader.
w-4jesc:web_cms_dms w-4jesc$ /Applications/MacPorts/KDE4/krusader.app/Contents/MacOS/krusader
KGlobal::locale::Warning your global KLocale is being recreated with a valid main component instead of a fake component, this usually means you tried to call i18n related functions before your main component was created. You should not do that since it most likely will not work
krusader(97879)/KSharedDataCache ensureFileAllocated: This system misses support for posix_fallocate() -- ensure this partition has room for at least 10547296 bytes.
krusader(97879)/KSharedDataCache: Unable to find an appropriate lock to guard the shared cache. This *should* be essentially impossible. :(
krusader(97879)/KSharedDataCache: Unable to perform initial setup, this system probably does not really support process-shared pthreads or semaphores, even though it claims otherwise.
krusader(97879)/KSharedDataCache: Unable to unmap shared memory segment 0x1142d2000
Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
krusader(97879)/kdeui (kdelibs): Session bus not found
To circumvent this problem try the following command (with Linux and bash)
export $(dbus-launch)
KCrash: Application 'krusader' crashing...
KCrash: Attempting to start /opt/local/lib/kde4/libexec/drkonqi.app/Contents/MacOS/drkonqi from kdeinit
sock_file=/Users/w-4jesc/Library/Preferences/KDE/socket-w-4jesc.local/kdeinit4__tmp_launch-URcTjs_org.x_0
Warning: connect() failed: : No such file or directory
KCrash: Attempting to start /opt/local/lib/kde4/libexec/drkonqi.app/Contents/MacOS/drkonqi directly
QProcess: Destroyed while process is still running.
drkonqi(97882)/KSharedDataCache ensureFileAllocated: This system misses support for posix_fallocate() -- ensure this partition has room for at least 10547296 bytes.
drkonqi(97882)/KSharedDataCache: Unable to find an appropriate lock to guard the shared cache. This *should* be essentially impossible. :(
drkonqi(97882)/KSharedDataCache: Unable to perform initial setup, this system probably does not really support process-shared pthreads or semaphores, even though it claims otherwise.
drkonqi(97882)/KSharedDataCache: Unable to unmap shared memory segment 0x1145ea000
Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
drkonqi(97882)/kdeui (kdelibs): Session bus not found
To circumvent this problem try the following command (with Linux and bash)
export $(dbus-launch)
dbus is already loaded:
sudo launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
org.freedesktop.dbus-session: Already loaded
has every one a idea?
sudo launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
MacPorts installer specifically says to start dbus without sudo:
# Don't forget that dbus needs to be started as the local
# user (not with sudo) before any KDE programs will launch
# To start it run the following command:
# launchctl load /Library/LaunchAgents/org.freedesktop.dbus-session.plist

Resources