|
| user application error causes kernel segfault |
 |
Thu, 10 Apr 2008 11:26:01 GMT |
Hi,
why does crashing application at user level causes system kernel
reports segfault ?
Is this a (new) normal behaviour ?
Example with this wrong code:
#-------------------
MemoryFault.c
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("ARGC=%d ARGV[0]=%s
ARGV[1]=%s\n",argc,*argv[0],*argv[1]);
}
#-------------------
% gcc -o MemoryFault -c MemoryFault.c
% ./MemoryFault
% grep Memory /var/log/messages:
Apr 10 12:57:11 gen105 kernel: MemoryFault[28457]: segfault at
0000000000000000 rip 00000000080483dd rsp 00000000fff96200 error 4
---------
OS = openSUSE 10.3
Kernel = 2.6.22.17-0.1-default x86_x64
--
bsenf
------------------------------------------------------------------------
bsenf's Profile: http://forums.novell.com/member.php?userid=13738
View this thread: http://forums.novell.com/showthread.php?t=323618
|
| Post Reply
|
| Re: user application error causes kernel segfault |
 |
Thu, 10 Apr 2008 18:03:18 GMT |
bsenf wrote:
>
> Hi,
>
> why does crashing application at user level causes system kernel
> reports segfault ?
> Is this a (new) normal behaviour ?
>
> Example with this wrong code:
>
> #-------------------
> MemoryFault.c
>
> #include <stdio.h>
> int main(int argc, char *argv[])
> {
> printf("ARGC=%d ARGV[0]=%s
> ARGV[1]=%s\n",argc,*argv[0],*argv[1]);
> }
>
> #-------------------
> % gcc -o MemoryFault -c MemoryFault.c
> % ./MemoryFault
>
> % grep Memory /var/log/messages:
>
> Apr 10 12:57:11 gen105 kernel: MemoryFault[28457]: segfault at
> 0000000000000000 rip 00000000080483dd rsp 00000000fff96200 error 4
>
>
> ---------
> OS = openSUSE 10.3
> Kernel = 2.6.22.17-0.1-default x86_x64
>
>
Something in the program is causing an error. Perhaps some dependency is
not met. Perhaps some file is not up to date. Perhaps an update broke
some link.
What program?
--
Later,
Darrell Stec darstec@neo.rr.com
Webpage Sorcery
http://webpagesorcery.com
|
| Post Reply
|
| Re: user application error causes kernel segfault |
 |
Thu, 10 Apr 2008 18:46:01 GMT |
The code above is intentional wrong - only for reproducing the error of
course.
But WHY does the OS logs this into /var/log/messages ?
I have similary machines and these don't do so - crash yes, but not
notice that within /var/log/messages.
--
bsenf
------------------------------------------------------------------------
bsenf's Profile: http://forums.novell.com/member.php?userid=13738
View this thread: http://forums.novell.com/showthread.php?t=323618
|
| Post Reply
|
| Re: user application error causes kernel segfault |
 |
Thu, 10 Apr 2008 20:15:31 GMT |
On Thu, 2008-04-10 at 18:46 +0000, bsenf wrote:
> The code above is intentional wrong - only for reproducing the error of
> course.
>
> But WHY does the OS logs this into /var/log/messages ?
>
> I have similary machines and these don't do so - crash yes, but not
> notice that within /var/log/messages.
>
>
I just tried it... normal. SEGV's but doesn't trash the kernel.
I have an AMD x86_64 running openSUSE 10.3 at the same kernel
level as you.
It's possible that your problem is caused by something else
though this program makes it visible.
|
| Post Reply
|
| Re: user application error causes kernel segfault |
 |
Sat, 12 Apr 2008 19:36:35 GMT |
bsenf wrote:
>
> Hi,
>
> why does crashing application at user level causes system kernel
> reports segfault ?
> Is this a (new) normal behaviour ?
>
> Example with this wrong code:
>
> #-------------------
> MemoryFault.c
>
> #include <stdio.h>
> int main(int argc, char *argv[])
> {
> printf("ARGC=%d ARGV[0]=%s
> ARGV[1]=%s\n",argc,*argv[0],*argv[1]);
> }
>
> #-------------------
> % gcc -o MemoryFault -c MemoryFault.c
> % ./MemoryFault
>
> % grep Memory /var/log/messages:
>
> Apr 10 12:57:11 gen105 kernel: MemoryFault[28457]: segfault at
> 0000000000000000 rip 00000000080483dd rsp 00000000fff96200 error 4
>
>
> ---------
> OS = openSUSE 10.3
> Kernel = 2.6.22.17-0.1-default x86_x64
The kernel is telling you that it is handling access to memory
which your program is not allowed to.
Kernels do not segfault, they pagefault.
B
--
|
| Post Reply
|
|
|
|
|
|
|
|
|
|