Help wanted: Encryption Plugin
Hello I wonder if anyone can help me out for this case I'm trying to build an encryption plugin for mariaDB and I built this https://gist.github.com/Mahmoudgalalz/ae1de7a57f8b9f37056efc2018575ce4 I managed to compile it, but I'm running into an issue when I'm trying to use encrypted option MariaDB [test]> CREATE TABLE test_encrypted (id INT PRIMARY KEY, sensitive_data VARCHAR(255)) ENGINE=InnoDB ENCRYPTED=YES; ERROR 2013 (HY000): Lost connection to server during query MariaDB [test]> CREATE TABLE t1 (a VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=1; ERROR 2006 (HY000): Server has gone away No connection. Trying to reconnect... Connection id: 31 Current database: test ERROR 2013 (HY000): Lost connection to server during query so if anyone can help me out to figure out what is wrong and should I correct or consider would be very much appreciated.
Hi, Mahmoud, Do you have a stack trace from the crash? On Sep 19, Mahmoud Galal via developers wrote:
Hello I wonder if anyone can help me out for this case I'm trying to build an encryption plugin for mariaDB and I built this
https://gist.github.com/Mahmoudgalalz/ae1de7a57f8b9f37056efc2018575ce4
I managed to compile it, but I'm running into an issue when I'm trying to use encrypted option
MariaDB [test]> CREATE TABLE test_encrypted (id INT PRIMARY KEY, sensitive_data VARCHAR(255)) ENGINE=InnoDB ENCRYPTED=YES; ERROR 2013 (HY000): Lost connection to server during query MariaDB [test]> CREATE TABLE t1 (a VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=1; ERROR 2006 (HY000): Server has gone away No connection. Trying to reconnect... Connection id: 31 Current database: test
ERROR 2013 (HY000): Lost connection to server during query
so if anyone can help me out to figure out what is wrong and should I correct or consider would be very much appreciated.
Regards, Sergei Chief Architect, MariaDB Server and security@mariadb.org
Hi Sergei, it only crash when I do install the plugin from the my.cnf Sep 19 14:48:04 testing-mariadb (mariadbd)[113057]: mariadb.service: Referenced but unset environment variable evaluates to an empty string: MYSQLD_OPTS, _WSREP_NEW_CLUS> Sep 19 14:48:04 testing-mariadb mariadbd[113057]: 2024-09-19 14:48:04 0 [Note] Starting MariaDB 10.11.8-MariaDB-0ubuntu0.24.04.1 source revision 3a069644682e336e445039e4> Sep 19 14:48:04 testing-mariadb mariadbd[113057]: 2024-09-19 14:48:04 0 [ERROR] mariadbd: onboardbase: Starting init function Sep 19 14:48:04 testing-mariadb mariadbd[113057]: 2024-09-19 14:48:04 0 [Note] InnoDB: Compressed tables use zlib 1.3 Sep 19 14:48:04 testing-mariadb mariadbd[113057]: 2024-09-19 14:48:04 0 [Note] InnoDB: Number of transaction pools: 1 Sep 19 14:48:04 testing-mariadb mariadbd[113057]: 2024-09-19 14:48:04 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions Sep 19 14:48:04 testing-mariadb mariadbd[113057]: 2024-09-19 14:48:04 0 [Note] InnoDB: Using liburing Sep 19 14:48:04 testing-mariadb mariadbd[113057]: 2024-09-19 14:48:04 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB Sep 19 14:48:04 testing-mariadb mariadbd[113057]: 2024-09-19 14:48:04 0 [Note] InnoDB: Initialized memory pressure event listener Sep 19 14:48:04 testing-mariadb mariadbd[113057]: 2024-09-19 14:48:04 0 [Note] InnoDB: Completed initialization of buffer pool Sep 19 14:48:04 testing-mariadb mariadbd[113057]: 2024-09-19 14:48:04 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes) Sep 19 14:48:04 testing-mariadb mariadbd[113057]: 2024-09-19 14:48:04 0 [Note] InnoDB: End of log at LSN=49372 Sep 19 14:48:04 testing-mariadb mariadbd[113057]: 2024-09-19 14:48:04 0 [Note] InnoDB: 128 rollback segments are active. Sep 19 14:48:04 testing-mariadb mariadbd[113057]: 240919 14:48:04 [ERROR] mysqld got signal 11 ; Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Sorry, we probably made a mistake, and this is a bug. Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Your assistance in bug reporting will enable us to fix this for the next release. Sep 19 14:48:04 testing-mariadb mariadbd[113057]: To report this bug, see https://mariadb.com/kb/en/reporting-bugs Sep 19 14:48:04 testing-mariadb mariadbd[113057]: We will try our best to scrape up some info that will hopefully help Sep 19 14:48:04 testing-mariadb mariadbd[113057]: diagnose the problem, but since we have already crashed, Sep 19 14:48:04 testing-mariadb mariadbd[113057]: something is definitely wrong and this may fail. Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Server version: 10.11.8-MariaDB-0ubuntu0.24.04.1 source revision: 3a069644682e336e445039e48baae9693f9a08ee Sep 19 14:48:04 testing-mariadb mariadbd[113057]: key_buffer_size=134217728 Sep 19 14:48:04 testing-mariadb mariadbd[113057]: read_buffer_size=131072 Sep 19 14:48:04 testing-mariadb mariadbd[113057]: max_used_connections=0 Sep 19 14:48:04 testing-mariadb mariadbd[113057]: max_threads=153 Sep 19 14:48:04 testing-mariadb mariadbd[113057]: thread_count=0 Sep 19 14:48:04 testing-mariadb mariadbd[113057]: It is possible that mysqld could use up to Sep 19 14:48:04 testing-mariadb mariadbd[113057]: key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 468061 K bytes of memory Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Hope that's ok; if not, decrease some variables in the equation. Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Thread pointer: 0x0 Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Attempting backtrace. You can use the following information to find out Sep 19 14:48:04 testing-mariadb mariadbd[113057]: where mysqld died. If you see no messages after this, something went Sep 19 14:48:04 testing-mariadb mariadbd[113057]: terribly wrong... Sep 19 14:48:04 testing-mariadb mariadbd[113057]: stack_bottom = 0x0 thread_stack 0x49000 Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Printing to addr2line failed Sep 19 14:48:04 testing-mariadb mariadbd[113057]: /usr/sbin/mariadbd(my_print_stacktrace+0x32)[0x558f8d8d32e2] Sep 19 14:48:04 testing-mariadb mariadbd[113057]: /usr/sbin/mariadbd(handle_fatal_signal+0x3f9)[0x558f8d4285c9] Sep 19 14:48:04 testing-mariadb mariadbd[113057]: /lib/x86_64-linux-gnu/libc.so.6(+0x45320)[0x7d93b5a45320] Sep 19 14:48:04 testing-mariadb mariadbd[113057]: The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mariadbd/ contains Sep 19 14:48:04 testing-mariadb mariadbd[113057]: information that should help you find out what is causing the crash. Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Writing a core file... Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Working directory at /var/lib/mysql Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Resource Limits: Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Limit Soft Limit Hard Limit Units Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Max cpu time unlimited unlimited seconds Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Max file size unlimited unlimited bytes Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Max data size unlimited unlimited bytes Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Max stack size 8388608 unlimited bytes Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Max core file size 0 unlimited bytes Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Max resident set unlimited unlimited bytes Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Max processes 31628 31628 processes Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Max open files 32768 32768 files Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Max locked memory 524288 524288 bytes Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Max address space unlimited unlimited bytes Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Max file locks unlimited unlimited locks Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Max pending signals 31628 31628 signals Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Max msgqueue size 819200 819200 bytes Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Max nice priority 0 0 Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Max realtime priority 0 0 Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Max realtime timeout unlimited unlimited us Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Core pattern: |/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E Sep 19 14:48:04 testing-mariadb mariadbd[113057]: Kernel version: Linux version 6.8.0-44-generic (buildd@lcy02-amd64-082) (x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-23ubunt> Sep 19 14:48:05 testing-mariadb systemd[1]: mariadb.service: Main process exited, code=dumped, status=11/SEGV this what I got when I try to add it from the my.cnf
Hi, Mahmoud, Unfortunately, this is not very helpful, the stack trace doesn't have any useful frames: On Sep 19, Mahmoud Galal via developers wrote: ...
Sep 19 14:48:04 testing-mariadb mariadbd[113057]: /usr/sbin/mariadbd(handle_fatal_signal+0x3f9)[0x558f8d4285c9] Sep 19 14:48:04 testing-mariadb mariadbd[113057]: /lib/x86_64-linux-gnu/libc.so.6(+0x45320)[0x7d93b5a45320] Sep 19 14:48:04 testing-mariadb mariadbd[113057]: The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mariadbd/ contains ...
May be you can start it in a debugger or something? Not as a service. Regards, Sergei Chief Architect, MariaDB Server and security@mariadb.org
I will try to do that so, once I get something I will update the thread here, thank you
participants (2)
-
Sergei Golubchik
-
ssss.aaa2002@gmail.com