Linux Question

Kay , I checked the faq and did the search , so the question will be posed in its own thread. Mods feel free to move this to another forum if inappropriate.

Alrighty , I am getting an error in Mandrake 10.1 of a segmentation fault , which is what happens when something tries to grab a chunk of memory that its not allocated for. Also an error message comes up in the CLI regarding a core dump , but the system does run, so it can’t be that drastic.

Previously my normal mode of fixing stuff on linux , would be just to re-install, but I think that I have moved on to the point of finding the problem ,and fixing it. Its recommended that a program called gnu debugger be run, to find out where the problem is ,and then fix it I suppose.

So , does anyone know of a program ( or a command line) that would do a search globally across my system ,to show me where to go , at least to find out whats causing the seg fault.

thanks

Declan

I think you have to be more specific as to when this segmentation fault occurs. When something segfaults, the process is terminated. So that whatever that was running, will no longer be running after the segfault. If you are getting it at the root console at random times, I suggest doing a ‘ps ax’ before and after to see what process quit. You can also try to examine the core file, but that is non-trivial. I am kind of tired right now, I’m sure somebody will come along shortly and point out something I’m missing.

Yes, you really need to know what program is crashing. Then you can reinstall it, upgrade it, or whatever. When a program segfaults, it leaves a core file for debugging, so you should be able to run “find / -name *.core” and find any programs that have segfaulted. (The program name will be the first part of the file.)

Interesting

I tried this as a user and this came up

find: /home/root/tmp: Permission denied
find: /home/root/drakx: Permission denied
find: /home/guest/tmp: Permission denied
find: /etc/skel/tmp: Permission denied
find: /etc/default: Permission denied
find: /tmp/gconfd-root: Permission denied
find: /tmp/0520512668: Permission denied
find: /tmp/0241311735: Permission denied
find: /tmp/1664846559: Permission denied
find: /var/tmp/kdecache-root: Permission denied
find: /var/lib/xdm: Permission denied
find: /var/lib/nfs/statd: Permission denied
find: /var/lib/nfs/sm: Permission denied
find: /var/lib/nfs/sm.bak: Permission denied
find: /var/lib/mailman/archives/private: Permission denied
find: /var/lib/pgsql: Permission denied
find: /var/lib/slocate: Permission denied
find: /var/run/sudo: Permission denied
find: /var/spool/cron: Permission denied
find: /var/spool/postfix/active: Permission denied
find: /var/spool/postfix/bounce: Permission denied
find: /var/spool/postfix/corrupt: Permission denied
find: /var/spool/postfix/defer: Permission denied
find: /var/spool/postfix/deferred: Permission denied
find: /var/spool/postfix/flush: Permission denied
find: /var/spool/postfix/hold: Permission denied
find: /var/spool/postfix/incoming: Permission denied
find: /var/spool/postfix/maildrop: Permission denied
find: /var/spool/postfix/private: Permission denied
find: /var/spool/postfix/public: Permission denied
find: /var/spool/postfix/trace: Permission denied
find: /var/spool/postfix/saved: Permission denied
find: /var/spool/at: Permission denied
find: /var/apache-mm: Permission denied
find: /root: Permission denied
find: /proc/tty/driver: Permission denied
find: /proc/1/task/1/fd: Permission denied
find: /proc/2/task/2/fd: Permission denied
find: /proc/3/task/3/fd: Permission denied
find: /proc/4/task/4/fd: Permission denied
find: /proc/5/task/5/fd: Permission denied
find: /proc/30/task/30/fd: Permission denied
find: /proc/32/task/32/fd: Permission denied
find: /proc/33/task/33/fd: Permission denied
find: /proc/35/task/35/fd: Permission denied
find: /proc/34/task/34/fd: Permission denied
find: /proc/141/task/141/fd: Permission denied
find: /proc/266/task/266/fd: Permission denied
find: /proc/414/task/414/fd: Permission denied
find: /proc/828/task/828/fd: Permission denied
find: /proc/1080/task/1080/fd: Permission denied
find: /proc/2446/task/2446/fd: Permission denied
find: /proc/2471/task/2471/fd: Permission denied
find: /proc/2495/task/2495/fd: Permission denied
find: /proc/2503/task/2503/fd: Permission denied
find: /proc/2562/task/2562/fd: Permission denied
find: /proc/2923/task/2923/fd: Permission denied
find: /proc/2957/task/2957/fd: Permission denied
find: /proc/3043/task/3043/fd: Permission denied
find: /proc/3050/task/3050/fd: Permission denied
find: /proc/3072/task/3072/fd: Permission denied
find: /proc/3090/task/3090/fd: Permission denied
find: /proc/3116/task/3116/fd: Permission denied
find: /proc/3170/task/3170/fd: Permission denied
find: /proc/3205/task/3205/fd: Permission denied
find: /proc/3260/task/3260/fd: Permission denied
find: /proc/3261/task/3261/fd: Permission denied
find: /proc/3262/task/3262/fd: Permission denied
find: /proc/3263/task/3263/fd: Permission denied
find: /proc/3264/task/3264/fd: Permission denied
find: /proc/3265/task/3265/fd: Permission denied
find: /proc/3266/task/3266/fd: Permission denied
find: /proc/3267/task/3267/fd: Permission denied
find: /proc/3274/task/3274/fd: Permission denied
find: /proc/3275/task/3275/fd: Permission denied
find: /proc/3280/task/3280/fd: Permission denied
find: /proc/3454/task/3454/fd: Permission denied
find: /proc/3457/task/3457/fd: Permission denied
find: /proc/3471/task/3471/fd: Permission denied
find: /proc/3472/task/3472/fd: Permission denied
find: /proc/3707/task/3707/fd: Permission denied
find: /proc/3711/task/3711/fd: Permission denied
find: /proc/3712/task/3712/fd: Permission denied
find: /proc/3741/task/3741/fd: Permission denied
find: /proc/3767/task/3767/fd: Permission denied
find: /proc/3777/task/3777/fd: Permission denied
find: /proc/3801/task/3801/fd: Permission denied
find: /proc/3947/task/3947/fd: Permission denied
find: /proc/3954/task/3954/fd: Permission denied
find: /proc/3955/task/3955/fd: Permission denied
find: /proc/3956/task/3956/fd: Permission denied
find: /proc/3957/task/3957/fd: Permission denied
find: /proc/3958/task/3958/fd: Permission denied
find: /proc/4109/task/4109/fd: Permission denied
find: /proc/4110/task/4110/fd: Permission denied
find: /proc/4111/task/4111/fd: Permission denied
find: /proc/4112/task/4112/fd: Permission denied
find: /proc/4113/task/4113/fd: Permission denied
find: /proc/4122/task/4122/fd: Permission denied
find: /proc/4620/task/4620/fd: Permission denied
find: /.mozilla: Permission denied

Then as superuser

[root@localhost declan]# find / -name *.core
[root@localhost declan]#

Nothing came up , is there anything I might have done wrong ?

Declan

I forgot to mention that you should run the find as root so it could search the entire file system. That’s strange that it didn’t find anything though. I’ve never seen an application crash without leaving a core file. Maybe there’s a way to turn automatic core files on and off in Linux, like a sysctl variable in FreeBSD. (I use FreeBSD by the way, which isn’t Linux, but is similar. I used Linux years ago, but can’t remember most things specific to it.)

Does the segfault message have anything more specific? Usually it has the name of the program that’s crashing. You need to know what’s crashing before you can go any further. If this doesn’t help, hopefully someone that actually knows Linux can chime in.

This is the fault of a specific application, not Linux. In fact, Linux is preventing that wayward program from doing any damage: That program tried to access memory it didn’t own, so Linux killed it and told you about it in its typically terse way. There’s no direct equivalent in Windows (a General Protection Fault/BSOD means the OS just faulted, and I don’t think there’s an equivalent for a specific program going nuts).

I don’t know if you have enough programming experience to fix this yourself. You’d need to read a stack dump (which is the interesting thing a core dump gives you) and determine which part of the program is going off the rails. Then you’d need to fix the source of the program (you may or may not have it, but it’s almost certainly available), rebuild it, and see if it still fails. Repeat until the bug goes away.

I’m not trying to be insulting. However, you’re asking pretty basic questions here and fixing bugs of this type can get extremely tricky. You might be very experienced but it sounds like you aren’t experienced in Unix, and that might make a huge difference. It might not. It’s impossible to know right now.

The command you need to know is ‘ulimit’, specifically ‘ulimit -c’. This seems to be a good document for you. (You’ll need a much more detailed document soon, if you actually plan on fixing anything. Try typing ‘info gdb’ for starters.) And under Linux, core dumps are just named ‘core’. (snailboy, that must be one of the many minor differences between BSDs and SysV/POSIX OSes like Linux.)

I hope I helped.