I think the ouput of the command dmesg should be the subset of the file /var/log/dmesg. But when I am debugging,the segmentation fault information can only be seen in the output of the command dmesg. What is the difference between them ? Answer The kernel message buffer is a ring buffer with limited space – when new messages arrive old
Tag: segmentation-fault
gcc segmentation fault – how can I find a line where it happened?
I’m using Ubuntu and gcc. My application crashes I only have Segmentation fault message in console. (previously Segmentation fault (core dumped) was reported but now it changed to just Segmentation fault). There are no hints where the problem is so I do not understand how should I fix the problem. I need some hints to find what caused this –
Visual Studio Code Segmentation Fault on Debian
I downloaded and extracted VS Code in a Debian x64 VM and tried to run it. It complained about missing glibc libraries (I have 2.13, it needs 2.15). I followed these steps to get Ubuntu DEBs. Using those, VS Code throws a segmentation fault when I run it. gdb tells me: Why won’t Visual Studio Code run for me in
Why does linking with pthread cause a segmentation fault?
I have a stripped down simple program with a static variable (‘abc.cpp’): I compile it and it works: However, if I link in the pthread library…. I know it doesn’t use threading here, but in the actual non-stripped-down program, it links to a library that does use threading. It feels like it should be okay to link to pthread even
pthread_detach() causes SIGSEGV on 64 bit Linux
Here is a description of my situation: I have to take care of the bug in our product. The thread is created as joinable , it must do its work, terminate and nobody will call pthread_join() for it. So the thread is created with JOINABLE attribute (by default) and before termination it calls the next code: It works like a
Why glibc’s fclose(NULL) cause segmentation fault instead of returning error?
According to man page fclose(3): RETURN VALUE Upon successful completion 0 is returned. Otherwise, EOF is returned and the global variable errno is set to indicate the error. In either case any further access (including another call to fclose()) to the stream results in undefined behavior. ERRORS EBADF The file descriptor underlying fp is not valid. The fclose() function may
Recursion using main() function [closed]
It’s difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago. I am writing a program to calculate factorial using recursion of main() function.
Easiest way to locate a Segmentation Fault
I encountered my first Segmentation Fault today (newbie programmer). After reading up on what a segmentation fault is (Thanks for all of the helpful info on this site, as well as Wikipedia’s lengthy explanation), I’m trying to determine the easiest way to go about finding where my fault is occuring. It’s written in C and the error is occuring on
A simple C++ shared memory program written on linux: segmentation fault
I got the code from a tutorial on shared memory. It worked until I defined struct LOCK and tried to write LOCKs instead of char* into the shared memory. Could someone please help me figure out the problem here that causes the segmentation fault? Answer You are placing vectors and strings into shared memory. Both those classes allocate memory of