|
From: liujianping <liu...@16...> - 2011-05-06 15:21:46
|
Hi,
I run a command on x86 as below:
strace -f -o ./strace-valg-hello valgrind ./hello
(hello.c is just printf hello world.)
And then "vi ./strace-valg-hello", I find there is a Segmentation fault in strace-valg-hello (as follows).
Why there is a "Segmentation fault" ? And why it doesn't display Segmentation fault when I run dmesg ?
3212 mmap2(0x64672000, 65536, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, 0, 0) = 0x64672000
3212 uname({sys="Linux", node="linux-ym6x", ...}) = 0
3212 --- SIGSEGV (Segmentation fault) @ 0 (0) ---
3212 gettid() = 3212
3212 mmap2(0xbea35000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, 0, 0) = 0xbea35000
3212 rt_sigreturn(0xbea36234) = -1096589392
3212 getpid() = 3212
Thank you!
Best wishes to you! |
|
From: Wan M. F. W. I. <wan...@mc...> - 2011-05-06 15:28:25
|
> I run a command on x86 as below: > strace -f -o ./strace-valg-hello valgrind ./hello > (hello.c is just printf hello world.) > > And then "vi ./strace-valg-hello", I find there is a Segmentation fault in > strace-valg-hello (as follows). > Why there is a "Segmentation fault" ? > if valgrind ./hello gives Segmentation fault, so of course strace will show it too. Can you run ./hello alone? And why it doesn't display Segmentation fault when I run dmesg ? > > > afaik, dmesg is for kernel messages. -- Wan Mohd Fairuz WAN ISMAIL |
|
From: liujianping <liu...@16...> - 2011-05-07 03:27:27
|
Hi, " if valgrind ./hello gives Segmentation fault, so of course strace will show it too. Can you run ./hello alone? " I have run " strace -f -o ./strace-hello ./hello" alone, there isn't Segmentation fault. And run "strace -f -o ./strace-valg-hello valgrind ./hello" , there is Segmentation fault in strace-valg-hello. |
|
From: WAROQUIERS P. <phi...@eu...> - 2011-05-06 15:40:44
|
> Why there is a "Segmentation fault" ? And why it doesn't display Segmentation fault when I run dmesg ? IIUC, Valgrind is using the SIGSEGV signal to e.g. track the need to increase the stack. As it properly traps and handles SIGSEGV, you see no crash (and so, no indication of an error anywhere). Philippe ____ This message and any files transmitted with it are legally privileged and intended for the sole use of the individual(s) or entity to whom they are addressed. If you are not the intended recipient, please notify the sender by reply and delete the message and any attachments from your system. Any unauthorised use or disclosure of the content of this message is strictly prohibited and may be unlawful. Nothing in this e-mail message amounts to a contractual or legal commitment on the part of EUROCONTROL, unless it is confirmed by appropriately signed hard copy. Any views expressed in this message are those of the sender. |