Raku / old-issue-tracker

Tickets from RT
https://github.com/Raku/old-issue-tracker/issues
2 stars 1 forks source link

42.expmod(-1,1) hangs #6053

Open p6rt opened 7 years ago

p6rt commented 7 years ago

Migrated from rt.perl.org#130713 (status was 'open')

Searchable as RT130713$

p6rt commented 7 years ago

From @lizmat

The combination of parameters -1,1 like this, causes nqp​::expmod_I to hang. Assume this is a MoarVM issue, as this does not appear to be an issue on MoarVM.

Spotted by Dana Jacobsen++

p6rt commented 7 years ago

From @geekosaur

On Fri, Feb 3, 2017 at 4​:33 PM, Elizabeth Mattijsen \< perl6-bugs-followup@​perl.org> wrote​:

Assume this is a MoarVM issue, as this does not appear to be an issue on MoarVM.

...which of those was supposed to be something else?

-- brandon s allbery kf8nh sine nomine associates allbery.b@​gmail.com ballbery@​sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

p6rt commented 7 years ago

The RT System itself - Status changed from 'new' to 'open'

p6rt commented 7 years ago

From @lizmat

On 3 Feb 2017, at 22​:34, Brandon Allbery \allbery\.b@&#8203;gmail\.com wrote​:

On Fri, Feb 3, 2017 at 4​:33 PM, Elizabeth Mattijsen \perl6\-bugs\-followup@&#8203;perl\.org wrote​: Assume this is a MoarVM issue, as this does not appear to be an issue on MoarVM.

...which of those was supposed to be something else?

The second​: there’s no problem on the JVM.

Good catch!

Note to self​: do not do bugreports after having been to Delirium in Brussels. :-)

Liz

p6rt commented 7 years ago

From @lizmat

On 3 Feb 2017, at 22​:34, Brandon Allbery \allbery\.b@&#8203;gmail\.com wrote​:

On Fri, Feb 3, 2017 at 4​:33 PM, Elizabeth Mattijsen \perl6\-bugs\-followup@&#8203;perl\.org wrote​: Assume this is a MoarVM issue, as this does not appear to be an issue on MoarVM.

...which of those was supposed to be something else?

The second​: there’s no problem on the JVM.

Good catch!

Note to self​: do not do bugreports after having been to Delirium in Brussels. :-)

Liz

p6rt commented 7 years ago

From @timo

It seems like we literally just pass the values into libtommath's mp_exptmod.

It then just infinitely loops around inside of fast_mp_invmod.

Perhaps we can see if a newer version of libtommath changed something about that and perhaps fixed our problem?

p6rt commented 7 years ago

From @timo

There's a github issue that relates to this. Applying this change to our tommath makes expmod(42, -1, 1) terminate successfully.

https://github.com/libtom/libtommath/issues/67

p6rt commented 7 years ago

From @AlexDaniel

This was resolved in this commit trio​: https://github.com/rakudo/rakudo/commit/22f00cd72deaaaafbaeb1ad83187309854e33739 https://github.com/perl6/nqp/commit/b083e3471a25bf376fa89b5ec53969b870eb6ac2 https://github.com/MoarVM/MoarVM/commit/1288e7edde60b8c88afb85029dc089092db80168

「testneeded」

On 2017-02-03 15​:04​:00, timo wrote​:

There's a github issue that relates to this. Applying this change to our tommath makes expmod(42, -1, 1) terminate successfully.

https://github.com/libtom/libtommath/issues/67

p6rt commented 7 years ago

From @zoffixznet

On Wed, 04 Oct 2017 22​:20​:49 -0700, alex.jakimenko@​gmail.com wrote​:

This was resolved in this commit trio​: https://github.com/rakudo/rakudo/commit/22f00cd72deaaaafbaeb1ad83187309854e33739 https://github.com/perl6/nqp/commit/b083e3471a25bf376fa89b5ec53969b870eb6ac2 https://github.com/MoarVM/MoarVM/commit/1288e7edde60b8c88afb85029dc089092db80168

「testneeded」

On 2017-02-03 15​:04​:00, timo wrote​:

There's a github issue that relates to this. Applying this change to our tommath makes expmod(42, -1, 1) terminate successfully.

https://github.com/libtom/libtommath/issues/67

Tests added https://github.com/perl6/roast/commit/064707a320

They showed this issue still exists for other combinations, such as​:

  \<Zoffix__> m​: say 42.expmod(-1,7)   \ rakudo-moar 27131e​: OUTPUT​: «(timeout)»