[LTP] [PATCH] syscalls/waitid10: Fix on ARM, PPC and possibly others
Cyril Hrubis
chrubis@suse.cz
Thu Mar 31 15:08:08 CEST 2022
Hi!
> >> I'm wondering if we should branch on the architecture. If it's x86[_64]
> >> then we only do divide by zero as it's reasonable to think that if the
> >> signal is not raised then this is a bug.
> >
> > It's more likely to be a hardware bug/missing feature though. Do we
> > really care? I'd argue that removing the division altogether and just
> > calling raise(SIGFPE) in the child process is all we need in this
> > particular test.
>
> I suppose it depends on if there is a substantial difference in how the
> signal is raised between div by zero and raise. I guess there is some
> configuration to trap the faulting instruction and raise a
> signal.
I guess that in the case of division by zero we end up in the kernel
interrupt handler where the kernel looks up the process that was running
when the interrupt has raised then it queues the signal delivery and so
on.
In the case of raise() we just do sysenter instruction which triggers
different interrupt handler and the rest would be the same we queue the
signal and so on.
Which is why I think that there is some value in triggering the divison
by zero on architectures that enable it by default because we execute
kernel interrupt handler that is rarely being executed.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list