Skip to content

FEATURE_FUNCPTRS/plain breaks when targeting net6.0+ on Windows #573

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

Closed
filipnavara opened this issue Nov 14, 2023 · 1 comment
Closed

Comments

@filipnavara
Copy link
Contributor

FEATURE_FUNCPTRS/plain was introduced in commit 9adcbfc to workaround a bug in iOS AOT compiler. That bug was fixed in .NET 7 and .NET 8 and so the workaround is no longer necessary. We should use FEATURE_FUNCPTRS/callingconv again for generic .NET 6+ platforms.

The issue is that compiling a unit test assembly against generic net6+ target and referencing SQLitePCLRaw.provider.e_sqlite3 on Windows results in using the generic net6.0 version from the NuGet package. That assembly version is missing the CDecl calling convention decorations on UnmanagedCallersOnly attributes and thus results in incorrect calling convention used on x86 platforms. This can be observed when using sqlite3_create_function to register custom functions since the callbacks corrupt the stack and result in access violation.

@ericsink
Copy link
Owner

This was included in 2.1.7, which has been pushed up to nuget.

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

No branches or pull requests

2 participants