You are not logged in.
I've been having a problem with GDB where it will error out when using ZSH with:
Starting program: /home/steven/zsurf/zsurf
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffe86c3700 (LWP 25410)]
FATAL: The application binary appears to be running setuid, this is a security hole.
Thread 1 "zsurf" received signal SIGABRT, Aborted.
0x00007ffff7a6f04f in raise () from /usr/lib/libc.so.6I don't have this problem with GDB when using BASH as my shell. What could be causing this and most importantly how can I fix it?
Offline
Can you replicate it with vanilla Zsh?
Offline
Can you replicate it with vanilla Zsh?
It is vanilla Zsh.
Offline
So you have removed all configs?
Offline
So you have removed all configs?
Yes. I created a blank .zshrc. It still happens. No .zprofile either.
Last edited by SteveDeFacto (2017-03-12 17:06:26)
Offline
Works fine here: Zsh 5.3.1-1 with a minimal config.
Offline
ewaller@turing ~/devel/C/segfaultgenerator 1013 %cat main.c
#include <stdio.h>
int main (int argc, char* argv[])
{
char* myString;
myString=0;
printf ("%s",*myString);
return 0;
}
ewaller@turing ~/devel/C/segfaultgenerator 1014 %./a.out
zsh: segmentation fault (core dumped) ./a.out
ewaller@turing ~/devel/C/segfaultgenerator [139]1015 %gdb a.out
GNU gdb (GDB) 7.12.1
Copyright (C) 2017 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-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from a.out...done.
(gdb) l
1 #include <stdio.h>
2 int main (int argc, char* argv[])
3
4 {
5 char* myString;
6 myString=0;
7 printf ("%s",*myString);
8 return 0;
9 }
(gdb) r
Starting program: /home/ewaller/devel/C/segfaultgenerator/a.out
Program received signal SIGSEGV, Segmentation fault.
0x00000000004004df in main (argc=1, argv=0x7fffffffdfb8) at main.c:7
7 printf ("%s",*myString);
(gdb) Seems okay here
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
ewaller@turing ~/devel/C/segfaultgenerator 1013 %cat main.c #include <stdio.h> int main (int argc, char* argv[]) { char* myString; myString=0; printf ("%s",*myString); return 0; } ewaller@turing ~/devel/C/segfaultgenerator 1014 %./a.out zsh: segmentation fault (core dumped) ./a.out ewaller@turing ~/devel/C/segfaultgenerator [139]1015 %gdb a.out GNU gdb (GDB) 7.12.1 Copyright (C) 2017 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-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from a.out...done. (gdb) l 1 #include <stdio.h> 2 int main (int argc, char* argv[]) 3 4 { 5 char* myString; 6 myString=0; 7 printf ("%s",*myString); 8 return 0; 9 } (gdb) r Starting program: /home/ewaller/devel/C/segfaultgenerator/a.out Program received signal SIGSEGV, Segmentation fault. 0x00000000004004df in main (argc=1, argv=0x7fffffffdfb8) at main.c:7 7 printf ("%s",*myString); (gdb)Seems okay here
Works fine here: Zsh 5.3.1-1 with a minimal config.
There appears to be more at play here than I thought. It only appears to be an issue with applications which use either GTK or QT(probably others.). Trying it with otter-browser results in the same error I'm getting. Trying it with a GTK application give a GTK version of the same error:
(waterfox:13039): Gtk-WARNING **: This process is currently running setuid or setgid.
This is not a supported use of GTK+. You must create a helper
program instead. For further details, see:
http://www.gtk.org/setuid.html
Refusing to initialize GTK+.However, trying it with just console applications seems to work fine.
Last edited by SteveDeFacto (2017-03-12 22:58:04)
Offline
Errr... stupid question: did you suid gdb or zsh or run it sudo to sidestep the yama security setting?
type gdb
stat `which gdb` `which zsh`
id -un; id -unr
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scopeOnline
Errr... stupid question: did you suid gdb or zsh or run it sudo to sidestep the yama security setting?
type gdb stat `which gdb` `which zsh` id -un; id -unr echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
Yes, I did try running it with sudo which works but that isn't an acceptable solution. I assume you wanted me to run those commands? Here is the output:
gdb is /usr/bin/gdb
gdb is /usr/sbin/gdb
File: /usr/bin/gdb
Size: 6634184 Blocks: 12960 IO Block: 4096 regular file
Device: fd00h/64768d Inode: 5270296 Links: 1
Access: (6755/-rwsr-sr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2017-03-13 13:01:50.060208260 -0700
Modify: 2017-01-25 05:12:51.000000000 -0700
Change: 2017-02-15 20:46:17.961200879 -0700
Birth: -
File: /usr/bin/zsh
Size: 796280 Blocks: 1560 IO Block: 4096 regular file
Device: fd00h/64768d Inode: 5252950 Links: 2
Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2017-03-12 15:42:06.253796677 -0700
Modify: 2016-12-22 12:27:11.000000000 -0700
Change: 2017-03-12 15:41:53.200463220 -0700
Birth: -
steven
steven
0Offline
Why does "type" reveal a gdb in /usr/sbin - that should be a symlink to /usr/bin (if)
Also, why is gdb 6755? The suid bit is set, thus the errors.
=> Investigate on these items.
I rather wanted to know whether you were calling "sudo gdb foo" to avoid the yama protection, since this might have cause this or similar troubles.
The last command (which you apparently put into a shell w/o thinking about it, don't do such, net even with commands from this forum) turns off this mechanism "the right way" and allows random users to attach gdb to running processes, but is not permanent (ie. will be gone with the next reboot)
Online
Why does "type" reveal a gdb in /usr/sbin - that should be a symlink to /usr/bin (if)
Also, why is gdb 6755? The suid bit is set, thus the errors.
=> Investigate on these items.I rather wanted to know whether you were calling "sudo gdb foo" to avoid the yama protection, since this might have cause this or similar troubles.
The last command (which you apparently put into a shell w/o thinking about it, don't do such, net even with commands from this forum) turns off this mechanism "the right way" and allows random users to attach gdb to running processes, but is not permanent (ie. will be gone with the next reboot)
That is very odd to say the least... Thank you, it works now...
Offline