Getting a coredump of a third party application - aix

I am running on AIX-6.
I want to get a core dump of a third party executable that is in an infinite loop.
I did a kill -11 $thepid, it died but it did not dump.
I reviewed my machine settings to make sure it compared with IBM recommended settings:
--> lsattr -l sys0 -a fullcore -E
fullcore true Enable full CORE dump True
--> lscore
compression: off
path specification: on
corefile location: /home/alphalfa/tmp
naming specification: on
Here is the guide I am following:
http://www-01.ibm.com/support/docview.wss?uid=isg3T1019236
I figured there was some configuration I was missing so I did a test of running sleep 60 and killing it with kill -11 $sleeppid. That core dumped into alphafa's tmp folder.
The target application is NOT setuid, however it is owner = root. I changed the owner to alphafa and still did not dump.
What are some things I can try to get this application to coredump or figure out why it will not coredump?

Related

Generating coredump in archlinux

I am trying to debug for my program in Archlinux in embedded board imx8. The program just terminate abruptly after starting up. I am trying to find the core dump to examine. However I could not find the core dump anywhere (tried to find it in /var/lib/systemd/coredump)
I try to follow this link https://wiki.archlinux.org/title/core%20dump. However the link contains only how to disable the link. So I check whether there is disabling of coredump in my board
Using systemd
I could not find the presence of custom.conf in /etc/systemd/coredump.conf.d/custom.conf. In fact I could not find anything. So I guess this is not how the core dump is disabled
Using sysctl
/etc/sysctl.d/50-coredump.conf is not found.
Using PAM limits
/etc/security/limits.conf could be found. However the whole file is commented (#) and the limits is not found
Using ulimit
I try to use "ulimit -c unlimited to unset the limits.
However even after checking all this files, there is not any coredump file found in /var/lib/systemd/coredump. So I wonder what I could do.
I tried using coredumpctl list. However it seem that it has not been installed on the board. So I could not use coredumpctl to find the dump file
So I wonder whether there is any settings I should set for release of coredump
Regards

Kestrel server doesn't work when run in background, why?

I have a project made and tested with Visual Studio. It works.
Then I uploaded it into Ubuntu server.
Then ran it with dotnet run. Works, remote machines see it (via nginx proxy).
Then I tried dotnet run &. The process seems like started, but nothing listens on port specified. Then, according to the example, I tried sudo nohup dotnet run kestrel > /dev/null 2>&1 &. This time it listened for a while, then died with:
Application started. Press Ctrl+C to shut down.
fail:
Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]
An unhandled exception has occurred: Can not find compilation library location for package 'google.protobuf'
System.InvalidOperationException: Can not find compilation library
location for package 'google.protobuf' at
Microsoft.Extensions.DependencyModel.CompilationLibrary.ResolveReferencePaths()
(A fragment of output from nohup.out, first linens, I skipped project details as irrelevant and private).
Any clues what's happening? I still get no errors when running it in foreground.
Here's what I found out: I can't run it (it gives same error messages) when I run it as root. On my test server I have a special user account named "dotnet". When I log in as dotnet I can run the app. As root I can't.
I don't want to run my app with root privileges.
Next try: I run dotnet restore as root. Then I go with nohup dotnet run kestrel > /dev/null 2>&1 & and it works.
Nice. Now is there a way to start my app with limited privileges?
I found the answer myself, so I'll share.
First: do not run .NET core projects on Linux as root if you don't intend to give them full root privileges. I think web applications with root privileges are bad idea and sort of asking for troubles.
But well, when something doesn't work, it's tempting to use sudo from time to time. And it turns out it was the cause of the problem:
dotnet restore and dotnet run must be executed with the same privileges, by the same user. When I issued dotnet restore as root, it worked. It's even harder the other way, when you want to run the project as user with lower privileges. You have to remove all temporary files before issuing dontet restore. So, generally nohup dotnet run kestrel > /dev/null 2>&1 & works as charm, no sudo is needed here, running this as root can be harmful.
Now I always create special dotnet user to run dotnet apps on servers. It's safer this way. The user cannot sudo. When I need to perform administrative tasks I just start separate root session. I use the same approach with database access. The app has only rights to execute procedures, not even select allowed.

How to get coredump file when an application kill itself?

On Centos 6.5, I have an application and when running it about 5 minutes, it stop with only a "Killed" on terminal, and I can not get core dump file.
I already enable core dump file, by command "ulimit -c unlimited", specify the core file name, location and file name format.
Can everybody help me why core dump file not generated when an application killed itself!
Thank you very much for any help!

Xcode distributed build failure

I am trying to do distributed builds with Xcode, but I see this error while building from my build server (Build Sever is the host, dev machine is the client).
When I try to do this the other way, I am able to distribute builds (My Dev machine as the host and the Build Sever as the client)
Any thoughts?
[14:44:47]: Step 2/3 (6m:10s)
[14:44:57]: [Step 2/3] distcc[95606] (dcc_parse_multiplier) ERROR: bad multiplier "/0,lzo,cpp" in host specification
[14:44:57]: [Step 2/3] distcc[95606] (dcc_show_hosts) CRITICAL! Failed to get host list
[14:44:57]: [Step 2/3] /usr/bin/pump: error: pump mode requested, but distcc hosts list does not contain any hosts with ',cpp' option
Your milage may vary with this solution, but we've had to hack the distcc that comes with Xcode to force pump mode to be off to fix this problem.
Remove pump from /Developer/usr/bin and /usr/bin, just write out an empty file named pump in its place
Don't forget to chmod a+x your pump and distcc (in the next step)
In /Developer/usr/bin, rename distcc to distcc.bin and write out this distcc
#!/bin/bash
hosts=$DISTCC_HOSTS
hosts=${hosts//\,cpp/}
export DISTCC_HOSTS=$hosts
echo Modified DISTCC_HOSTS=\"$DISTCC_HOSTS\"
/Developer/usr/bin/distcc.bin $#
Apologies, this is a quick and dirty solution. There is probably a cleaner way to do this.
Please restart the build server and your own computer. That usually does the trick for me, also, update to the latest xcode 4

Debugging Solaris OS crash

I have access to a remote Solaris terminal which crashes occasionally, and I have to ask someone with physical access to boot the machine up, which it does successfully. I would like to know which tools/files should I look at to find out the cause of the crash so that I can make the necessary configuration changes and avoid it in the future.
What tools you can use will depend on what version of solaris you have running and what the actual problem
is. The first thing to do is check the system console (which it sounds like you don't have access to) and the /var/adm/messages file. This file is updated with system messages and the newest will appear at the end.
Next, you can look for a system core file. If a core file is created, it would be in /var/crash/hostname where "hostname" is the name of the machine.
If you have an actual core file in the /var/crash/hostname directory, this set of commands will give you a good
string to search google with:
# cd /var/crash/hostname
Replace "hostname" with the hostname of your machine.
# mdb -k unix.0 vmcore.0
If you have multiple core files, select the most recent version.
> ::status
This should give you a panic message, cut and paste that into google and see what you can find.
For more core file analysis read this:
http://cuddletech.com/blog/pivot/entry.php?id=965