-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
emmalloc_trim broken since #13442? #23343
Comments
I believe this function has no been working correctly since emscripten-core#13442 when sbrk stopped accepting negative values. Maybe we can find a way to bring this functionality back but disabling it for now seems safest. See: emscripten-core#23343
Where do you see that sbrk does not accept negative values? Looking through the code I failed to find anything obvious. |
You can see from the expected output of the test.. sbrk could be reduced before but not after. I think its because the increment that sbrk was interpreted as signed before and unsigned after. Whatever the reason the side effect can clearly be seen in the test expectations, or by enabling |
|
Actually real problem is probably |
(I commented in #13442 before seeing this, but as I said there, does wrapping mean that the cast to unsigned is ok?) |
@juj I'd be happy to see |
It looks like
emmalloc_trim
has been broken since #13442. Prior to that change the result of sbrk would reduce intest_emmalloc_trim
test but after that change the expecations were updated to reflect an sbrk that never goes down, and indeed if I run that test with-sASSERTIONS=2
I see that this assertion fires every time:emscripten/system/lib/emmalloc.c
Line 1277 in 6b81620
Basically it looks like sbrk no longer accepts negative values.. which I think was an indended part of #13442. So maybe emmalloc_trim cannot be implement using sbrk along? We would need some kind of new internal function such as sbrk_shrink to make it work?
The text was updated successfully, but these errors were encountered: