Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Floppage of atomic tests #6492

Closed
p6rt opened this issue Sep 5, 2017 · 7 comments
Closed

Floppage of atomic tests #6492

p6rt opened this issue Sep 5, 2017 · 7 comments

Comments

@p6rt
Copy link

p6rt commented Sep 5, 2017

Migrated from rt.perl.org#132029 (status was 'resolved')

Searchable as RT132029$

@p6rt
Copy link
Author

p6rt commented Sep 5, 2017

From @AlexDaniel

Here's the output when it fails​:

ok 1 - Can do an atomic fetch from a Scalar container
ok 2 - Can do an atomic assign to a Scalar container; returns new value
ok 3 - Atomic fetch after atomic assign shows latest value
ok 4 - Updated value seen by non-atomic too
  1..2
  ok 1 - code dies
  ok 2 - right exception type (X​::TypeCheck​::Assignment)
ok 5 - Cannot atomic assign value of the wrong type
ok 6 - No hang due to incorrect lifting of atomic fetch out of loop
ok 7 - Can do an atomic fetch from an int container
ok 8 - Can do an atomic assign to an int container; returns new value
ok 9 - Atomic int fetch after atomic int assign shows latest value
ok 10 - Updated value seen by non-atomic too
A IntLexRef container does not know how to do an atomic load
  in block <unit> at t/spec/S17-lowlevel/atomic-ops.t line 41

# Looks like you planned 28 tests, but ran 10

I noticed that it fails more often when the system is under load (e.g. when running the spectest). Other than that I don't have any info.

@p6rt
Copy link
Author

p6rt commented Sep 5, 2017

From @AlexDaniel

Oh. A crude way to reproduce it is​:

while :; do clear; PERL6LIB=lib ./perl6-m t/spec/S17-lowlevel/atomic-ops.t || break; done

And just leave it running, it'll fail at some point. Get your system busy with something and it'll fail faster.

On 2017-09-05 00​:14​:11, alex.jakimenko@​gmail.com wrote​:

Here's the output when it fails​:

ok 1 - Can do an atomic fetch from a Scalar container
ok 2 - Can do an atomic assign to a Scalar container; returns new
value
ok 3 - Atomic fetch after atomic assign shows latest value
ok 4 - Updated value seen by non-atomic too
1..2
ok 1 - code dies
ok 2 - right exception type (X​::TypeCheck​::Assignment)
ok 5 - Cannot atomic assign value of the wrong type
ok 6 - No hang due to incorrect lifting of atomic fetch out of loop
ok 7 - Can do an atomic fetch from an int container
ok 8 - Can do an atomic assign to an int container; returns new value
ok 9 - Atomic int fetch after atomic int assign shows latest value
ok 10 - Updated value seen by non-atomic too
A IntLexRef container does not know how to do an atomic load
in block <unit> at t/spec/S17-lowlevel/atomic-ops.t line 41

# Looks like you planned 28 tests, but ran 10

I noticed that it fails more often when the system is under load (e.g.
when running the spectest). Other than that I don't have any info.

@p6rt
Copy link
Author

p6rt commented Sep 5, 2017

From @niner

A golfed version that reliably fails​:

{
  my Int $test-cont = 42;
  ⚛$test-cont;
}
{
  my atomicint $set = 0;
  start { sleep 1; $set ⚛= 1 };
  until ⚛$set { }
}

The important bit is the Int being read atomicly before reading the atomicint. The sleep makes it fail reliably.

@p6rt
Copy link
Author

p6rt commented Sep 5, 2017

From @jnthn

On Tue, 05 Sep 2017 00​:36​:34 -0700, nine@​detonation.org wrote​:

A golfed version that reliably fails​:

{
my Int $test-cont = 42;
⚛$test-cont;
}
{
my atomicint $set = 0;
start { sleep 1; $set ⚛= 1 };
until ⚛$set { }
}

The important bit is the Int being read atomicly before reading the
atomicint. The sleep makes it fail reliably.

And that in turn got it down to being a spesh bug (this golf reliably worked with MVM_SPESH_DISABLE=1), which was that it mis-optimized the call to the wrong multi candidate, due to some bogus logging. Fixed with MoarVM/MoarVM@5bf652e (though the spesh output it isn't too great, so I'll now see if I can do some further tweaks to get it inlining the prefix​:<⚛> for atomicint).

/jnthn

@p6rt
Copy link
Author

p6rt commented Sep 5, 2017

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

@p6rt
Copy link
Author

p6rt commented Sep 5, 2017

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Sep 5, 2017
@p6rt
Copy link
Author

p6rt commented Sep 5, 2017

From @lizmat

FWIW, I couldn’t get this to fail on my MBP *while* running make spectest with TEST_JOBS=8

Perhaps this is OS / CPU / compiler dependent?

On 5 Sep 2017, at 09​:17, Aleks-Daniel Jakimenko-Aleksejev via RT <perl6-bugs-followup@​perl.org> wrote​:

Oh. A crude way to reproduce it is​:

while :; do clear; PERL6LIB=lib ./perl6-m t/spec/S17-lowlevel/atomic-ops.t ||
break; done

And just leave it running, it'll fail at some point. Get your system busy with
something and it'll fail faster.

On 2017-09-05 00​:14​:11, alex.jakimenko@​gmail.com wrote​:

Here's the output when it fails​:

ok 1 - Can do an atomic fetch from a Scalar container
ok 2 - Can do an atomic assign to a Scalar container; returns new
value
ok 3 - Atomic fetch after atomic assign shows latest value
ok 4 - Updated value seen by non-atomic too
1..2
ok 1 - code dies
ok 2 - right exception type (X​::TypeCheck​::Assignment)
ok 5 - Cannot atomic assign value of the wrong type
ok 6 - No hang due to incorrect lifting of atomic fetch out of loop
ok 7 - Can do an atomic fetch from an int container
ok 8 - Can do an atomic assign to an int container; returns new value
ok 9 - Atomic int fetch after atomic int assign shows latest value
ok 10 - Updated value seen by non-atomic too
A IntLexRef container does not know how to do an atomic load
in block <unit> at t/spec/S17-lowlevel/atomic-ops.t line 41

# Looks like you planned 28 tests, but ran 10

I noticed that it fails more often when the system is under load (e.g.
when running the spectest). Other than that I don't have any info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant