From: Manish Regmi <regmi.manish@gmail.com>
To: Jagadeesh Bhaskar P <jbhaskar@hclinsys.com>
Cc: linux-newbie@vger.kernel.org
Subject: Re: further query signal handling!
Date: Mon, 22 Nov 2004 14:54:28 +0545 [thread overview]
Message-ID: <652016d304112201091575fff@mail.gmail.com> (raw)
In-Reply-To: <1101113860.5382.36.camel@myLinux>
On Mon, 22 Nov 2004 14:27:40 +0530, Jagadeesh Bhaskar P
<jbhaskar@hclinsys.com> wrote:
> > You are generating a divide by zero exception (on i386) which is a
> > fault (it means the instruction is restartable). So what happens is
> > you catch an exception and print and return. The same code is
> > restarted again. so processor gets exception again and again.
>
> If the fault was not attached to a function written by me, and leaving
> it to be handled by the kernel, there was no problem. How can that
> happen? Shouldnt the kernel restart the instruction in that case also.
> Why didnt that happen?
>
> --
> With regards,
>
> Jagadeesh Bhaskar P
> R&D Engineer
> HCL Infosystems Ltd
> Pondicherry
> INDIA
In UNIX and like, the exceptions generate UNIX signals. IEEE POSIX
have defined what to do on generation of signals. The signal may have
default action, run user 's signal handler. For SIGFPE signal, The
default action is Abnormal termination of the process. But when you
set your handler, it does not terminate but runs your handler. After
returning from your handler it again tries to execute the faulting
instruction and signal is generate again and so on.
BTW:
For UNIX programming, Advanced UNIX programming by richard stevens is
the Best book (i have ever seen).
Regards Manish
--
Manish Regmi
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
prev parent reply other threads:[~2004-11-22 9:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-22 6:26 Query on SIGFPE handling Jagadeesh Bhaskar P
2004-11-22 7:00 ` Manish Regmi
2004-11-22 7:15 ` Jagadeesh Bhaskar P
2004-11-22 8:24 ` Jagadeesh Bhaskar P
[not found] ` <01ca01c4d071$5b35f080$121aa8c0@ascindia.com>
2004-11-22 9:05 ` Jagadeesh Bhaskar P
2004-11-22 9:19 ` Manish Regmi
2004-11-22 9:26 ` Jagadeesh Bhaskar P
2004-11-22 9:26 ` Manish Regmi
2004-11-22 11:15 ` joy merwin monteiro
[not found] ` <652016d3041122001540a047fd@mail.gmail.com>
[not found] ` <1101113860.5382.36.camel@myLinux>
2004-11-22 9:09 ` Manish Regmi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=652016d304112201091575fff@mail.gmail.com \
--to=regmi.manish@gmail.com \
--cc=jbhaskar@hclinsys.com \
--cc=linux-newbie@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox