Skip to content
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

SQLite3 Multiple Ciphers v2.0.0 problem using LINUX Os #186

Closed
rossanoparis opened this issue Jan 4, 2025 · 6 comments
Closed

SQLite3 Multiple Ciphers v2.0.0 problem using LINUX Os #186

rossanoparis opened this issue Jan 4, 2025 · 6 comments

Comments

@rossanoparis
Copy link

With the latest version v2.0.0 and LINUX OS, I get a runtime error and the application crashes.
Using MSW everithig works fine even using the v2.0.0
I didn't notice this kind of behavior using previous versions, for instance the v1.9.2 works fine on both OSs

I think the "problem" is due to mcRegisterCodecExtensions
Below some information regarding the issue.

OS information
CPU Cores: 6
CPU architecture: x86_64
OS Description: Linux 5.4.0-150-generic x86_64
Linux info: Linuxmint - tricia - 19.3
Desktop info: X-CINNAMON

Stack

...
    <frame level="4" function="mcRegisterCodecExtensions" offset="0" address="0x7f4485e92c58" file="sqlite3mc_amalgamation.c" line="0"/>
    <frame level="5" function="openDatabase" offset="0" address="0x7f4485f3e4dd" file="sqlite3mc_amalgamation.c" line="0"/>
...
@utelle
Copy link
Owner

utelle commented Jan 4, 2025

With the latest version v2.0.0 and LINUX OS, I get a runtime error and the application crashes.

Thanks for reporting the issue. I will look into it. Most likely it is more or less the same issue as reported for wxSQLite3 (which uses SQLite3MultipleCiphers under the hood).

Using MSW everithig works fine even using the v2.0.0 I didn't notice this kind of behavior using previous versions, for instance the v1.9.2 works fine on both OSs

It is a bit strange that these crashes occur, because the library is tested under Ubuntu via GitHub CI. And the CI runs work without reporting any issues.

I think the "problem" is due to mcRegisterCodecExtensions Below some information regarding the issue.

OS information CPU Cores: 6 CPU architecture: x86_64 OS Description: Linux 5.4.0-150-generic x86_64 Linux info: Linuxmint - tricia - 19.3 Desktop info: X-CINNAMON

Stack

    <frame level="4" function="mcRegisterCodecExtensions" offset="0" address="0x7f4485e92c58" file="sqlite3mc_amalgamation.c" line="0"/>
    <frame level="5" function="openDatabase" offset="0" address="0x7f4485f3e4dd" file="sqlite3mc_amalgamation.c" line="0"/>

Thanks for the details. I hope I will be able to reproduce the problem in my development environment somehow. Otherwise it will be very difficult to track down the cause of the crashes.

@utelle
Copy link
Owner

utelle commented Jan 4, 2025

I made some tests under Ubuntu 24.04.1 and Linux Mint 22. Up to now I was not able to reproduce the issue, unfortunately.

Could you please try/test the following:

  • Compile the library with the additional compile time option -DHAVE_CIPHER_AEGIS=0. This excludes the new cipher scheme. Then check whether the error still occurs or not.
  • Compile the SQLite shell and check whether it crashes or not.
  • I assume you experience the crash in your own application. If possible provide the code for a minimal sample which still crashes on your system.

@rossanoparis
Copy link
Author

rossanoparis commented Jan 5, 2025

Thank you @utelle I made other tests

The original sqlite library v3.47.2 without any ancryption feature, works fine.
The Open SQLite3 Multiple Ciphers v2.0.0 works fine only using the compile time option -DHAVE_CIPHER_AEGIS=0
(which is the actual way I use to build the latest v2.0.0)

Unfortunatelly I can't provide a minimal sample useful to debug the library as I'm using it in a dynamic library (plug-in)
All I'm able to tell is, the application crashes by calling the function sqlite3_open_v2 which is in the dynamic library.
I have been using that function in the same way for many years; I didn't change anything from my side ...

I normally build the library using the following compile time options
(and using those options without the last you suggested, I get the crash)

SQLITE_OMIT_DEPRECATED
SQLITE_OMIT_PROGRESS_CALLBACK
SQLITE_OMIT_SHARED_CACHE
SQLITE_DEFAULT_MEMSTATUS=0
SQLITE_DEFAULT_WAL_SYNCHRONOUS=1
SQLITE_USER_AUTHENTICATION=0
SQLITE_THREADSAFE=1
SQLITE_TEMP_STORE=1
SQLITE_DQS=0
SQLITE_USE_URI

(this one is the last I added following your suggetion)
HAVE_CIPHER_AEGIS=0

@utelle
Copy link
Owner

utelle commented Jan 5, 2025

The original sqlite library v3.47.2 without any ancryption feature, works fine. The Open SQLite3 Multiple Ciphers v2.0.0 works fine only using the compile time option -DHAVE_CIPHER_AEGIS=0 (which is the actual way I use to build the latest v2.0.0)

Thanks for confirming that it works without the AEGIS cipher.

This was also confirmed by another user (see thothix/guayadeque#34). With his assistance I try to track down the cause of the crash.

Unfortunatelly I can't provide a minimal sample useful to debug the library as I'm using it in a dynamic library (plug-in)

No problem. With the help of the other user we found out that the minimal sample application coming with wxSQLite3 also exhibits the crash. So, we have a small test application which makes it easier to perform further tests, until the crash cause has been found.

All I'm able to tell is, the application crashes by calling the function sqlite3_open_v2 which is in the dynamic library. I have been using that function in the same way for many years; I didn't change anything from my side ...

All I can say at the moment is that the presence of the AEGIS code seems to provoke the crash. I don't know yet why, but I'm confident that the problem will be solved in a hopefully not so far future.

(this one is the last I added following your suggetion) HAVE_CIPHER_AEGIS=0

This is definitely a workaround as long as the new cipher scheme is not needed.

utelle added a commit that referenced this issue Jan 6, 2025
utelle added a commit that referenced this issue Jan 6, 2025
- Based on SQLite version 3.47.2
- Fixed issue #186
@utelle
Copy link
Owner

utelle commented Jan 6, 2025

Release 2.0.1 fixes the issue.

@utelle utelle closed this as completed Jan 6, 2025
@rossanoparis
Copy link
Author

Release 2.0.1 fixes the issue.

Thank you very much

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