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
fix Issue 21082 - Testsuite fails on OSX (runnable/test16096.sh with … #11510
Conversation
Thanks for your pull request, @WalterBright! Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#11510" |
@jacob-carlborg since you develop on OSX a lot, could you please have a go at seeing where the bug is? Thanks! |
I've done a bit investigation. The reason why it only fails with assertions turned on is that the length of the underlying array ( |
I've done some further investigation. The problem is that the array ( Line 714 in b387646
The Objective-C glue code did not expect that. It caches the segments returned by Lines 357 to 362 in b387646
If I reset the above Lines 229 to 258 in b387646
And initialized and reset here: https://github.com/dlang/dmd/blob/master/src/dmd/backend/machobj.d#L453-L462 I'm open to suggestions how to best solve this. |
Thank you, @jacob-carlborg ! I'll look into how best to solve this. The reset is done for the other symbols, I just have to remember where I put that code! |
Ok, what needs to happen is symbol_reset() must be called on those symbols. This is called by reset_symbols() in machobj.d, which resets symbols in public_symbuf and extern_symbuf, and is called from obj_init(). |
That much I've figured out. The problem is that the symbols are in the glue layer and not the backend. Should those be moved to the backend? I assume the backend shouldn't call the glue layer? |
You're right, the back end shouldn't call the glue layer. But no reason the glue layer can't call a function in the back end and pass it an array of those symbols. |
How do you envision that? It's the backend that initiates the reset of the symbols, not the glue layer. Or should a call to reset the symbols be added here, before this line: Line 714 in 5e7ccd9
|
obj_start() in glue.d is the function you're looking for. |
Oh, I thought that was part of the backend, but I see it's part of the glue layer. I'll take a look, thanks. |
@WalterBright this PR should fix the issue: #11520. |
Closing in favor of #11520 which has |
@jacob-carlborg thank you very much for chasing this down and fixing it! |
…asserts on)
This doesn't actually fix it, just trying to find the bug.