Skip to content
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

Add missing __builtin_clz definition for MSVC #1808

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

MasterDuke17
Copy link
Contributor

@MasterDuke17 MasterDuke17 force-pushed the add_missing___builtin_for_msvc branch 2 times, most recently from ae5d3cb to 214c3fb Compare May 22, 2024 01:13
@MasterDuke17
Copy link
Contributor Author

@MasterDuke17 MasterDuke17 force-pushed the add_missing___builtin_for_msvc branch from 2fcfe0b to 9e3ee7f Compare May 31, 2024 12:29
@timo
Copy link
Member

timo commented May 31, 2024

do you know that the name exists in the dll for sure? maybe something changed somewhere. you should be able to use dumpbin.exe /ALL D:\a\1\rakudo\13-cpp-mangling.dll and dumpbin.exe /ALL D:\a\1\rakudo\11-cpp.dll and somewhere in there we should see the symbols we're not getting successfully

@MasterDuke17
Copy link
Contributor Author

do you know that the name exists in the dll for sure? maybe something changed somewhere. you should be able to use dumpbin.exe /ALL D:\a\1\rakudo\13-cpp-mangling.dll and dumpbin.exe /ALL D:\a\1\rakudo\11-cpp.dll and somewhere in there we should see the symbols we're not getting successfully

I think the nativecall errors are unrelated to this change. But if you can explain https://dev.azure.com/MoarVM/MoarVM/_build/results?buildId=1436&view=logs&j=d36c29d8-9236-5cd5-d848-768a0b8a3eb3&t=d8ee4cfd-785a-54f9-bf7e-80664ee220b4&l=34 I would most grateful. If I pull our i64toa_jeaiii out into a separate file and run it with 1449334664 it's just fine. Is this a windows-only problem?

@MasterDuke17
Copy link
Contributor Author

I think the nativecall errors are unrelated to this change. But if you can explain dev.azure.com/MoarVM/MoarVM/_build/results?buildId=1436&view=logs&j=d36c29d8-9236-5cd5-d848-768a0b8a3eb3&t=d8ee4cfd-785a-54f9-bf7e-80664ee220b4&l=34 I would most grateful. If I pull our i64toa_jeaiii out into a separate file and run it with 1449334664 it's just fine. Is this a windows-only problem?

And if I build this branch locally (with all the extra checks and debug fprintfs) it builds just fine without printing anything.

@patrickbkr
Copy link
Member

The native call thing is tracked over in: rakudo/rakudo#5587, I'm pretty sure that's a different issue.

@timo
Copy link
Member

timo commented May 31, 2024

i don't have the brain power right now to actually look deeply at anything, but this looks kind of suspicious?

image

but probably just something you put in for debugging purposes?

@MasterDuke17
Copy link
Contributor Author

i don't have the brain power right now to actually look deeply at anything, but this looks kind of suspicious?

image

but probably just something you put in for debugging purposes?

Well, that definitely needs to be clarified, but it shouldn't be the cause. That's just to figure out how big of a string to allocate, but even writing into a definitely-big-enough stack-allocated string initialized to all 0 ends up wrong.

@timo
Copy link
Member

timo commented May 31, 2024

not sure if this does anything, but try %lld instead of %ld in the printf, maybe that's causing a problem?

@timo
Copy link
Member

timo commented May 31, 2024

yeah at least some of the numbers in the debug output are suspiciously 31 bits long and then a much longer number for the output of m and m2

@Cellesti
Copy link

Cellesti commented Jun 1, 2024

Maybe this could be related. After finding some test failures in t/nqp/115-nums.t on 32-bit Alpine Linux, i too placed an fprintf in MVM_coerce_i_s (but i put it before the call to MVM_malloc).

What i found was, the tests sometime cause i to take on a value of -9223372036854775808 (INT64_MIN), which a few steps later causes mag[msb] to access past the end of mag.

I mentioned my observations with a bit more detail here.

@MasterDuke17
Copy link
Contributor Author

Maybe this could be related. After finding some test failures in t/nqp/115-nums.t on 32-bit Alpine Linux, i too placed an fprintf in MVM_coerce_i_s (but i put it before the call to MVM_malloc).

What i found was, the tests sometime cause i to take on a value of -9223372036854775808 (INT64_MIN), which a few steps later causes mag[msb] to access past the end of mag.

I mentioned my observations with a bit more detail here.

This is probably helpful information, thanks.

I wonder if we can easily add 32-bit Alpine Linux to our CI pipeline?

@Cellesti
Copy link

Cellesti commented Jun 1, 2024

Alpine itself uses Gitlab for CI, which is where i first noticed this issue, while trying to upgrade Rakudo and its dependencies.

As for Github, an Alpine developer has this project which you may find helpful: https://github.com/jirutka/setup-alpine

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.

None yet

4 participants