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

guayadeque-0.6.2 crashes on Fedora 41 with new version of wxsqlite3-4.10.0 #34

Closed
martinkg opened this issue Jan 2, 2025 · 25 comments
Closed

Comments

@martinkg
Copy link

martinkg commented Jan 2, 2025

Hi,

I have compiled and installed wxsqlite3-4.10.0 for Fedora 41. I have also recompiled and installed guayadeque-0.6.2.
Now guayadeque crashes and a guayadeque.xml with the following content is created.

<?xml version="1.0" encoding="UTF-8"?>
<report version="1.0" kind="exception">
  <system description="Linux 6.12.7-200.fc41.x86_64 x86_64"/>
  <modules>
    <module path="[heap]" address="0x5565e4f70000" size="0x7b1000"/>
    <module path="/memfd:gdk-wayland" address="0x7fd6bc106000" size="0x87000"/>
    <module path="/memfd:wayland-cursor" address="0x7fd6cc9bb000" size="0x90000"/>
    <module path="/run/user/1000/dconf/user" address="0x7fd6d39da000" size="0x1000"/>
    <module path="[vvar]" address="0x7fd6d39fc000" size="0x4000"/>
    <module path="[stack]" address="0x7ffc2e09c000" size="0x21000"/>
  </modules>
  <stack>
    <frame level="0" offset="0x89409" address="0x5565bb989409" module="guayadeque"/>
    <frame level="1" offset="0x135574" address="0x7fd6d3735574" module="/lib64/libwx_baseu-3.2.so.0"/>
    <frame level="2" offset="0x1a090" address="0x7fd6d1626090" module="/lib64/libc.so.6"/>
    <frame level="3" offset="0x194394" address="0x7fd6d2394394" module="/lib64/libwxcode_gtk3u_wxsqlite3-3.2.so.0"/>
    <frame level="4" offset="0xc8569" address="0x7fd6d22c8569" module="/lib64/libwxcode_gtk3u_wxsqlite3-3.2.so.0"/>
    <frame level="5" function="wxSQLite3Database::Open(wxString const&amp;, wxMemoryBuffer const&amp;, int, wxString const&amp;)" offset="0x253" address="0x7fd6d237cee3" module="/lib64/libwxcode_gtk3u_wxsqlite3-3.2.so.0"/>
    <frame level="6" function="wxSQLite3Database::Open(wxString const&amp;, wxString const&amp;, int, wxString const&amp;)" offset="0x1ff" address="0x7fd6d237d63f" module="/lib64/libwxcode_gtk3u_wxsqlite3-3.2.so.0"/>
    <frame level="7" offset="0xafdee" address="0x5565bb9afdee" module="guayadeque"/>
    <frame level="8" offset="0xb0071" address="0x5565bb9b0071" module="guayadeque"/>
    <frame level="9" offset="0x8b4d0" address="0x5565bb98b4d0" module="guayadeque"/>
    <frame level="10" function="wxEntry(int&amp;, wchar_t**)" offset="0x92" address="0x7fd6d369bcd2" module="/lib64/libwx_baseu-3.2.so.0"/>
    <frame level="11" offset="0x7b4de" address="0x5565bb97b4de" module="guayadeque"/>
    <frame level="12" offset="0x3248" address="0x7fd6d160f248" module="/lib64/libc.so.6"/>
    <frame level="13" function="__libc_start_main" offset="0x8b" address="0x7fd6d160f30b" module="/lib64/libc.so.6"/>
    <frame level="14" offset="0x7f2a5" address="0x5565bb97f2a5" module="guayadeque"/>
  </stack>
</report>

gdb backtrace:

Thread 1 "guayadeque" received signal SIGILL, Illegal instruction.
0x00007ffff6994394 in sqlite3mcInitCipherTables () at src/sqlite3mc_amalgamation.c:353689
353689	    globalCodecDescriptorTable[n] = mcSentinelDescriptor;
(gdb) bt
#0  0x00007ffff6994394 in sqlite3mcInitCipherTables () at src/sqlite3mc_amalgamation.c:353689
#1  sqlite3mc_initialize.constprop.0 (arg=0x0) at src/sqlite3mc_amalgamation.c:353725
#2  0x00007ffff68c8569 in openDatabase (zFilename=0x5555562ac0b0 "/home/martin/.guayadeque/cache.db", ppDb=0x7fffffffae40, flags=<optimized out>, zVfs=0x0) at src/sqlite3mc_amalgamation.c:184536
#3  0x00007ffff697cee3 in wxSQLite3Database::Open (this=this@entry=0x5555561bbad0, fileName=..., key=..., flags=flags@entry=6, vfs=...) at src/wxsqlite3.cpp:2683
#4  0x00007ffff697d63f in wxSQLite3Database::Open (this=this@entry=0x5555561bbad0, fileName=..., key=..., flags=flags@entry=6, vfs=...) at src/wxsqlite3.cpp:2672
#5  0x0000555555603dee in Guayadeque::guDb::Open (this=this@entry=0x55555613e220, dbname=...) at /usr/src/debug/guayadeque-0.6.2-1.fc41.x86_64/src/db/Db.cpp:61
#6  0x0000555555604071 in Guayadeque::guDb::guDb (this=0x55555613e220, dbname=..., this=<optimized out>, dbname=<optimized out>) at /usr/src/debug/guayadeque-0.6.2-1.fc41.x86_64/src/db/Db.cpp:42
#7  0x00005555555df4d0 in Guayadeque::guDbCache::guDbCache (this=0x55555613e220, dbname=...) at /usr/src/debug/guayadeque-0.6.2-1.fc41.x86_64/src/db/DbCache.cpp:31
#8  Guayadeque::guMainApp::OnInit (this=0x555555c03790) at /usr/src/debug/guayadeque-0.6.2-1.fc41.x86_64/src/MainApp.cpp:452
#9  0x00007ffff7c9bcd2 in wxEntry (argc=@0x7ffff7e475a4: 1, argv=<optimized out>) at ../src/common/init.cpp:481
#10 0x00007ffff7c9bd43 in wxEntry (argc=<optimized out>, argv=<optimized out>) at ../src/common/init.cpp:509
#11 0x00005555555cf4de in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/guayadeque-0.6.2-1.fc41.x86_64/src/MainApp.cpp:39
(gdb)

Regards
Martin

@utelle
Copy link

utelle commented Jan 3, 2025

I have compiled and installed wxsqlite3-4.10.0 for Fedora 41.

Unfortunately, I don't have access to a Fedora 41 system. Nevertheless, I'd like to know which wxWidgets version you use on this system. And which compiler.

wxSQLite3 is tested on a Ubuntu platform. I have not experienced such crashes there.

I have also recompiled and installed guayadeque-0.6.2.
Now guayadeque crashes and a guayadeque.xml with the following content is created.

The gdb stack trace shows that the crash happens in the very first initialization function of SQLite3MultipleCiphers. AFAICT there doesn't happen anything that is in any way related to the changes introduced in the new version of the underlying SQLite3MultipleCiphers code. A global structure gets initialized with empty entries (in the very same way as in prior versions). No cipher specific code is executed. I really have no idea what may cause an Illegal instruction exception under these circumstances.

@martinkg
Copy link
Author

martinkg commented Jan 3, 2025

Unfortunately, I don't have access to a Fedora 41 system. Nevertheless, I'd like to know which wxWidgets version you use on this system. And which compiler.

wxGTK-3.2.6-1.fc41.x86_64
wxGTK-devel-3.2.6-1.fc41.x86_64

$ gcc --version
gcc (GCC) 14.2.1 20240912 (Red Hat 14.2.1-3)

@utelle
Copy link

utelle commented Jan 3, 2025

which wxWidgets version ... which compiler.

wxGTK-3.2.6-1.fc41.x86_64 wxGTK-devel-3.2.6-1.fc41.x86_64

$ gcc --version gcc (GCC) 14.2.1 20240912 (Red Hat 14.2.1-3)

Thanks for the information. I'll try to look into the issue. This will take some time, because I have to set up a Fedora environment first.

@utelle
Copy link

utelle commented Jan 5, 2025

I managed to set up a VM with Fedora 41. I compiled wxSQLite3 4.10.0 using the gcc and wxWidgets version you mentioned. The samples coming with wxSQLite3 work without any issues.

I did the same test under Ubuntu 24.04.1 and Linux Mint 22. On all 3 platforms I was not able to reproduce the crashes you observed.

I have not yet tested with guayadeque.

Could you please test the samples coming with wxSQLite3 on your system, and report back whether you experience crashes with them or not?

@martinkg
Copy link
Author

martinkg commented Jan 5, 2025

can you describe in detail what I should do in the samples directory of wxsqlite3-4.10.0 ?

@utelle
Copy link

utelle commented Jan 5, 2025

can you describe in detail what I should do in the samples directory of wxsqlite3-4.10.0 ?

Assuming you have a clean local copy of the wxSQLite3 GitHub repository, you simply build the library with the following commands (this includes building the samples), and then run the samples: minimal sample (command line), treeview (GUI).

autoreconf
mkdir build-test
cd build-test
../configure
make
cd samples
./minimal
cd treeview
./treeview

As said I did not experience any crashes during this build and test process, but that may be different on your system.

@martinkg
Copy link
Author

martinkg commented Jan 5, 2025

same problem as with guayadeque. (fresh wxsqlite3 source no precompiled version installed)

minimal an treeview crashes

Program received signal SIGILL, Illegal instruction.
bt0x00007ffff7ca9e94 in sqlite3mcInitCipherTables () at ../src/sqlite3mc_amalgamation.c:353689
353689	    globalCodecDescriptorTable[n] = mcSentinelDescriptor;
(gdb) bt
#0  0x00007ffff7ca9e94 in sqlite3mcInitCipherTables () at ../src/sqlite3mc_amalgamation.c:353689
#1  sqlite3mc_initialize (arg=0x0) at ../src/sqlite3mc_amalgamation.c:353725
#2  0x00007ffff7d84c9d in wxSQLite3Database::InitializeSQLite () at ../src/wxsqlite3.cpp:4306
#3  0x0000000000406539 in Minimal::OnRun (this=0x4901d0) at ../samples/minimal.cpp:339
#4  0x00007ffff789bc90 in wxEntry (argc=@0x7ffff7a475a4: 1, argv=<optimized out>) at ../src/common/init.cpp:497
#5  0x00007ffff789bd43 in wxEntry (argc=<optimized out>, argv=<optimized out>) at ../src/common/init.cpp:509
#6  0x0000000000403e62 in main (argc=<optimized out>, argv=<optimized out>) at ../samples/minimal.cpp:921

I am perplexed :-(

@utelle
Copy link

utelle commented Jan 5, 2025

In the meantime I built guayadeque in my Fedora 41 VM.

The application did not crash on starting. That makes it difficult to analyze the cause of problems on your system.

I believe that there is a problem, because another user reported a similar problem, but without being able to reproduce the problem, it is really difficult to track down the cause of the crash.

@utelle
Copy link

utelle commented Jan 5, 2025

same problem as with guayadeque. (fresh wxsqlite3 source no precompiled version installed)

minimal an treeview crashes

That is, both crash immediately on starting the application?

Program received signal SIGILL, Illegal instruction.
bt0x00007ffff7ca9e94 in sqlite3mcInitCipherTables () at ../src/sqlite3mc_amalgamation.c:353689
353689	    globalCodecDescriptorTable[n] = mcSentinelDescriptor;
(gdb) bt
#0  0x00007ffff7ca9e94 in sqlite3mcInitCipherTables () at ../src/sqlite3mc_amalgamation.c:353689
#1  sqlite3mc_initialize (arg=0x0) at ../src/sqlite3mc_amalgamation.c:353725
#2  0x00007ffff7d84c9d in wxSQLite3Database::InitializeSQLite () at ../src/wxsqlite3.cpp:4306
#3  0x0000000000406539 in Minimal::OnRun (this=0x4901d0) at ../samples/minimal.cpp:339
#4  0x00007ffff789bc90 in wxEntry (argc=@0x7ffff7a475a4: 1, argv=<optimized out>) at ../src/common/init.cpp:497
#5  0x00007ffff789bd43 in wxEntry (argc=<optimized out>, argv=<optimized out>) at ../src/common/init.cpp:509
#6  0x0000000000403e62 in main (argc=<optimized out>, argv=<optimized out>) at ../samples/minimal.cpp:921

I am perplexed :-(

Me too. Nevertheless, the situation is now far better, because we have a much less complex application for tracking down the problem.

However, I need your assistance, because I don't experience the problem in my development environment.

The first step would be the following test:

autoreconf
mkdir build-test
cd build-test
../configure --without-aegis
make
cd samples
./minimal

That is, excluding the new cipher scheme AEGIS.

My hope and expectation is that the minimal sample does not crash then.

TIA for your assistance.

@martinkg
Copy link
Author

martinkg commented Jan 5, 2025

w/o aegis it runs, see attachement.
minimal.txt

the current wxsqlite3-4.10.0 Fedora rpm package was built with the following config options:
https://src.fedoraproject.org/rpms/wxsqlite3/blob/rawhide/f/wxsqlite3.spec

%configure --enable-shared=yes --enable-static=no --enable-codec=chacha20 \
                     --enable-codec=sqlcipher --enable-codec=rc4 --enable-codec=aes256 \
                     --enable-codec=aes128

@utelle
Copy link

utelle commented Jan 5, 2025

w/o aegis it runs, see attachement.

That's good news. Thanks.

So, let's do the next step. This involves editing the amalgamation. After line 283230 you find the following code section:

#if defined(_MSC_VER)
#    pragma section(".CRT$XCU", read)
static void __cdecl _do_aegis_init(void);
__declspec(allocate(".CRT$XCU")) void (*aegis_init_constructor)(void) = _do_aegis_init;
#else
static void _do_aegis_init(void) __attribute__((constructor));
#endif

static void
_do_aegis_init(void)
{
    (void) aegis_init();
}

Please disable this section:

#if 0 /* Exclude AEGIS initialization */
#if defined(_MSC_VER)
#    pragma section(".CRT$XCU", read)
static void __cdecl _do_aegis_init(void);
__declspec(allocate(".CRT$XCU")) void (*aegis_init_constructor)(void) = _do_aegis_init;
#else
static void _do_aegis_init(void) __attribute__((constructor));
#endif

static void
_do_aegis_init(void)
{
    (void) aegis_init();
}
#endif /* AEGIS initialization */

This code section is the only one that gets executed before anything else happens. This is code from the original AEGIS implementation. Being lazy I kept it, but initialization could be handled in a different way. I don't know whether this code is actually the cause of the crash, but we will hopefully know after the next test.

Now build wxSQLite3 again (without excluding AEGIS this time), and run the minimal sample. Crash or no crash - that's the question. 😓

@martinkg
Copy link
Author

martinkg commented Jan 5, 2025

now I've patched the file src/sqlite3mc_amalgamation.c and build it w/o aegis configure --without-aegis

--- sqlite3mc_amalgamation.c.orig       2025-01-05 14:48:06.274502637 +0100
+++ sqlite3mc_amalgamation.c    2025-01-05 14:31:43.742333768 +0100
@@ -283228,6 +283228,7 @@
     return 0;
 }

+#if 0 /* Exclude AEGIS initialization */
 #if defined(_MSC_VER)
 #    pragma section(".CRT$XCU", read)
 static void __cdecl _do_aegis_init(void);
@@ -283241,6 +283242,7 @@
 {
     (void) aegis_init();
 }
+#endif /* AEGIS initialization */
 /*** End of #include "common/common.c" ***/

 /* #include "common/cpu.c" */

the new test is running fine, see minimal2.txt

@utelle
Copy link

utelle commented Jan 5, 2025

now I've patched the file src/sqlite3mc_amalgamation.c and build it w/o aegis configure --without-aegis

Ah, sorry, I didn't make myself clear enough. The previous test showed that the presence of the AEGIS code was enough to trigger the crash. The patch has only an effect, if the AEGIS code is included again.

Please run the test again, but now WITHOUT the option --without-aegis. That is:

autoreconf
mkdir build-test
cd build-test
../configure
make
cd samples
./minimal

If that doesn't crash, we will know that the crash is either caused by the code excluded by the patch (or by the code executed in function aegis_init()). If the crash does not occur (and that's what I hope for), we will have to do a final test to check whether the code in aegis_init() can cause problems if called from sqlite3mc_initialize(). This test will require another small patch to the amalgamation. I'll describe a bit later what has to be changed.

Thank you very much that you are helping in tracking down the problem.

@martinkg
Copy link
Author

martinkg commented Jan 5, 2025

program minimal (aegis enabled) dumps now with:


Program received signal SIGILL, Illegal instruction.
t0x00007ffff7ca9e54 in sqlite3mcInitCipherTables () at ../src/sqlite3mc_amalgamation.c:353691
353691	    globalCodecDescriptorTable[n] = mcSentinelDescriptor;
(gdb) bt
#0  0x00007ffff7ca9e54 in sqlite3mcInitCipherTables () at ../src/sqlite3mc_amalgamation.c:353691
#1  sqlite3mc_initialize (arg=0x0) at ../src/sqlite3mc_amalgamation.c:353727
#2  0x00007ffff7d84c5d in wxSQLite3Database::InitializeSQLite () at ../src/wxsqlite3.cpp:4306
#3  0x0000000000406539 in Minimal::OnRun (this=0x4901d0) at ../samples/minimal.cpp:339
#4  0x00007ffff789bc90 in wxEntry (argc=@0x7ffff7a475a4: 1, argv=<optimized out>) at ../src/common/init.cpp:497
#5  0x00007ffff789bd43 in wxEntry (argc=<optimized out>, argv=<optimized out>) at ../src/common/init.cpp:509
#6  0x0000000000403e62 in main (argc=<optimized out>, argv=<optimized out>) at ../samples/minimal.cpp:921

@utelle
Copy link

utelle commented Jan 5, 2025

program minimal (aegis enabled) dumps now with:

I'm at a loss. I have no idea why just the presence of the AEGIS code can cause a crash in the initialization function.


Program received signal SIGILL, Illegal instruction.
t0x00007ffff7ca9e54 in sqlite3mcInitCipherTables () at ../src/sqlite3mc_amalgamation.c:353691
353691	    globalCodecDescriptorTable[n] = mcSentinelDescriptor;
(gdb) bt
#0  0x00007ffff7ca9e54 in sqlite3mcInitCipherTables () at ../src/sqlite3mc_amalgamation.c:353691
#1  sqlite3mc_initialize (arg=0x0) at ../src/sqlite3mc_amalgamation.c:353727
#2  0x00007ffff7d84c5d in wxSQLite3Database::InitializeSQLite () at ../src/wxsqlite3.cpp:4306
#3  0x0000000000406539 in Minimal::OnRun (this=0x4901d0) at ../samples/minimal.cpp:339
#4  0x00007ffff789bc90 in wxEntry (argc=@0x7ffff7a475a4: 1, argv=<optimized out>) at ../src/common/init.cpp:497
#5  0x00007ffff789bd43 in wxEntry (argc=<optimized out>, argv=<optimized out>) at ../src/common/init.cpp:509
#6  0x0000000000403e62 in main (argc=<optimized out>, argv=<optimized out>) at ../samples/minimal.cpp:921

The crash happens at the same place as before, when the globalCodecDescriptorTable is filled with empty sentinel entries. Only a few internal SQLite functions are called. None of the encryption functions are called before this point. Especially none belonging to the AEGIS code.

Can you determine the value of n in globalCodecDescriptorTable[n] = mcSentinelDescriptor before the crash happens? Does it happen directly for the first entry ( n=0) or for another value of n?

@martinkg
Copy link
Author

martinkg commented Jan 5, 2025

I really have no idea how to debug this

(gdb) break ../src/sqlite3mc_amalgamation.c:353691
No source file named ../src/sqlite3mc_amalgamation.c.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (../src/sqlite3mc_amalgamation.c:353691) pending.
(gdb) r
Starting program: /home/martin/rpmbuild/BUILD/wxsqlite3/build-test/samples/minimal 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, sqlite3mcInitCipherTables () at ../src/sqlite3mc_amalgamation.c:353691
warning: Source file is more recent than executable.
353691	    globalCodecDescriptorTable[n] = mcSentinelDescriptor;
(gdb) print n
$1 = 0
(gdb) step

Program received signal SIGILL, Illegal instruction.
0x00007ffff7ca9e54 in sqlite3mcInitCipherTables () at ../src/sqlite3mc_amalgamation.c:353691
353691	    globalCodecDescriptorTable[n] = mcSentinelDescriptor;
(gdb) print sizeof(globalCodecDescriptorTable)/sizeof(globalCodecDescriptorTable[0])
$2 = 17
(gdb) print mcSentinelDescriptor
$3 = <optimized out>
(gdb) break ../src/sqlite3mc_amalgamation.c:353691 if n >= <expected maximum>
A syntax error in expression, near `<expected maximum>'.
(gdb) print n
$4 = 0

@utelle
Copy link

utelle commented Jan 5, 2025

I really have no idea how to debug this

Yes, debugging can be tricky sometimes. Sometimes I add debug output to the code (using printf), if debugging with the debugger doesn't work as intended.

(gdb) break ../src/sqlite3mc_amalgamation.c:353691
No source file named ../src/sqlite3mc_amalgamation.c.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (../src/sqlite3mc_amalgamation.c:353691) pending.
(gdb) r
Starting program: /home/martin/rpmbuild/BUILD/wxsqlite3/build-test/samples/minimal 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, sqlite3mcInitCipherTables () at ../src/sqlite3mc_amalgamation.c:353691
warning: Source file is more recent than executable.

Hm, that sounds like the modified source code was not compiled into the executable you are debugging. Please double check that you are debugging the correct version.

353691	    globalCodecDescriptorTable[n] = mcSentinelDescriptor;
(gdb) print n
$1 = 0
(gdb) step

Program received signal SIGILL, Illegal instruction.

I guess this means that the application crashes directly for the first iteration step (with n=0).

0x00007ffff7ca9e54 in sqlite3mcInitCipherTables () at ../src/sqlite3mc_amalgamation.c:353691
353691	    globalCodecDescriptorTable[n] = mcSentinelDescriptor;
(gdb) print sizeof(globalCodecDescriptorTable)/sizeof(globalCodecDescriptorTable[0])
$2 = 17

The value 17 is the correct number of elements in the table.

(gdb) print mcSentinelDescriptor
$3 = <optimized out>
(gdb) break ../src/sqlite3mc_amalgamation.c:353691 if n >= <expected maximum>
A syntax error in expression, near `<expected maximum>'.
(gdb) print n
$4 = 0

Regarding mcSentinelDescriptor I just detected that the initialization structure at line 326574 has too few elements:

static const CipherDescriptor mcSentinelDescriptor =
{
  "", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
};

static const CipherDescriptor mcDummyDescriptor =
{
  "@dummy@", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
};

There are 8 NULL pointers, but the structure has 10 function pointer entries. That is, it should read:

static const CipherDescriptor mcSentinelDescriptor =
{
  "", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
};

static const CipherDescriptor mcDummyDescriptor =
{
  "@dummy@", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
};

It shouldn't make a difference, because typically the compiler should add null values for the missing items automatically, but it's certainly better to specify all values explicitly (although the code obviously worked in prior versions without issues).

I don't know whether the missing values could cause a crash, but maybe it's worth a try to correct those lines.

Another option to code this initialization would be to use memcpy instead of the assignment statement. (However, this is wild guessing what we could try, because I have no idea what could cause an illegal instruction exception in such a simple assignment statement.

@utelle
Copy link

utelle commented Jan 6, 2025

I found another possible cause for the error: The original AEGIS code uses various #pragma GCC target preprocessor instructions for the modules optimized for certain hardware support like AES, AVX, SSE and so on. The original AEGIS library is split into several separate compilation units, and these pragmas affect only the compilation unit in which they are specified.

However, for SQLite3 Multiple Ciphers the AEGIS code is amalgamated into a single compilation unit. That is, the last occurence of a #pragma GCC target can affect all code following the AEGIS code - like the library initialization code. It could be that GCC generates code for the initialization function that doesn't work in the given context, although the CPU supports the used instructions in principle.

I don't know whether this is really the cause of the crash, but to be on the safe side I will go through the code and add #pragma GCC push_options and #pragma GCC pop_options to restrict the effect of #pragma GCC target to the code sections where they belong. If we are lucky that will solve the problem.

@martinkg
Copy link
Author

martinkg commented Jan 6, 2025

hope you will find a solution for this issue.
Many thanks for your investigation.

@utelle
Copy link

utelle commented Jan 6, 2025

hope you will find a solution for this issue.

Me too. I will make the modifications mentioned in previous posts today. I'll let you know when they are available for further testing, because I still need your assistance to test whether the modifications solve the problem or not.

Many thanks for your investigation.

My pleasure. I'm grateful that you reported the issue and that you help to track down the cause and to test modifications.

@utelle
Copy link

utelle commented Jan 6, 2025

I added now GCC push/pop pragmas to the AEGIS code. I keep my fingers crossed that this will solve the problem.

I committed the amalgamated source code to wxSQLite3. @martinkg Could you please give it a try? TIA!

@martinkg
Copy link
Author

martinkg commented Jan 6, 2025

I compiled wxsqlite3-4.10.0 with your patch
and now guayadeque works again without crash.
Many Thanks for your the your cooperation.

Is this the final version of wxsqlite3, or create a new tag version of 4.10.1 ?
I will then create a new rpm package for Fedora of wxsqlite3.

@utelle
Copy link

utelle commented Jan 6, 2025

I compiled wxsqlite3-4.10.0 with your patch and now guayadeque works again without crash.

That's great news! 🎉 Thank you so much for testing and confirming that these patches solve the problem. I'm really relieved!

Is this the final version of wxsqlite3, or create a new tag version of 4.10.1 ?

No, I will make a new release, of course. Later today, or tomorrow.

I will then create a new rpm package for Fedora of wxsqlite3.

Great.

@utelle
Copy link

utelle commented Jan 6, 2025

I just prepared the release of wxSQLite3 4.10.1.

@martinkg
Copy link
Author

martinkg commented Jan 7, 2025

new wxsqlite3-4.10.1 rpm packages have been created for Fedora, the problem has been solved.
https://koji.fedoraproject.org/koji/packageinfo?packageID=14875

Nochmals Danke für Unterstützung Ulli.

@martinkg martinkg closed this as completed Jan 7, 2025
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