A segmentation fault (often shortened to segfault) or bus error occurs when the hardware notifies a Unix-like Operating system about a memory access violation.
Questions tagged [segmentation-fault]
145 questions
279
votes
4 answers
How does a Segmentation Fault work under-the-hood?
I can't seem to find any information on this aside from "the CPU's MMU sends a signal" and "the kernel directs it to the offending program, terminating it".
I assumed that it probably sends the signal to the shell and the shell handles it by…
Braden Best
- 2,183
- 2
- 12
- 12
79
votes
2 answers
Will Linux start killing my processes without asking me if memory gets short?
I was running a shell script with commands to run several memory-intensive programs (2-5 GB) back-to-back. When I went back to check on the progress of my script I was surprised to discover that some of my processes were Killed, as my terminal…
NeutronStar
- 1,611
- 4
- 17
- 19
50
votes
2 answers
Running application ends with "Segmentation Fault"
I have a command line application that when run does not do what it is supposed to do and at a certain point leaves the message:
Segmentation fault
What does this mean? What should I do?
goldilocks
- 86,451
- 30
- 200
- 258
47
votes
4 answers
Segmentation fault (core dumped) - to where? what is it? and why?
When a segmentation fault occurs in Linux, the error message Segmentation fault (core dumped) will be printed to the terminal (if any), and the program will be terminated. As a C/C++ dev, this happens to me quite often, and I usually ignore it and…
Joe
- 1,384
- 1
- 11
- 18
14
votes
3 answers
Is a "segmentation fault" a system error or program bug?
I am currently running a statistical modelling script that performs a phylogenetic ANOVA. The script runs fine when I analyse the full dataset. But when I take a subset it starts analysing but quickly terminates with segmentation fault. I cannot…
TUnix
- 355
- 2
- 8
14
votes
2 answers
Piping output from a segfaulting program
I have a script that calls a program (specifically, ttf2afm, part of tetex 3.0) that sometimes segfaults and sometimes doesn't. The information I need is always printed out before it segfaults, but I'm having a hard time stopping the pipe…
amphetamachine
- 5,388
- 2
- 34
- 41
12
votes
2 answers
How can I trap a program that returns 139 (segmentation fault) in bash?
I have a bash script that tests some programs and one of the program returns Segmentation fault so I tried to add a trap in the head of my script:
trap "echo 'segfault occured!'" SIGSEGV
That however didn't do anything. I used
echo $?
just after…
Pithikos
- 3,214
- 4
- 23
- 27
9
votes
2 answers
.dtors looks writable, but attempts to write segfault
This is Ubuntu 9.04, 2.6.28-11-server, 32bit x86
$ cat test.c
main() { int *dt = (int *)0x08049f18; *dt = 1; }
$ readelf -S ./test
...
[18] .dtors PROGBITS 08049f14 000f14 000008 00 WA 0 0 4
...
$ ./test
Segmentation…
Fixee
- 1,891
- 3
- 17
- 24
9
votes
1 answer
Segmentation fault when trying to run glxgears via virtualGL
(Follow-up on How to efficiently use 3D via a remote connection?)
I installed the amd64 package on the server and the i386 one on the client. Following the user's guide I run this on the client:
me@client> /opt/VirtualGL/bin/vglconnect…
Tobias Kienzler
- 9,184
- 13
- 65
- 106
8
votes
4 answers
How could running strace be fixing my OpenGL issue?
Since a recent major upgrade to my distribution (PLD Linux), I have been having trouble with a whole slew of programs. As best I can tell, anything that touches OpenGL or PulseAudio segfaults. I'm using the proprietary nvidia drivers and a 3.2.x…
Caleb
- 69,278
- 18
- 196
- 226
7
votes
3 answers
Almost no commands working - relocation error: symbol __getrlimit, version GLIBC_PRIVATE not defined in libc.so.6
I am connected with SSH to a machine on which I don't have root access. To install something I uploaded libraries from my machine and put them in the ~/lib directory of the remote host.
Now, for almost any command I run, I get the error below…
devil0150
- 651
- 3
- 7
- 14
6
votes
2 answers
Trying to run Kile gives a segmentation fault on Linux Mint 19
With the latest version of Kile installed, trying to run it crashes with a segmentation fault:
$ kile
qt5ct: using qt5ct plugin
Invalid Context= "Apps" line for icon theme: "/usr/share/icons/Mint-Y/apps/16/"
Invalid Context= "Apps" line for icon…
user1717828
- 3,512
- 6
- 23
- 32
6
votes
1 answer
Unkillable apache2 processes
After upgrading from debian lenny to squeeze (apache2 2.2.16-6+squeeze4 and php 5.3.10-1~dotdeb.1), my apache processes started to exit with segmentation fault. It happens every 5-30 minutes (for 1 process), so it does not do any impact right now.…
Marki555
- 2,078
- 18
- 18
6
votes
3 answers
Are there "esoteric" (weird) but standards-compliant C compilers or runtimes?
As we know, the C standard does not specify a lot of details of the implementation, for example value of NULL pointer, order of bits and bytes (endiannes), alignment in structs and of stack parameters, actual organization of memory (I don't think…
user62537
- 61
- 1
5
votes
2 answers
Is there a way to find out which program is segfault-ing?
I have a Busybox/Linux system where a mystery program is segfaulting rarely. Is there a way to find which program is doing this?
Shawn J. Goff
- 45,338
- 25
- 134
- 145