ericsink / SQLitePCL.raw

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

SQLitePCLRaw.bundle_winsqllite3 cases a UWP ARM64 app to fail to start #503

Open GaryCaldwell opened 1 year ago

GaryCaldwell commented 1 year ago

The app fails to start with the error 'The program '[15380] SQLLiteTestApp.exe' has exited with code 3221225785 (0xc0000139) 'Entry Point Not Found'. The e_sqlite3 bundle seems to at least load.

ericsink commented 1 year ago

Can you post a minimal repro sample project?

GaryCaldwell commented 1 year ago

SQLLiteArmSample.zip

Here you go, I left x64 and Arm64 in the sample. All you have to do is use remote debugger on an Arm64 device and deploy the Arm64 Debug build to it. It will fail to start with the error above. x64 works fine. No code other than a Blank UWP sample auto generated from VS and the inclusion of the latest stable build of your package from Nuget

ericsink commented 1 year ago

Hmmm. Sorry for the slow response on this one.

Yeah, the repro is pretty simple.

I don't have an ARM device for testing, so I'm just looking for things that might be wrong.

The repro sample doesn't even call SQLitePCL to initialize it. Are we sure the error is coming from SQLitePCLRaw? Do you have the full error message?

So, er, Windows on ARM does have a SQLite library, right?

GaryCaldwell commented 1 year ago

Let me see if I can get an Arm device setup for you to access remotely. No promises

"Are you sure....", Never sure but if I remove that package on arm64 the app starts successfully.

Yes there is a winsqlite3.dll in Windows on ARM. Here is a directory listing of c:\windows

image

One other thing of note is if I build for x64 and deploy that to the Arm device it runs. I even added the sample database creation code from your wiki that creates an in memory db and creates a table. And it runs

Gary

ericsink commented 1 year ago

OK. One theory is that even if the SQLitePCLRaw code is not called, the assembly is being loaded, and it is trying to resolve DllImports, and one of them is not found, thus resulting in the entry point not found error.

BTW, that exception. Did it give the name of the entry point which was not found?

The most likely cause for this would be an older version of SQLite.

Would it be possible for you to figure what version of SQLite is used in winsqlite3.dll ?

GaryCaldwell commented 1 year ago

@ericsink I have a remote Arm64 machine ready for you to remotely connect to and debug. Please send me a message at gacald@live.com and I can share connection information.

ericsink commented 1 year ago

@GaryCaldwell Before we do that, please address the questions I asked in the previous comment.

hypermoose commented 1 year ago

@ericsink, The name of the entry point is not listed that I can see. The fileversion for winsqlite3.dll is 3.34.1. Same as my x64 Win11 box. Does that help?

ericsink commented 1 year ago

Humph. It would've been MORE helpful if the version on ARM was different.

This still feels like an attempt to load an entry point that got introduced after 3.34. But the fact that it only happens on ARM doesn't fit very well with that theory.

I need to know the name of the missing entry point. I'll get back to you about setting up the remote thing.