ericsink / SQLitePCL.raw

A Portable Class Library (PCL) for low-level (raw) access to SQLite
Apache License 2.0
523 stars 109 forks source link

Error using double or float values with WebAssembly #480

Closed mark-cb closed 2 years ago

mark-cb commented 2 years ago

Seeing a bug with the latest preview and also see the same bug in Steve Sandersons Blaze Orbital sample when using double/float in entity classes. Works fine with decimals! Tried with EF Core and SQLite-net Simple repro here:

https://github.com/mark-cb/BlazorSQLiteWasm

Seems that the issue is not purely related to the preview version.

Decimals work fine.

Error: /w/1/s/src/mono/mono/mini/aot-runtime-wasm.c:113 /w/1/s/src/mono/mono/mini/aot-runtime-wasm.c:113 Uncaught ExitStatus

ericsink commented 2 years ago

I have modified the title of this issue to clarify that it is Wasm-specific. If that's not true, let me know.

ericsink commented 2 years ago

@bricelam Has this problem caught your eye anywhere yet? I'm having trouble thinking of an idea that doesn't sound dumb (like a compiler bug in emscripten).

I looked at the compiler flags for emscripten but I don't see anything obviously wrong.

My next step in the investigation would be to take the wasm file, write a little code in C to call some basic SQLite functions, compile the whole thing to wasm, and try running it under wasmtime. Just to verify that the sqlite.wasm file is legit.

bricelam commented 2 years ago

Sounds like an issue with interop in the .NET Wasm runtime. @mark-cb can you file an issue on dotnet/runtime so they can investigate?

mark-cb commented 2 years ago

Issue reported with dotnet/runtime here: https://github.com/dotnet/runtime/issues/67970

ericsink commented 2 years ago

AFAICT, this was resolved by a change in dotnet/runtime.