#1147503 libsequoia-octopus-librnp: Thunderbird crashes on startup

Package:
libsequoia-octopus-librnp
Source:
libsequoia-octopus-librnp
Description:
Reimplementation of librnp for Thunderbird by Sequoia
Submitter:
Philip Rinn
Date:
2026-09-13 01:09:01 UTC
Severity:
normal
#1147503#5
Date:
2026-09-12 14:34:28 UTC
From:
To:
With version 1.11.1-9, thunderbird 1:140.14.0esr-1 crashes with

Sep 12 16:07:05 debian thunderbird.desktop[31173]: 14:07:05:
sequoia-octopus:
rnp_load_keys: Your Thunderbird is using Sequoia's Octopus, version 1.11.1
Sep 12 16:07:05 debian thunderbird.desktop[31173]: (sequoia-openpgp: 2.3.0).
For details, and to report issues please
Sep 12 16:07:05 debian thunderbird.desktop[31173]: see
https://gitlab.com/sequoia-pgp/sequoia-octopus-librnp .
Sep 12 16:07:05 debian thunderbird.desktop[31173]: 14:07:05:
sequoia-octopus:
rnp_load_keys: Your Thunderbird profile appears to be:
"/home/philip/.thunderbird/gjde70gh.default"
Sep 12 16:07:05 debian thunderbird.desktop[31173]:
ExceptionHandler::GenerateDump attempting to generate:
Sep 12 16:07:05 debian thunderbird.desktop[31173]: <snip>.dmp
Sep 12 16:07:05 debian thunderbird.desktop[31173]:
ExceptionHandler::GenerateDump cloned child 31511
Sep 12 16:07:05 debian thunderbird.desktop[31173]:
ExceptionHandler::SendContinueSignalToChild sent continue signal to child
Sep 12 16:07:05 debian thunderbird.desktop[31511]:
ExceptionHandler::WaitForContinueSignal waiting for continue signal...
Sep 12 16:07:05 debian thunderbird.desktop[31173]:
ExceptionHandler::GenerateDump minidump generation
Sep 12 16:07:05 debian thunderbird.desktop[31173]: succeeded

Reverting back to 1.11.1-8 fixes the issue for me.

I can send the generated mindump if needed.

#1147503#10
Date:
2026-09-13 00:41:31 UTC
From:
To:
owner 1147503 tsimonq2@debian.org
affects 1147503 + src:thunderbird src:rust-rusqlite
thanks

Hello,

I did some digging into this today. I was able to get the relevant backtrace, and I have a good idea on what's happening.

Here's the backtrace:

#0  0x0000000000000000 in ?? ()
#1  0x00007fffde894416 in sqlite3VdbeMemGrow () from /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
#2  0x00007fffde895058 in sqlite3VdbeMemSetText () from /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
#3  0x00007fffde88a9c3 in ?? () from /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
#4  0x00007fffce198d1d in rusqlite::statement::Statement::bind_parameter<&&dyn rusqlite::types::to_sql::ToSql> (self=<optimized out>, param=<optimized out>, ndx=1) at /usr/share/cargo/registry/rusqlite-0.40.2/src/statement.rs:646
#5  0x00007fffce1a9e6c in rusqlite::statement::Statement::bind_parameters<&[&dyn rusqlite::types::to_sql::ToSql; 2]> (self=0x7fffd37fd120, params=0x7fffd37fd2d0) at /usr/share/cargo/registry/rusqlite-0.40.2/src/statement.rs:486
#6  rusqlite::params::{impl#49}::__bind_in<dyn rusqlite::types::to_sql::ToSql> (self=0x7fffd37fd2d0, stmt=0x7fffd37fd120) at /usr/share/cargo/registry/rusqlite-0.40.2/src/params.rs:298
#7  rusqlite::statement::Statement::execute<&[&dyn rusqlite::types::to_sql::ToSql; 2]> (self=0x7fffd37fd120, params=0x7fffd37fd2d0) at /usr/share/cargo/registry/rusqlite-0.40.2/src/statement.rs:109
#8  rusqlite::{impl#3}::execute::{closure#0}<&[&dyn rusqlite::types::to_sql::ToSql; 2]> (stmt=...) at /usr/share/cargo/registry/rusqlite-0.40.2/src/lib.rs:621
#9  core::result::Result<rusqlite::statement::Statement, rusqlite::error::Error>::and_then<rusqlite::statement::Statement, rusqlite::error::Error, usize, rusqlite::{impl#3}::execute::{closure_env#0}<&[&dyn rusqlite::types::to_sql::ToSql; 2]>> (self=..., op=...) at /usr/src/rustc-1.95.0/library/core/src/result.rs:1493
#10 rusqlite::Connection::execute<&[&dyn rusqlite::types::to_sql::ToSql; 2]> (self=0x7fffd37fdb10, sql=..., params=0x7fffd37fd2d0) at /usr/share/cargo/registry/rusqlite-0.40.2/src/lib.rs:621
#11 sequoia_octopus_librnp::wot::WoT::import_validity (managed_by_tb=..., validity=..., tx=<optimized out>) at src/wot.rs:573
#12 sequoia_octopus_librnp::wot::WoT::update (self=0x7fffd37fda78, now=...) at src/wot.rs:497
#13 sequoia_octopus_librnp::wot::WoT::background_thread (self=0x7fffd37fda78) at src/wot.rs:216
#14 0x00007fffce225bbc in sequoia_octopus_librnp::wot::{impl#1}::background_thread_start::{closure#0} () at src/wot.rs:95
#15 std::sys::backtrace::__rust_begin_short_backtrace<sequoia_octopus_librnp::wot::{impl#1}::background_thread_start::{closure_env#0}, ()> (f=...) at /usr/src/rustc-1.95.0/library/std/src/sys/backtrace.rs:166
#16 0x00007fffce236dcc in std::thread::lifecycle::spawn_unchecked::{closure#1}::{closure#0}<sequoia_octopus_librnp::wot::{impl#1}::background_thread_start::{closure_env#0}, ()> () at /usr/src/rustc-1.95.0/library/std/src/thread/lifecycle.rs:91
#17 core::panic::unwind_safe::{impl#23}::call_once<(), std::thread::lifecycle::spawn_unchecked::{closure#1}::{closure_env#0}<sequoia_octopus_librnp::wot::{impl#1}::background_thread_start::{closure_env#0}, ()>> (self=...) at /usr/src/rustc-1.95.0/library/core/src/panic/unwind_safe.rs:274
#18 std::panicking::catch_unwind::do_call<core::panic::unwind_safe::AssertUnwindSafe<std::thread::lifecycle::spawn_unchecked::{closure#1}::{closure_env#0}<sequoia_octopus_librnp::wot::{impl#1}::background_thread_start::{closure_env#0}, ()>>, ()> (data=<error reading variable: Cannot access memory at address 0x0>) at /usr/src/rustc-1.95.0/library/std/src/panicking.rs:581
#19 std::panicking::catch_unwind<(), core::panic::unwind_safe::AssertUnwindSafe<std::thread::lifecycle::spawn_unchecked::{closure#1}::{closure_env#0}<sequoia_octopus_librnp::wot::{impl#1}::background_thread_start::{closure_env#0}, ()>>> (f=...) at /usr/src/rustc-1.95.0/library/std/src/panicking.rs:544
#20 std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<std::thread::lifecycle::spawn_unchecked::{closure#1}::{closure_env#0}<sequoia_octopus_librnp::wot::{impl#1}::background_thread_start::{closure_env#0}, ()>>, ()> (f=...) at /usr/src/rustc-1.95.0/library/std/src/panic.rs:359
#21 std::thread::lifecycle::spawn_unchecked::{closure#1}<sequoia_octopus_librnp::wot::{impl#1}::background_thread_start::{closure_env#0}, ()> () at /usr/src/rustc-1.95.0/library/std/src/thread/lifecycle.rs:89
#22 core::ops::function::FnOnce::call_once<std::thread::lifecycle::spawn_unchecked::{closure_env#1}<sequoia_octopus_librnp::wot::{impl#1}::background_thread_start::{closure_env#0}, ()>, ()> () at /usr/src/rustc-1.95.0/library/core/src/ops/function.rs:250
#23 0x00007fffce8105df in alloc::boxed::{impl#31}::call_once<(), (dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global> (self=..., args=<optimized out>) at library/alloc/src/boxed.rs:2240
#24 std::sys::thread::unix::{impl#2}::new::thread_start (data=data@entry=0x7fffd3bfeee0) at library/std/src/sys/thread/unix.rs:118
#25 0x00005555555815b0 in set_alt_signal_stack_and_start (params=<optimized out>) at ./mozglue/interposers/pthread_create_interposer.cpp:81
#26 0x00007ffff7989058 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
#27 0x00007ffff7a07218 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6

The important part of the trace starts at frame #11.

sequoia-octopus-librnp has its own src/wot.rs, and this is the Web-of-Trust background thread. WoT::background_thread() calls WoT::update(), which eventually calls WoT::import_validity(). The latter performs SQL statements against Thunderbird's OpenPGP database. The Octopus crate is explicitly a Thunderbird RNP replacement and is built as a cdylib; its upstream manifest also has a direct rusqlite dependency.

The relevant call chain from the backtrace is therefore:

sequoia_octopus_librnp::wot::WoT::background_thread()
   -> WoT::update()
     -> WoT::import_validity()
       -> rusqlite::Connection/Transaction::execute()
         -> rusqlite::Statement::bind_parameter()
           -> sqlite3_bind_text64()

The last Rust frame is particularly useful. In rusqlite 0.40.2, src/statement.rs:646 is:

ValueRef::Text(s) => unsafe {
     let (c_str, len, destructor) = str_for_sqlite(s);
     ffi::sqlite3_bind_text64(
         ptr,
         ndx as c_int,
         c_str,
         len,
         destructor,
         ffi::SQLITE_UTF8 as _, // TODO SQLITE_UTF8_ZT
     )
},

This is the exact call site shown by the backtrace.

The next three frames are the interesting part:

#3  ... from /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
#2  sqlite3VdbeMemSetText() from /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
#1  sqlite3VdbeMemGrow()     from /usr/lib/x86_64-linux-gnu/libsqlite3.so.0

So the sqlite3_bind_text64() call from rusqlite is actually executing inside Debian's system libsqlite3.so.0.

That matters because Thunderbird also ships its own private SQLite implementation as /usr/lib/thunderbird/libmozsqlite3.so. I checked the exported symbol list shipped by Thunderbird. Its sqlite.symbols file explicitly exports:

sqlite3_bind_text
sqlite3_result_text

but does not export:

sqlite3_bind_text64
sqlite3_result_text64

This means sqlite3_bind_text64 is not part of the exported libmozsqlite3.so ABI.

SQLite itself does have the sqlite3_bind_text64() API, so this is not an SQLite API removal. The issue is the particular ABI exposed by Thunderbird's embedded SQLite.

The backtrace is consistent with a symbol-resolution/ABI mismatch: rusqlite requests sqlite3_bind_text64(), but the implementation that actually runs is the system SQLite implementation, while Thunderbird has a separate embedded SQLite library in the same process with a deliberately narrower exported API.

The crash then occurs entirely inside the system SQLite implementation:

sqlite3_bind_text64()
   -> sqlite3VdbeMemSetText()
     -> sqlite3VdbeMemGrow()
       -> NULL/invalid function call at 0x0

In other words, this is not an ordinary Rust panic or an SQLite error return. We are dereferencing invalid state inside SQLite's internal VDBE memory machinery.

This also explains why simply having both SQLite libraries installed is not harmless here. Octopus is a shared library loaded into Thunderbird rather than a standalone application, and its unresolved SQLite symbols participate in Thunderbird's existing ELF symbol namespace.

The proposed Debian fix therefore changes the text-binding call in rusqlite from:

sqlite3_bind_text64(...)

to:

sqlite3_bind_text(...)

The latter is explicitly exported by Thunderbird's libmozsqlite3.so, so this avoids requesting the unexported sqlite3_bind_text64 symbol when the Rust code is loaded into Thunderbird.

I am also applying the analogous change from sqlite3_result_text64() to sqlite3_result_text(), because Thunderbird's exported SQLite ABI likewise contains sqlite3_result_text but not sqlite3_result_text64.

I think the longer-term question is whether Thunderbird's sqlite.symbols should export the two *_text64 entry points instead. If they are intended to be part of the supported embedded SQLite ABI, adding them there would avoid requiring downstream Rust consumers to work around the restricted export list.

For the immediate Debian issue, however, using the SQLite entry points that Thunderbird actually exports appears to be the minimal fix for the Octopus/Thunderbird crash.

I'm uploading this fix now, please do follow up if the issue isn't fixed. I'm able to see that it's fixed on my end, but it's possible your setup is different.

Best regards,
Simon Quigley
tsimonq2@debian.org

#1147503#19
Date:
2026-09-13 00:48:45 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
rust-rusqlite, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1147503@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Simon Quigley <tsimonq2@debian.org> (supplier of updated rust-rusqlite package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sat, 12 Sep 2026 19:42:59 -0500
Source: rust-rusqlite
Architecture: source
Version: 0.40.2-2
Distribution: unstable
Urgency: medium
Maintainer: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
Changed-By: Simon Quigley <tsimonq2@debian.org>
Closes: 1147503
Changes:
 rust-rusqlite (0.40.2-2) unstable; urgency=medium
 .
   * Team upload.
   * Package rusqlite 0.40.2 from crates.io using debcargo 2.8.4
   * Bind TEXT with sqlite3_bind_text, not sqlite3_bind_text64
     (Closes: #1147503)
Checksums-Sha1:
 d1a9359b5a30e5018be11d05290e43b34423b89f 2887 rust-rusqlite_0.40.2-2.dsc
 d9b741942cd6692ab2b3d568d39801437b057e84 7748 rust-rusqlite_0.40.2-2.debian.tar.xz
 1d9af2b28460ef87e451ef6b702f0b0a844f53d2 8227 rust-rusqlite_0.40.2-2_source.buildinfo
Checksums-Sha256:
 ef1379128457775bb46954230c703fb955bdf73279a344f8f9ffc0f67111cbb6 2887 rust-rusqlite_0.40.2-2.dsc
 bf39d77707cda23b91f24fb2a7390487df8339e74aa7c0f197b05dad7d7b454f 7748 rust-rusqlite_0.40.2-2.debian.tar.xz
 d09b6b1ac79787c9684e578aafd72bdf3fcfad69089028c28e56c08585e1dd18 8227 rust-rusqlite_0.40.2-2_source.buildinfo
Files:
 8ccbb6d14195117c974bee3533f784da 2887 rust optional rust-rusqlite_0.40.2-2.dsc
 2cbefb4d5f4897573c699fda77c84354 7748 rust optional rust-rusqlite_0.40.2-2.debian.tar.xz
 2a8b2e187de9d05a02b0a53dba409275 8227 rust optional rust-rusqlite_0.40.2-2_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEXHq+og+GMEWcyMi14n8s+EWML6QFAmql8bEACgkQ4n8s+EWM
L6TQ6Q/9EruC9G+bxYx10R0FwrxE1uvARXeydipdYfG56kcoxHU8osY8I2Wl6PJv
QCL/dXyLUiCN0qyir+lNdPLmOm5aVSlsy2BJughHbLf4ML5dUAyD6qlYhLow0EVr
jzL8IYNYSAcjw45RtdYad6qYofeFV8Ekp9VhjMiti9tyjZNoEBD1eUaMpt857eU1
4OahMIvIsscvxZlebOb69Q4H7LoCXfYjV4c2iv3nS9q/KPNqstalMl9D6013qrHy
HXr966bq1pIfgY46ESpwT6RxJfyonG2RPHj/8mOEslyrdQXknMpVc+F7rYHkYWfL
nJxWT8hx4+exYVhPcgHd6FyItOTqIL8OcVI9In1Nc+AJk2nOIRgRwZiKRFMgl47k
Jzp9O0kBWiFz/5ZnCIcKshbXfX6lU/hzdYgaE5MzgazqqsgeNa44t3PWX3EXt5Rk
CNC4YSLRmrkwz9r1CXrWrrCQYiQtGoDVhBK3XeTMpJDWC4FPr/PWCXFA3grf/O1v
xS9zDNGURMJlRcpmehhia+maAvY8wyd6UGW/MRNQNO7sQVizMOcmcmrPCKxZ4vyj
I2PGwTIug/e1u+Z6W/Ymh9A9djQoagpMGO3oRR7/nA3YjC+nREIdx+KYrOlPD+En
KRLnjxodJ+BpQFANCrhXS71GWa/piiU4F+zLnsZI3ej+vz8t/Lo=
=BWSt
-----END PGP SIGNATURE-----

#1147503#24
Date:
2026-09-13 01:07:01 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
rust-sequoia-octopus-librnp, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1147503@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Simon Quigley <tsimonq2@debian.org> (supplier of updated rust-sequoia-octopus-librnp package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sat, 12 Sep 2026 19:49:46 -0500
Source: rust-sequoia-octopus-librnp
Architecture: source
Version: 1.11.1-10
Distribution: unstable
Urgency: medium
Maintainer: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
Changed-By: Simon Quigley <tsimonq2@debian.org>
Closes: 1147503
Changes:
 rust-sequoia-octopus-librnp (1.11.1-10) unstable; urgency=medium
 .
   * Team upload.
   * Package sequoia-octopus-librnp 1.11.1 from crates.io using debcargo 2.8.4
   * Rebuild against rusqlite 0.40.2-2 (sqlite3_bind_text) (Closes: #1147503).
Checksums-Sha1:
 2b6c8e75476dab11a1d1038722d2812f619b1572 3630 rust-sequoia-octopus-librnp_1.11.1-10.dsc
 eed32cd8a6712c04dbc1943ff27d608c835f9e08 7592 rust-sequoia-octopus-librnp_1.11.1-10.debian.tar.xz
 911e344616028e04cbb5a3880f8771b0952b9273 8287 rust-sequoia-octopus-librnp_1.11.1-10_source.buildinfo
Checksums-Sha256:
 6ceb50aac89751881c110ed0d2ef9db3be2374d9612d0ac41303ab9241f418f5 3630 rust-sequoia-octopus-librnp_1.11.1-10.dsc
 6884043fd77b841167cec57464176b4b46c257d242bf9032ebb372e11344ef7c 7592 rust-sequoia-octopus-librnp_1.11.1-10.debian.tar.xz
 e1d65a1857d086f6bb8bc630d79e0d234db5b1d65a5ac36bfecd48db1fe2488d 8287 rust-sequoia-octopus-librnp_1.11.1-10_source.buildinfo
Files:
 a807e814747053c5ae5b7049ccfaf9fb 3630 rust optional rust-sequoia-octopus-librnp_1.11.1-10.dsc
 7a6a18b18a788965d2e3cdc2e3f9deba 7592 rust optional rust-sequoia-octopus-librnp_1.11.1-10.debian.tar.xz
 618bd1ff4cd9d1b414688ee5833007de 8287 rust optional rust-sequoia-octopus-librnp_1.11.1-10_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEXHq+og+GMEWcyMi14n8s+EWML6QFAmql8z0ACgkQ4n8s+EWM
L6SiKRAAsHThIIMEoQczHIeUh4MTdidxyQQeODhhZoPe9KMMXX3x3WvmWAtkBnMU
VQ1uAuC2W82JUHJJ4/LegZUpXZ9HZElUJAHw/b7ZsvzKsJ41bUDv0ZbkizY0ZVN/
Mm2F/LArkJ1OygWgHkZjLPmMCYTdqfkY8X1gXxw93kunKCb8d72jXmyfRCEv4ez4
hHZmQnX9e74zrSBOxM5fpVG/S7KOkUln7S46ZIbvCkfqHfOJ0hH7WTj+dC/MMtLc
VhhF3raqw8ab+DHSucH2Jg3IOWs3mWTc+8xjkgb+2KER4DiFJ3RCbyc/8mtKq+SZ
W4n5TUuX5l+OmwMTDxBqD0MwgmsgLzJu2TrG9eMTAAofmKgC8clKaMpm4ZqcvI35
Ej7en0TSmwGYejz8T3YRLavVdUvt2F0AnIkZ2v2m4yInlcvjY7RuCYuo/szQ7H2E
wvxd+F7a1P6sWMtcUeddK2u5xQlN8JxTS4DhHLwuWjZjMJBXvLbOvb3HCJn4RnM3
QXgtA/IaQyhlVdNNaZUnmwjuc2ZDq5XjqUHPM/WbGjwSMS0XmSj9ajVCgyjdQv7W
STlIoMz2KnTYdgoQgpVyzctZd9r5kHoBDeqeVvvVMQAlmhSC35IgGT3Vkkqzkb6c
3OV/KKJ+A3MF2VhqqFWGjJUhWL3m3rVUMQuA4mnhrzzwZf9Su3s=
=i2Eo
-----END PGP SIGNATURE-----