You are not logged in.
Pages: 1
Hello everyone,
I have a freshly installed Arch Linux on my computer that I use for development. So I need the gdb, which is installed.
However, if I try to backtrace a segfault, or some similar problem, I always get only the message "No Stack".
I have compiled the program with g++ and the -g parameter, but even simply test programs won't work:
#include <iostream>
#include <vector>
int main() {
int *pts = 0;
pts[10] = 42;
return 0;
}Edit: I have the additional problem that when I set for example a breakpoint in KDevelop, the debugger just ignores it and does not stop the execution at this point.
Last edited by masala (2013-11-27 18:48:26)
Offline
I'm not sure what's wrong...
I only have access to a Red Hat machin at the moment, so I did a quick test:
I put your code into "stack.cpp", compiled it using "g++ -g -o stack stack.cpp", and ran it using "gdb stack" (followed by the "run" command). gdb correctly reported that a segmentation fault happened on line 6.
Did you forget to use the "run" command in gdb?
Offline
No, unfortunately not. Attached you see, how my gdb session looks like:
$ gdb ./a.out
GNU gdb (GDB) 7.6.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/.../Desktop/a.out...done.
(gdb) run
Starting program: /home/.../Desktop/./a.out
During startup program terminated with signal SIGSEGV, Segmentation fault.
(gdb) bt
No stack.
(gdb) Offline
I'm surprised that the program isn't even starting! ("During startup program terminated with signal SIGSEGV") According to the Wikipedia, "a signal called SIGSEGV is sent to a process that accesses an invalid memory address", which makes sense...
Do you have any sort of special configuration to your operating system, such as a the kernel, kernel modules, or compiler settings? Anything that you think might not be considered "normal" in Arch Linux?
Anyway, I'll try out your example when I get home to my Arch Linux computer. EDIT: As Allan confirmed below, trying it on my Arch Linux computer also worked for me.
Last edited by drcouzelis (2013-11-26 01:08:20)
Offline
Works for me. Are you using nvidia?
Offline
I have no special configuration. For the installation I followed the instructions in the wiki.
@Allan: Yes, I have a nvidia graphics card. Therefore I installed the nvidia drivers and also cuda.
Last edited by masala (2013-11-26 09:49:08)
Offline
I got a similar issue, maybe this is a bug with a recent gdb/gcc?
int main(int argc, char **argv)
{
int *p = 0;
return *p;
}$ gdb ./a.out
GNU gdb (GDB) 7.6.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/.../a.out...(no debugging symbols found)...done.
(gdb) r
Starting program: /home/..././a.out
During startup program terminated with signal SIGSEGV, Segmentation fault.
(gdb) quitEDIT: Some relevant versions:
$ pacman -Q gcc-multilib gdb
gcc-multilib 4.8.2-4
gdb 7.6.1-1Last edited by heinrich5991 (2013-11-27 11:20:54)
Offline
I have the same gdb version (yfi).
Offline
UPDATE: I made an update with pacman -Syu which contained the new package linux-3.12.1-3 and now it works.
Offline
Great! You probably also had to reboot to make the new kernel take effect, right?
Anyway, you can mark the thread as "[SOLVED]" by "Edit"ing your original post. ![]()
Offline
I'm seeing the same problem, with an up-to-date system.
test.c:
#include <stdio.h>
#include <assert.h>
int main(void) {
printf("Hello, world!\n");
assert(0);
return 0;
}Built with:
gcc -std=c89 -Wall -Wextra -O0 -g -o check test.cThe problem is intermittent: sometimes gdb catches the signal and gives me a stack-trace as normal, sometimes it just gives me "During startup program terminated with signal SIGABRT, Aborted.". In either case, the test program prints its message and the normal assertion failure message ("test.c:7: main: Assertion `0' failed.").
Package versions:
$ pacman -Q linux glibc nvidia gcc gdb
linux 3.12.5-1
glibc 2.18-11
nvidia 331.20-2
gcc 4.8.2-6
gdb 7.6.2-1Offline
Pages: 1