4
votes

For the first time ever, I am having trouble running standard Linux commands in Ubuntu. For instance, when I try to edit a file using VI (e.g. vi /path/to/file) I get a segmentation fault error. Similarly for commands like curl -I http://some.domain.com, etc. In the case of curl, I used gdb to read the core dump and got the following:

PROMPT>> gdb -c core-curl-11-0-0-4954-1351282891
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-50.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
.
[New Thread 4954]
Core was generated by `/usr/bin/curl http://alfred.conviocloud.com'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007feedbb74721 in ?? ()

I recently put 4GB of memory into my computer and am wondering if this could be the problem. That said, I'm 100% sure I've used the right models AND that my computer can support the upgrade.

Any help in debugging, solving this would be VERY much appreciated. Thank you!

4
Bad memory can cause a segfault-- but this question is really offtopic for this site.antlersoft
Look into dmesg, run memtest.Olaf Dietsche
Sounds like bad memory. As for the programming-related advice: Never be 100% sure.aib
Also this might not be solution for you, but I had the same problem, got fixed after I updated my Ubuntu (via apt-get).0xc0de

4 Answers

1
votes

Couple things to try:

*) Check if you did a major upgrade. If you did, that might be causing it.
*) Remove and reinstall vim or any other simple utility. See if they fail. If they fail, look at what they have been linked to by using ldd. See if any of the libraries have a recent timestamp.
*) Look at the error stack from gdb. It tells you where it coredumped and in which library.
*) Reboot from the cd and see if the vi or any of the utilities fail.

0
votes

One possibility might some environment variables you have set in your shell are badly affecting the programs your are trying to run. If you can reliably generate a core dump via a standard Linux command (eg, vi), then try running that command in a shell that has nothing defined. To create a shell that has a minimal set of variables defined, open a terminal as normal, and then enter:

env -i bash --norc
-2
votes

I had sudo apt-get install vim,then your problem happen after reboot.

Do sudo apt-get autoremove vim. just after that, vi file become normal gain.(but some problem, which existed before apt-get install vim, came up again)

so, do sudo apt-get install vim again and reboot. Then no more Segmentation fault.