This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/18100] SIGFPE in wordexp/eval_expr_multdiv


https://sourceware.org/bugzilla/show_bug.cgi?id=18100

Carlos O'Donell <carlos at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |carlos at redhat dot com

--- Comment #1 from Carlos O'Donell <carlos at redhat dot com> ---
(In reply to Kostya Serebryany from comment #0)
> % gcc we13.c && ./a.out 
> Floating point exception (core dumped)

It's a QoI issue balanced against performance.

e.g.
[carlos@athas glibc]$ echo $[1/0]
bash: 1/0: division by 0 (error token is "0")

Detecting this failure would likely require some rather complex processing
including running all commands in a child process to isolate the caller from
failures like this. The child would need handle signals gracefully, longjmp
out, and return an error code to the parent, which then also returns an error
code. This however would slow down wordexp, and this API gets used considerably
by mail servers and the like. Therefore I think it's likely the best we're
going to get is what we have today, which is that side-effects of the
evaluation of the expression are observed by the caller, including signals for
things like division by zero.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]