Public bug reported:

Trivial C++ example to reproduce the issue:

#include <pqxx/pqxx>
int main() {
   return 0;
}

Compile and run:

g++ t1.cc -o t1 -lpqxx && valgrind ./t1


On Ubuntu 26.04 (alpha, March 9, 2026), this example just crashes with "free(): 
double free detected in tcache 2"

Valgrind output:

==67191== Invalid free() / delete / delete[] / realloc()
==67191==    at 0x4854B0D: operator delete(void*, unsigned long) 
(vg_replace_malloc.c:1184)
==67191==    by 0x4002BC4: std::__new_allocator<char>::deallocate(char*, 
unsigned long) (in /home/nornetpp/src/t1)
==67191==    by 0x4002B48: std::__cxx11::basic_string<char, 
std::char_traits<char>, std::allocator<char> >::_M_destroy(unsigned long) (in 
/home/nornetpp/src/t1)
==67191==    by 0x4002A71: std::__cxx11::basic_string<char, 
std::char_traits<char>, std::allocator<char> >::_M_dispose() (in 
/home/nornetpp/src/t1)
==67191==    by 0x40029FF: std::__cxx11::basic_string<char, 
std::char_traits<char>, std::allocator<char> >::~basic_string() (in 
/home/nornetpp/src/t1)
==67191==    by 0x4C0A0E1: __cxa_finalize (cxa_finalize.c:97)
==67191==    by 0x48B6746: ??? (in /usr/lib/x86_64-linux-gnu/libpqxx-7.10.so)
==67191==    by 0x40080D1: _dl_call_fini (dl-call_fini.c:43)
==67191==    by 0x400C6EF: _dl_fini (dl-fini.c:120)
==67191==    by 0x4C0A860: __run_exit_handlers (exit.c:118)
==67191==    by 0x4C0A93D: exit (exit.c:148)
==67191==    by 0x4BEC57B: (below main) (libc_start_call_main.h:74)
==67191==  Address 0x5970b20 is 0 bytes inside a block of size 80 free'd
==67191==    at 0x4854B0D: operator delete(void*, unsigned long) 
(vg_replace_malloc.c:1184)
==67191==    by 0x4002BC4: std::__new_allocator<char>::deallocate(char*, 
unsigned long) (in /home/nornetpp/src/t1)
==67191==    by 0x4002B48: std::__cxx11::basic_string<char, 
std::char_traits<char>, std::allocator<char> >::_M_destroy(unsigned long) (in 
/home/nornetpp/src/t1)
==67191==    by 0x4002A71: std::__cxx11::basic_string<char, 
std::char_traits<char>, std::allocator<char> >::_M_dispose() (in 
/home/nornetpp/src/t1)
==67191==    by 0x40029FF: std::__cxx11::basic_string<char, 
std::char_traits<char>, std::allocator<char> >::~basic_string() (in 
/home/nornetpp/src/t1)
==67191==    by 0x4C0A860: __run_exit_handlers (exit.c:118)
==67191==    by 0x4C0A93D: exit (exit.c:148)
==67191==    by 0x4BEC57B: (below main) (libc_start_call_main.h:74)
==67191==  Block was alloc'd at
==67191==    at 0x4850FD3: operator new(unsigned long) (vg_replace_malloc.c:488)
==67191==    by 0x48CFCB1: pqxx::internal::demangle_type_name[abi:cxx11](char 
const*) (in /usr/lib/x86_64-linux-gnu/libpqxx-7.10.so)
==67191==    by 0x40027A0: __static_initialization_and_destruction_0() (in 
/home/nornetpp/src/t1)
==67191==    by 0x40027E4: _GLOBAL__sub_I_main (in /home/nornetpp/src/t1)
==67191==    by 0x4BEC6A3: call_init (libc-start.c:145)
==67191==    by 0x4BEC6A3: __libc_start_main@@GLIBC_2.34 (libc-start.c:347)
==67191==    by 0x40022C4: (below main) (in /home/nornetpp/src/t1)

ProblemType: Bug
DistroRelease: Ubuntu 26.04
Package: libpqxx-7.10 7.10.0-2build1
ProcVersionSignature: Ubuntu 6.19.0-9.9-generic 6.19.5
Uname: Linux 6.19.0-9-generic x86_64
ApportVersion: 2.33.1-0ubuntu3
Architecture: amd64
CasperMD5CheckResult: pass
Date: Mon Mar  9 13:36:21 2026
InstallationDate: Installed on 2026-03-09 (0 days ago)
InstallationMedia: Ubuntu-Server 26.04 LTS "Resolute Raccoon" - Daily amd64 
(20260308)
RebootRequiredPkgs: Error: path contained symlinks.
SourcePackage: libpqxx
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: libpqxx (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug resolute

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2143722

Title:
  libpqxx: crash on Ubuntu 26.04 alpha with "free(): double free
  detected in tcache 2"

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libpqxx/+bug/2143722/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to