Skip to content

Update vswprintf to mussl 1.1.23 #9387

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

Merged
merged 11 commits into from
Sep 24, 2019
Merged

Conversation

VirtualTim
Copy link
Collaborator

Copy-pasted updated source from http://git.musl-libc.org/cgit/musl/tree/src/stdio/vswprintf.c.
Also added a test case for this.
Fixes #9305.

@@ -27,6 +27,9 @@ vswoutput st-rts with 0x74
vsw continues with 0x65
vsw continues with 0x73
test string has 36 wide characters.
PrintBigWide wrote 426 wchars:
test string has 425 wide characters.
Copy link
Collaborator Author

@VirtualTim VirtualTim Sep 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: difference in the above is expected, as "%d" is 2 chars, which gets printed as "425", which is 3 chars.

va_list args;
va_start ( args, format );
wprintf(L"format starts with 0x%x\n", *(int*)format);
wprintf(L"fmt continues with 0x%x\n", *(((int*)format) + 1));
wprintf(L"fmt continues with 0x%x\n", *(((int*)format) + 2));
int r = vswprintf ( buffer, 256, format, args );
int r = vswprintf ( buffer, MAX_CHARS_SMALL-1, format, args );
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the doco the second arg should be the (number of chars in buffer) -1, so I figured I should change that as well.

Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a note to system/lib/libc/README.md

@VirtualTim
Copy link
Collaborator Author

Note really sure what sort of thing I should be writing in that readme, but I took a crack at it. Is this the sort of thing you were after?

@kripken
Copy link
Member

kripken commented Sep 6, 2019

Thanks @VirtualTim, lgtm. Restarted those jobs. Let's also see what @sbc100 thinks of the readme docs.

Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm % nits

@VirtualTim
Copy link
Collaborator Author

Thanks for the review sbc100. I've added the suggested changes.

@VirtualTim
Copy link
Collaborator Author

Test failure was due to missing some exported functions, I think this is due from me merging in Incoming (I think the wasi changes).
test_binaryen_metadce_hello_fastcomp_main_module_1 fails due to missing:

fp$___dn_expand$iiiiii
fp$___stdio_close$ii
fp$___stdio_exit$v
fp$___stdio_read$iiii
fp$___stdio_seek$iiiii
fp$___stdio_write$iiii
fp$___strdup$ii

@sbc100
Copy link
Collaborator

sbc100 commented Sep 12, 2019

These test failures are currently expected.. unless we release a new version of the emsdk which includes that latest fastcomp changes.

@VirtualTim
Copy link
Collaborator Author

@kripken, @sbc100 Anything preventing this being merged?

@kripken
Copy link
Member

kripken commented Sep 23, 2019

I think merging in latest incoming will fix those errors. Then we can merge it. Sorry for the delay!

@@ -1,4 +1,5 @@
This folder contains the musl version of libc at `/musl`. The upstream version can be found at http://www.musl-libc.org/
This folder contains the musl version of libc at `/musl`. The upstream version can be found at http://www.musl-libc.org/.
Most of the source comes from musl 1.1.15. Some is from older versions, but I'm assuming that this is because these files haven't changed between versions.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you drop this last sentence of re-phrase. The last update was indeed to 1.1.15 in #4813.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@VirtualTim
Copy link
Collaborator Author

VirtualTim commented Sep 24, 2019

Merged in the latest incoming, and now 2 SIMD tests are failing.
😞

@kripken
Copy link
Member

kripken commented Sep 24, 2019

Odd error - I saw it myself last night too. But it's not happening on incoming, and can't be related to this PR. Seems ok to land this. Thanks!

@kripken kripken merged commit 29a05c0 into emscripten-core:incoming Sep 24, 2019
@VirtualTim VirtualTim deleted the patch-3 branch September 25, 2019 02:43
belraquib pushed a commit to belraquib/emscripten that referenced this pull request Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vswprintf and swprintf produce incorrect result when over 255 wchars
3 participants