-
-
Notifications
You must be signed in to change notification settings - Fork 421
Conversation
|
When I was debugging these issues, conclusion was that it is dmd optimization bug related to bit shifting (I was unable to reproduce bugs when druntime was compiled without -O -inline). |
|
My conclusion is |
| { | ||
| pn -= pool.bPageOffsets[pn]; | ||
| biti = pn * (PAGESIZE >> pool.shiftBy); | ||
| } | ||
| else // bins == B_FREE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be an assert(bins == B_FREE).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I was just following examples from https://github.com/D-Programming-Language/druntime/blob/master/src/gc/gc.d#L1635 and https://github.com/D-Programming-Language/druntime/blob/master/src/gc/gc.d#L2298 I suppose they're making the assumption of the position of B_FREE in the anonymous enum.
I'll add the assert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implicit assumptions are never a good idea.
If I had added an assertion for bins == B_PAGEPLUS when writing isMarked we would have found the bug earlier.
- The test isn't 100% reliable because it depends on the GC and array append cache state.
|
I send you a pull request which adds a regression test (Safety0ff#1). |
regression test for Issue 10701
http://d.puremagic.com/issues/show_bug.cgi?id=10701
http://d.puremagic.com/issues/show_bug.cgi?id=10838
I'm not sure how to add tests to druntime.