You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function name resolving logic cannot cover all cases when generating them as only '.' is replaced. There should be logic which resembles the C# FixupSymbolName. Otherwise we may resolve pinvoke function name from Assemly-CSharp-firstpass.dll to
Also the function length currently 128 seems not sufficient. I have doubled it to 256. Any consideration here regarding the 128 length?
Reproduction Steps
Having C# functions marked with PInvoke in assembly with - in its name (or other special chars)
Expected behavior
Resolve those chars as understore
Actual behavior
Failed to find those functions in wasm_native_to_interp_map (calling wasm_dl_get_native_to_interp )
Regression?
Yes
Known Workarounds
Implement FixupSymbolName logic in naive code when calling get_native_to_interp so as to keep align with the way it is generated(Module name in particular). And increase the key size limit to 256 for some super long generated functions.
Configuration
.Net8
.Net9
Other information
No response
The text was updated successfully, but these errors were encountered:
Description
When collecting PInvoke in managed code and generate native m2n function, the function naming is following rules like
runtime/src/tasks/WasmAppBuilder/ManagedToNativeGenerator.cs
Line 106 in 3eb8c7f
Regarding special chars, there is a table
runtime/src/tasks/WasmAppBuilder/ManagedToNativeGenerator.cs
Line 39 in 3eb8c7f
With the above logic, the generated function map would only have underscore representing all special chars.
However in interpreter logic, either .Net9
runtime/src/mono/browser/runtime/runtime.c
Line 217 in 3eb8c7f
or .Net8
runtime/src/mono/wasm/runtime/driver.c
Line 407 in 13d578b
The function name resolving logic cannot cover all cases when generating them as only '.' is replaced. There should be logic which resembles the C#
FixupSymbolName
. Otherwise we may resolve pinvoke function name fromAssemly-CSharp-firstpass.dll
toAlso the function length currently 128 seems not sufficient. I have doubled it to 256. Any consideration here regarding the 128 length?
Reproduction Steps
Having C# functions marked with PInvoke in assembly with
-
in its name (or other special chars)Expected behavior
Resolve those chars as understore
Actual behavior
Failed to find those functions in
wasm_native_to_interp_map
(callingwasm_dl_get_native_to_interp
)Regression?
Yes
Known Workarounds
Implement
FixupSymbolName
logic in naive code when callingget_native_to_interp
so as to keep align with the way it is generated(Module name in particular). And increase the key size limit to 256 for some super long generated functions.Configuration
.Net8
.Net9
Other information
No response
The text was updated successfully, but these errors were encountered: