From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=58474 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PZmKK-0002H8-Vc for qemu-devel@nongnu.org; Mon, 03 Jan 2011 10:28:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PZmKJ-0004WQ-KT for qemu-devel@nongnu.org; Mon, 03 Jan 2011 10:28:04 -0500 Received: from mail-wy0-f173.google.com ([74.125.82.173]:43403) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PZmKJ-0004WL-9X for qemu-devel@nongnu.org; Mon, 03 Jan 2011 10:28:03 -0500 Received: by wyg36 with SMTP id 36so14888875wyg.4 for ; Mon, 03 Jan 2011 07:27:58 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20110103151427.20128.15402.malonedeb@soybean.canonical.com> References: <20110103151427.20128.15402.malonedeb@soybean.canonical.com> <20110103151427.20128.15402.malonedeb@soybean.canonical.com> Date: Mon, 3 Jan 2011 12:27:58 -0300 Message-ID: Subject: Re: [Qemu-devel] [Bug 696834] [NEW] FP exception reporting not working on NetBSD host From: Paulo Cezar Content-Type: multipart/alternative; boundary=001485f44c3cff34cd0498f2cb7a List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bug 696834 <696834@bugs.launchpad.net> Cc: qemu-devel@nongnu.org --001485f44c3cff34cd0498f2cb7a Content-Type: text/plain; charset=ISO-8859-1 On Mon, Jan 3, 2011 at 12:14 PM, Paul Goyette <696834@bugs.launchpad.net>wrote: > Public bug reported: > > I recognize that NetBSD is not one of the officially supported host OS. > However, qemu 0.13.0 is available in the NetBSD pkgsrc collection, and > works quite well. Well, with one exception (pun intended): It seems > that Floating Point exceptions don't get reported properly. > > The following code-snippet demonstrates the problem: > > > volatile int flt_signal = 0; > > static sigjmp_buf sigfpe_flt_env; > static void > sigfpe_flt_action(int signo, siginfo_t *info, void *ptr) > { > flt_signal++; > } > > void trigger(void) > { > struct sigaction sa; > double d = strtod("0", NULL); > > if (sigsetjmp(sigfpe_flt_env, 0) == 0) { > sa.sa_flags = SA_SIGINFO; > sa.sa_sigaction = sigfpe_flt_action; > sigemptyset(&sa.sa_mask); > sigaction(SIGFPE, &sa, NULL); > fpsetmask(FP_X_INV|FP_X_DZ|FP_X_OFL|FP_X_UFL|FP_X_IMP); > printf("%g\n", 1 / d); > } > printf("FPE signal handler invoked %d times.\n"); > this printf() does miss an argument :-) > } > > ** Affects: qemu > Importance: Undecided > Status: New > > -- > You received this bug notification because you are a member of qemu- > devel-ml, which is subscribed to QEMU. > https://bugs.launchpad.net/bugs/696834 > > Title: > FP exception reporting not working on NetBSD host > > Status in QEMU: > New > > Bug description: > I recognize that NetBSD is not one of the officially supported host OS. > However, qemu 0.13.0 is available in the NetBSD pkgsrc collection, and > works quite well. Well, with one exception (pun intended): It seems that > Floating Point exceptions don't get reported properly. > > The following code-snippet demonstrates the problem: > > > volatile int flt_signal = 0; > > static sigjmp_buf sigfpe_flt_env; > static void > sigfpe_flt_action(int signo, siginfo_t *info, void *ptr) > { > flt_signal++; > } > > void trigger(void) > { > struct sigaction sa; > double d = strtod("0", NULL); > > if (sigsetjmp(sigfpe_flt_env, 0) == 0) { > sa.sa_flags = SA_SIGINFO; > sa.sa_sigaction = sigfpe_flt_action; > sigemptyset(&sa.sa_mask); > sigaction(SIGFPE, &sa, NULL); > fpsetmask(FP_X_INV|FP_X_DZ|FP_X_OFL|FP_X_UFL|FP_X_IMP); > printf("%g\n", 1 / d); > } > printf("FPE signal handler invoked %d times.\n"); > this printf() does miss an argument :-) > } > > > > --001485f44c3cff34cd0498f2cb7a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Mon, Jan 3, 2011 at 12:14 PM, Paul Goyette <696834@bugs.launchpad.net> wrote:
Public bug reported:

I recognize that NetBSD is not one of the officially supported host OS.
However, qemu 0.13.0 is available in the NetBSD pkgsrc collection, and
works quite well. =A0Well, with one exception (pun intended): It seems
that Floating Point exceptions don't get reported properly.

The following code-snippet demonstrates the problem:


volatile int flt_signal =3D 0;

static sigjmp_buf sigfpe_flt_env;
static void
sigfpe_flt_action(int signo, siginfo_t *info, void *ptr)
{
=A0 =A0 =A0 =A0flt_signal++;
}

void trigger(void)
{
=A0 =A0 =A0 =A0struct sigaction sa;
=A0 =A0 =A0 =A0double d =3D strtod("0", NULL);

=A0 =A0 =A0 =A0if (sigsetjmp(sigfpe_flt_env, 0) =3D=3D 0) {
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0sa.sa_flags =3D SA_SIGINFO;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0sa.sa_sigaction =3D sigfpe_flt_action;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0sigemptyset(&sa.sa_mask);
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0sigaction(SIGFPE, &sa, NULL);
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0fpsetmask(FP_X_INV|FP_X_DZ|FP_X_OFL|FP_X_UF= L|FP_X_IMP);
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0printf("%g\n", 1 / d);
=A0 =A0 =A0 =A0}
=A0 =A0 =A0 =A0printf("FPE signal handler invoked %d times.\n");=

this printf() does miss an argument :-= )
=A0
}

** Affects: qemu
=A0 =A0 Importance: Undecided
=A0 =A0 =A0 =A0 Status: New

--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https:= //bugs.launchpad.net/bugs/696834

Title:
=A0FP exception reporting not working on NetBSD host

Status in QEMU:
=A0New

Bug description:
=A0I recognize that NetBSD is not one of the officially supported host OS.= =A0However, qemu 0.13.0 is available in the NetBSD pkgsrc collection, and = works quite well. =A0Well, with one exception (pun intended): It seems that= Floating Point exceptions don't get reported properly.

The following code-snippet demonstrates the problem:


volatile int flt_signal =3D 0;

static sigjmp_buf sigfpe_flt_env;
static void
sigfpe_flt_action(int signo, siginfo_t *info, void *ptr)
{
=A0 =A0 =A0 =A0flt_signal++;
}

void trigger(void)
{
=A0 =A0 =A0 =A0struct sigaction sa;
=A0 =A0 =A0 =A0double d =3D strtod("0", NULL);

=A0 =A0 =A0 =A0if (sigsetjmp(sigfpe_flt_env, 0) =3D=3D 0) {
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0sa.sa_flags =3D SA_SIGINFO;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0sa.sa_sigaction =3D sigfpe_flt_action;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0sigemptyset(&sa.sa_mask);
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0sigaction(SIGFPE, &sa, NULL);
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0fpsetmask(FP_X_INV|FP_X_DZ|FP_X_OFL|FP_X_UF= L|FP_X_IMP);
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0printf("%g\n", 1 / d);
=A0 =A0 =A0 =A0}
=A0 =A0 =A0 =A0printf("FPE signal handler invoked %d times.\n");=

this printf() does miss an argument :-= )
=A0
}




--001485f44c3cff34cd0498f2cb7a--