SQLitePCL.raw: Incorrect calling convention in UnmanagedCallersOnly
We are using the sqlite3_config_log
API. Apparently somewhere between 2.0.7 and 2.1.0 you switched to use UnmanagedCallersOnly
. Unfortunately, this means the decorated callback now defaults to the platform calling convention which is stdcall
on Windows. The native library (e_sqlite3
) expects cdecl
though. This mismatch causes access violation once the registered callbacks returns back to the native code.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 20 (20 by maintainers)
Commits related to this issue
- revert #507, thus reintroducing #506, because of #516, aka dotnet/runtime#75700 — committed to ericsink/SQLitePCL.raw by ericsink 2 years ago
- an attempt to make a test case for sqlite3_config_log sufficiently complicated to serve as a repro for #516. no luck. calling sqlite3_log() multiple times still seems to work, even when disabling th... — committed to ericsink/SQLitePCL.raw by ericsink 2 years ago
- chg the build script to also run the test suite for net6.0-windows with rid win-x86, to verify the fixes for calling convention of function pointers in #506 — committed to ericsink/SQLitePCL.raw by ericsink 2 years ago
Ah. That makes sense. Yes, quite “complicated”.
I’m working now on reworking your fix to avoid the net6.0-ios problem.
FWIW, version 2.1.1-pre20220822172036 contains this fix. If there are no problems with it, I will publish it as a non-pre release next week. Reopening this issue until I ship a non-pre-release containing its fix.