Is it possible to preserve flags for fetestexcept() inside signal handler

Jed Brown jed@59A2.org
Thu Jun 7 21:13:00 GMT 2012


On Thu, Jun 7, 2012 at 3:55 PM, Ángel González <keisial@gmail.com> wrote:
> Maybe it's easier for you to provide a wrapper program which ptraces the
> process and gives the nice output instead of training your users.
> (I think such program could -on some unix- be a thread of your own
> process, but binaries are cheap anyway)

Well, we are just an extensible library that sometimes ends up with
NaN or denormals on our hands due to an error in the user's nonlinear
function evaluation. Because this is so common, we have a run-time
option to set up fp exceptions to help the user find their bugs. (Many
of our users are domain scientists rather than experienced
programmers. They also don't want to learn how to set up exceptions on
each platform themselves.)

An extra process is not a good solution because many of the
architectures we run on do not support spawning threads or forking
processes. Examples include IBM Blue Gene (which runs their own
Compute Node Kernel, not Linux) and Cray which runs a very stripped
down Linux kernel. (There is usually special support for something
ptrace-like, but you have to set the environment specially and it's
not always available to normal user code.)



More information about the Libc-help mailing list