-
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
Upgrade MUSL Version #7279
Comments
I added some docs for how to do that now, see #7286. Let me know if that helps or if anything still isn't clear. |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant. |
We should do this. |
Please do.
|
Fixes an issue noted in #7279 (comment)
@nhooyr we updated that file specifically now to fix that issue. A full update of musl is still very important to do, hopefully someone volunteers to take the time soon! |
+1 for full update of musl. fwiw, it looks like Details
( |
I wonder, I see that @kripken has updated many of the MUSL in #11215, yet I'm still getting the same buffer overrun issue mentioned in #7279 (comment) when using asan with Would someone know more about this ? The overrun happens for this code, for instance: char test[] = "12345";
auto target = (char*)malloc(150);
strncpy(target, test, 150); as the destination size is larger, forcing the aligned copy loop to read out of bounds of the A workaround can be to define a method that will override the weak alias of char *strncpy(char * d, const char * s, size_t n)
{
for (; n && (*d=*s); n--, s++, d++);
memset(d, 0, n);
return d;
} |
Does your example repro under asan? if not how have your been detecting it? It would be good to have failing test so we can be sure we've fixed it. |
Yes it does with asan enabled, here's how I reproduced it: emcc \
test.cpp \
-fsanitize=address -s TOTAL_MEMORY=393216000 \
-s DISABLE_EXCEPTION_CATCHING=0 \
--profiling \
-o index.html #include <stdio.h>
#include <emscripten.h>
#include <stdlib.h>
#include <string.h>
int main() {
char test[] = "12345";
auto target = (char*)malloc(150);
strncpy(target, test, 150);
printf("target: %s\n", target);
return 0;
} With the following error:
Where would be the best location to add this repro in tests ? |
I think you could add this alongside In order to run that test with asan you would run |
#12905 should do. It fails when running the test locally. |
I started working to update musl to version 1.2.1 (i.e. latest version as the time of writing), see: It already passes the test suite locally, so expect a PR soon. |
I also had a go at the musl upgrade last week: #13006. Happy to go with your version if they are basically equivalent. |
This allows us to then remove some of our emscripten-specific arch headers that are not longer needed (since they do not differ from the generic version). This is part of making musl updates easier. See #7279
This allows us to then remove some of our emscripten-specific arch headers that are not longer needed (since they do not differ from the generic version). This is part of making musl updates easier. See #7279
This allows us to then remove some of our emscripten-specific arch headers that are not longer needed (since they do not differ from the generic version). This is part of making musl updates easier. See #7279
This allows us to then remove some of our emscripten-specific arch headers that are not longer needed (since they do not differ from the generic version). This is part of making musl updates easier. See #7279
This allows us to then remove some of our emscripten-specific arch headers that are not longer needed (since they do not differ from the generic version). This is part of making musl updates easier. See #7279
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
Hi All,
I'm wondering if there are any plans to upgrade the MUSL libc version? There are a number of printf bugs that have been fixed since 1.1.15.
I tried upgrading it myself but it's non-trivial and there is very little information about the steps needed to do so. I would be willing to try again if I can be provided with a little direction.
The text was updated successfully, but these errors were encountered: