Fix Issue 20375 - RefCounted does not work with checkaction-context#10550
Conversation
|
Thanks for your pull request and interest in making D better, @MoonlightSentinel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + dmd#10550" |
|
The Druntime failure is caused by a dubious lifetime violation in an unittest in Shouldn' t |
18ed3e0 to
707f6c2
Compare
|
Changed to approach to elide the destructor call (as this could execute arbitrary user code and make programs behave differently with CC @PetarKirov, @Geod24 |
707f6c2 to
c0065af
Compare
c0065af to
798a0fc
Compare
|
@RazvanN7 Switched the approach back to marking the temporary as The main problem in EDIT: |
|
Thanks for the fix. I did hit the same issue with dip1000 when using ref temporaries in this PR #10539. The problem is that escape analysis is not implemented for this type of ref variables, I had to fill it in b3a0d96. |
SSoulaimane
left a comment
There was a problem hiding this comment.
objection to the 72h no objection -> merge tag since the CI failure is persistent.
|
BTW is issue 20375 still present? I tested on dmd master and |
Maybe a
Seems like EDIT: E.g. https://auto-tester.puremagic.com/show-run.ghtml?projectid=1&runid=3851526&isPull=true |
bce4903 to
e094d6e
Compare
|
Extended the test case to reliably reproduce the failure in |
|
I suspect the problem is with the Why does the test case use |
|
Theres no lazy in core.atomic yet it still fails to build with the aforementioned error. So lazy is not to blame, its just allows the test to omit redundant try-catch Blocks. Applying @SSoulaimane patch resolves this issue |
e094d6e to
613c57e
Compare
613c57e to
e956812
Compare
|
Included @SSoulaimane patch for demontration purposes |
|
@MoonlightSentinel please give this a force push, there was a network error in one of the testers. |
|
I'm not sure if this should be merged as it includes @SSoulaimane changes to the @WalterBright should probably have a look too. |
804f0fe to
4697a31
Compare
4697a31 to
593a788
Compare
593a788 to
c4706fc
Compare
c4706fc to
5bf5f58
Compare
|
Whats wrong with Windows complaining about |
That's DM makes' way of reporting crashes when executing unittest.exe ;-/ The crash happens in this line: AFAICT an unexpected _d_callfinalizer is called as cleanup in that statement. |
|
Thanks. I guess this is a regression outside of this PR since it passes everything else (and Windows passed previously as well). |
|
I compared the disassembly: the additional call to _d_callfinalizer is not there with master. |
|
The additional calls are in the x64 build, too, but don't cause crashes (but probably still bad). Win32 crashes due to some mismatched calling conventions: no stack cleanup for a call to extern(C) _d_callfinalizer. |
|
Strangely I failed to reproduce this locally but this seems to be a windows codegen issue anyway |
e77d28d to
32485b3
Compare
|
Seems like the DIP 1000 issue got resolved by some other changes! |
|
Whats the status of this? Is it good to go? |
|
I think this is ready |
The hidden temporary was simply blitted (without calling a constructor/postblit) but destructed at the end of the expression.This caused
RefCountedto deallocate the payload a second time.