develooper Front page | perl.perl5.porters | Postings from February 2003

Re: Smoke 18501 linux 2.4.18-bf2.4 /home/abigail/Src/perl-current

Thread Previous | Thread Next
From:
hv
Date:
February 10, 2003 18:34
Subject:
Re: Smoke 18501 linux 2.4.18-bf2.4 /home/abigail/Src/perl-current
Message ID:
200302110230.h1B2Ubu31717@crypt.compulink.co.uk
Nicholas Clark <nick@ccl4.org> wrote:
:On Thu, Jan 23, 2003 at 02:02:18PM +0100, Slaven Rezic wrote:
:> Nicholas Clark <nick@ccl4.org> writes:
:
:> > Odd. Id've' expected it to fail for Andreas as well, as I thought it was a
:> > glibc 2.2.5 bug that we've not yet worked around. I know it's open as
:> > 
:> > http://rt.perl.org/rt2/Ticket/Display.html?id=9402&user=guest&pass=guest
:> > 
:> > and possibly as other bugs. I think what never happened was noone has yet
:> > written a Configure test to conditionally enable Radu Greab's proposed
:> > work around. (see bug report)
:> > 
:> 
:> Here's a patch for the implementation of (3) (your suggestion from
:> Wed, 29 May 2002 09:38:58):
:
:But I don't like option 3 as much as options 1 & 2
:[1: Detect this at Configure time? 2: Work round it?]

As pointed out by Slaven, the problem is that at the time we build perl
we can determine only that the workaround may be needed, not that it
will be.

Perhaps the right solution is, when prompted by the hint file, to compile
_two_ pp_i_modulo functions, one with and one without the workaround, and
use a runtime probe to decide which one to use:

#ifdef MAYBE_LIBC_MODULO_BUG
  /* use slower safer i_modulo only if this libc is buggy */
  if ((IV)3 % (IV)-10 == (IV)-3)
    PL_ppaddr[OP_I_MODULO] = &Perl_pp_safe_i_modulo;
#endif

Is that a workable solution? It seems like a quick enough check to do
once per perl interpreter. I'm not entirely sure where the check should
happen, but clearly it needs to be quite early.

Hugo

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About