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

Race condition in presentation compiler askTypeAt #8135

Open
scabug opened this issue Jan 10, 2014 · 5 comments
Open

Race condition in presentation compiler askTypeAt #8135

scabug opened this issue Jan 10, 2014 · 5 comments

Comments

@scabug
Copy link

@scabug scabug commented Jan 10, 2014

As this PR demonstrates, there is a race condition when askTypeAt(pos) is called on implicitly[Foo[A]].foo where pos is matches the end point of the former expression. The issue is that the returned Tree is unattributed, which is why the error No symbol is associated with tree implicitly[Foo[A]].foo is reported.

I'm going to move the spuriously failing test in pending, but would be good to look at it at some point.

@scabug
Copy link
Author

@scabug scabug commented Jan 10, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8135?orig=1
Reporter: @dotta
Affected Versions: 2.11.0-M8
See #7558

@scabug
Copy link
Author

@scabug scabug commented Jan 10, 2014

@dotta said:
PR for disabling the test scala/scala#3349

@scabug
Copy link
Author

@scabug scabug commented Jan 10, 2014

@retronym said:
I can reproduce it locally by making a bunch of copies of the test and letting partest have at them:

 % for i in {1..20}; do cp -R test/files/presentation/context-bounds1 test/files/presentation/context-bounds1_$i; cp test/files/presentation/context-bounds1.check test/files/presentation/context-bounds1_$i.check; done
% ./test/partest test/files/presentation/context-bounds1_*

# starting 20 tests in presentation
ok  1 - presentation/context-bounds1_12
ok  2 - presentation/context-bounds1_14
ok  3 - presentation/context-bounds1_13
ok  4 - presentation/context-bounds1_15
ok  5 - presentation/context-bounds1_16
ok  6 - presentation/context-bounds1_1
ok  7 - presentation/context-bounds1_11
ok  8 - presentation/context-bounds1_10
ok  9 - presentation/context-bounds1_2
ok 10 - presentation/context-bounds1_4
!! 11 - presentation/context-bounds1_20           [output differs]
ok 12 - presentation/context-bounds1_5
ok 13 - presentation/context-bounds1_17
ok 14 - presentation/context-bounds1_18
ok 15 - presentation/context-bounds1_19
ok 16 - presentation/context-bounds1_3
ok 17 - presentation/context-bounds1_6
ok 18 - presentation/context-bounds1_7
ok 19 - presentation/context-bounds1_8
ok 20 - presentation/context-bounds1_9
# 19/20 passed, 1 failed in presentation

% cat /Users/jason/code/scala/test/files/presentation/context-bounds1_20-presentation.log | tail
================================================================================
[response] found askHyperlinkPos for `A` at (4,12) ContextBounds.scala
================================================================================

No symbol is associated with tree: implicitly[Foo[A]].foo

askHyperlinkPos for `A` at (10,14) ContextBounds.scala
================================================================================
[response] found askHyperlinkPos for `A` at (9,11) ContextBounds.scala
================================================================================

@scabug
Copy link
Author

@scabug scabug commented Jan 10, 2014

@retronym said:
When it works, we see this tree as found by interactive.Global#signalDone

scala.this.Predef.implicitly[Foo[A]](evidence$7).foo

When it fails, we see:

implicitly[Foo[A]].foo(x$7)

Find the "x$7", and we'll be close the the culprit. Hopefully this will just entail a refinement of the fix for #7558.

@scabug
Copy link
Author

@scabug scabug commented Jan 10, 2014

@retronym said:
Trying to capture some logging: https://gist.github.com/retronym/8351926

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants