Nixpkgs version
Describe the bug
On revision f4b6996, bluesky-pds regularly crashes inside the better-sqlite3.node binary
Steps to reproduce
- Have a fully setup PDS.
- Navigate around your bsky web app from desktop on Firefox.
This will regularly cause the PDS to crash and restart, resulting in a degraded UX as the site receives error responses
Expected behaviour
No crashes, stable web interface
Screenshots
No response
Relevant log output
Aug 18 18:48:26 cyberservermkii pds[1549864]: # /nix/store/glcp73hgagq2b24i80jlgbvj28vdb6kk-nodejs-24.19.0/bin/node[1549864]: void node::RemoveEnvironmentCleanupHook(v8::Isolate*, CleanupHook, void*) at ../../src/api/hooks.cc:142
Aug 18 18:48:26 cyberservermkii pds[1549864]: # Assertion failed: (env) != nullptr
Aug 18 18:48:26 cyberservermkii pds[1549864]: ----- Native stack trace -----
Aug 18 18:48:26 cyberservermkii pds[1549864]: 1: 0x63dee3775d43 node::Assert(node::AssertionInfo const&) [/nix/store/glcp73hgagq2b24i80jlgbvj28vdb6kk-nodejs-24.19.0/bin/node]
Aug 18 18:48:26 cyberservermkii pds[1549864]: 2: 0x63dee364a42d node::RemoveEnvironmentCleanupHook(v8::Isolate*, void (*)(void*), void*) [/nix/store/glcp73hgagq2b24i80jlgbvj28vdb6kk-nodejs-24.19.0/bin/node]
Aug 18 18:48:26 cyberservermkii pds[1549864]: 3: 0x7a01d421803a Statement::~Statement() [/nix/store/igvkhxxbd8b5cmxhr946jhww6rbdzlbw-pds-0.4.5009/lib/pds/node_modules/.pnpm/better-sqlite3@12.11.1/node_modules/better-sqlite3/build/Release/better_sqlite3.node]
Aug 18 18:48:26 cyberservermkii pds[1549864]: 4: 0x7a01d4218211 Statement::~Statement() [/nix/store/igvkhxxbd8b5cmxhr946jhww6rbdzlbw-pds-0.4.5009/lib/pds/node_modules/.pnpm/better-sqlite3@12.11.1/node_modules/better-sqlite3/build/Release/better_sqlite3.node]
Aug 18 18:48:26 cyberservermkii pds[1549864]: 5: 0x63dee3d16bb3 [/nix/store/glcp73hgagq2b24i80jlgbvj28vdb6kk-nodejs-24.19.0/bin/node]
Aug 18 18:48:26 cyberservermkii pds[1549864]: 6: 0x63dee3dda2c4 [/nix/store/glcp73hgagq2b24i80jlgbvj28vdb6kk-nodejs-24.19.0/bin/node]
Aug 18 18:48:26 cyberservermkii pds[1549864]: 7: 0x63dee3ddb511 [/nix/store/glcp73hgagq2b24i80jlgbvj28vdb6kk-nodejs-24.19.0/bin/node]
Aug 18 18:48:26 cyberservermkii pds[1549864]: 8: 0x63dee3ddf840 [/nix/store/glcp73hgagq2b24i80jlgbvj28vdb6kk-nodejs-24.19.0/bin/node]
Aug 18 18:48:26 cyberservermkii pds[1549864]: 9: 0x63dee49ee7f3 [/nix/store/glcp73hgagq2b24i80jlgbvj28vdb6kk-nodejs-24.19.0/bin/node]
Aug 18 18:48:27 cyberservermkii systemd-coredump[1550891]: [🡕] Process 1549864 (MainThread) of user 991 dumped core.
Module better_sqlite3.node without build-id.
Module libicudata.so.78 without build-id.
Module libbrotlicommon.so.1 without build-id.
Module libsimdutf.so.34 without build-id.
Module libgcc_s.so.1 without build-id.
Module libstdc++.so.6 without build-id.
Module libicuuc.so.78 without build-id.
Module libicui18n.so.78 without build-id.
Module libzstd.so.1 without build-id.
Module libuvwasi.so without build-id.
Module libngtcp2.so.16 without build-id.
Module libnghttp3.so.9 without build-id.
Module libnghttp2.so.14 without build-id.
Module libnbytes.so without build-id.
Module libmerve.so.1 without build-id.
Module libhdr_histogram.so.6 without build-id.
Module libgtest.so.1.17.0 without build-id.
Module libcares.so.2 without build-id.
Module libbrotlienc.so.1 without build-id.
Module libbrotlidec.so.1 without build-id.
Module libsimdutf.so.20 without build-id.
Module libsimdjson.so.33 without build-id.
Module libada.so.3 without build-id.
Module libllhttp.so.9.4 without build-id.
Module libz.so.1 without build-id.
Module node without build-id.
Stack trace of thread 1549864:
#0 0x00007a01d769eecc __pthread_kill_implementation (libc.so.6 + 0x9eecc)
#1 0x00007a01d764216e raise (libc.so.6 + 0x4216e)
#2 0x00007a01d7629350 abort (libc.so.6 + 0x29350)
#3 0x000063dee3775d58 _ZN4node6AssertERKNS_13AssertionInfoE (node + 0x575d58)
#4 0x000063dee364a42d _ZN4node28RemoveEnvironmentCleanupHookEPN2v87IsolateEPFvPvES3_ (node + 0x44a42d)
#5 0x00007a01d421803a _ZN9StatementD2Ev (better_sqlite3.node + 0x1803a)
#6 0x00007a01d4218211 _ZN9StatementD0Ev (better_sqlite3.node + 0x18211)
#7 0x000063dee3d16bb3 _ZN2v88internal13GlobalHandles28InvokeFirstPassWeakCallbacksEv (node + 0xb16bb3)
#8 0x000063dee3dda2c4 _ZN2v88internal4Heap24PerformGarbageCollectionENS0_16GarbageCollectorENS0_23GarbageCollectionReasonEPKc (node + 0xbda2c4)
#9 0x000063dee3ddb511 _ZZN2v88internal4Heap14CollectGarbageENS0_15AllocationSpaceENS0_23GarbageCollectionReasonENS_15GCCallbackFlagsEENKUlvE0_clEv (node + 0xbdb511)
#10 0x000063dee3ddf840 _ZN4heap4base5Stack24SetMarkerAndCallbackImplIZN2v88internal4Heap14CollectGarbageENS4_15AllocationSpaceENS4_23GarbageCollectionReasonENS3_15GCCallbackFlagsEEUlvE0_EEvPS1_PvPKv (node + 0xbdf840)
#11 0x000063dee49ee7f3 PushAllRegistersAndIterateStack (node + 0x17ee7f3)
#12 0x000063dee3ddbfaf _ZN2v88internal4Heap14CollectGarbageENS0_15AllocationSpaceENS0_23GarbageCollectionReasonENS_15GCCallbackFlagsE (node + 0xbdbfaf)
#13 0x000063dee3da929b _ZN2v88internal13HeapAllocator34AllocateRawWithRetryOrFailSlowPathEiNS0_14AllocationTypeENS0_16AllocationOriginENS0_19AllocationAlignmentE (node + 0xba929b)
#14 0x000063dee3d7ac2a _ZN2v88internal7Factory15NewFillerObjectEiNS0_19AllocationAlignmentENS0_14AllocationTypeENS0_16AllocationOriginE (node + 0xb7ac2a)
#15 0x000063dee43267ff _ZN2v88internal33Runtime_AllocateInYoungGenerationEiPmPNS0_7IsolateE (node + 0x11267ff)
#16 0x00007a01b66369b6 n/a (n/a + 0x0)
#17 0x00007a01b66849fb n/a (n/a + 0x0)
#18 0x00007a01b6602fd1 n/a (n/a + 0x0)
#19 0x00007a0196a1ffeb n/a (n/a + 0x0)
#20 0x00007a0196834a91 n/a (n/a + 0x0)
#21 0x00007a0196aaca55 n/a (n/a + 0x0)
#22 0x00007a0196aad171 n/a (n/a + 0x0)
#23 0x00007a0196aad599 n/a (n/a + 0x0)
#24 0x00007a0196ac563d n/a (n/a + 0x0)
#25 0x00007a01b65d04fb n/a (n/a + 0x0)
#26 0x00007a01b66ba1f5 n/a (n/a + 0x0)
#27 0x00007a01b65be549 n/a (n/a + 0x0)
#28 0x00007a01b658b167 n/a (n/a + 0x0)
#29 0x000063dee3cbb47d _ZN2v88internal12_GLOBAL__N_1L6InvokeEPNS0_7IsolateERKNS1_12InvokeParamsE (node + 0xabb47d)
#30 0x000063dee3cbc98d _ZN2v88internal9Execution16TryRunMicrotasksEPNS0_7IsolateEPNS0_14MicrotaskQueueE (node + 0xabc98d)
#31 0x000063dee3cfc6fc _ZN2v88internal14MicrotaskQueue13RunMicrotasksEPNS0_7IsolateE (node + 0xafc6fc)
#32 0x000063dee3cfcc15 _ZN2v88internal14MicrotaskQueue17PerformCheckpointEPNS_7IsolateE (node + 0xafcc15)
#33 0x000063dee36390eb _ZN4node21InternalCallbackScope5CloseEv (node + 0x4390eb)
#34 0x000063dee36393b1 _ZN4node21InternalCallbackScopeD1Ev (node + 0x4393b1)
#35 0x000063dee3783d7e _ZN4node2fs10FileHandle8CloseReq7ResolveEv (node + 0x583d7e)
#36 0x000063dee3784ca7 _ZZN4node2fs10FileHandle12ClosePromiseEvENUlP7uv_fs_sE_4_FUNES3_ (node + 0x584ca7)
#37 0x000063dee3767fb1 _ZN4node24MakeLibuvRequestCallbackI7uv_fs_sPFvPS1_EE7WrapperES2_ (node + 0x567fb1)
#38 0x00007a01d9599479 uv__work_done (libuv.so.1 + 0xf479)
#39 0x00007a01d959dd6e uv__async_io (libuv.so.1 + 0x13d6e)
#40 0x00007a01d95b3009 uv__io_poll (libuv.so.1 + 0x29009)
#41 0x00007a01d959f156 uv_run (libuv.so.1 + 0x15156)
#42 0x000063dee363d3b3 _ZN4node21SpinEventLoopInternalEPNS_11EnvironmentE (node + 0x43d3b3)
#43 0x000063dee37def1a _ZN4node16NodeMainInstance3RunEPNS_8ExitCodeEPNS_11EnvironmentE (node + 0x5def1a)
#44 0x000063dee37df335 _ZN4node16NodeMainInstance3RunEv (node + 0x5df335)
#45 0x000063dee370f765 _ZN4node5StartEiPPc (node + 0x50f765)
#46 0x00007a01d762b285 __libc_start_call_main (libc.so.6 + 0x2b285)
#47 0x00007a01d762b338 __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x2b338)
#48 0x000063dee360a395 _start (node + 0x40a395)
Stack trace of thread 1549870:
#0 0x00007a01d76a5a02 __syscall_cancel_arch (libc.so.6 + 0xa5a02)
#1 0x00007a01d769910c __internal_syscall_cancel (libc.so.6 + 0x9910c)
#2 0x00007a01d769988c __futex_abstimed_wait_common (libc.so.6 + 0x9988c)
#3 0x00007a01d769c2ee pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x9c2ee)
#4 0x00007a01d95ad8f9 uv_cond_wait (libuv.so.1 + 0x238f9)
#5 0x000063dee382bbab _ZN4node12_GLOBAL__N_1L20PlatformWorkerThreadEPv (node + 0x62bbab)
#6 0x00007a01d769ce53 start_thread (libc.so.6 + 0x9ce53)
#7 0x00007a01d7723e44 __clone (libc.so.6 + 0x123e44)
Stack trace of thread 1549869:
#0 0x00007a01d76a5a02 __syscall_cancel_arch (libc.so.6 + 0xa5a02)
#1 0x00007a01d769910c __internal_syscall_cancel (libc.so.6 + 0x9910c)
#2 0x00007a01d769988c __futex_abstimed_wait_common (libc.so.6 + 0x9988c)
#3 0x00007a01d769c2ee pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x9c2ee)
#4 0x00007a01d95ad8f9 uv_cond_wait (libuv.so.1 + 0x238f9)
#5 0x000063dee382bbab _ZN4node12_GLOBAL__N_1L20PlatformWorkerThreadEPv (node + 0x62bbab)
#6 0x00007a01d769ce53 start_thread (libc.so.6 + 0x9ce53)
#7 0x00007a01d7723e44 __clone (libc.so.6 + 0x123e44)
Stack trace of thread 1549879:
#0 0x00007a01d76a5a02 __syscall_cancel_arch (libc.so.6 + 0xa5a02)
#1 0x00007a01d769910c __internal_syscall_cancel (libc.so.6 + 0x9910c)
#2 0x00007a01d769988c __futex_abstimed_wait_common (libc.so.6 + 0x9988c)
#3 0x00007a01d769c2ee pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x9c2ee)
#4 0x00007a01d95ad8f9 uv_cond_wait (libuv.so.1 + 0x238f9)
#5 0x00007a01d9598e8a worker (libuv.so.1 + 0xee8a)
#6 0x00007a01d769ce53 start_thread (libc.so.6 + 0x9ce53)
#7 0x00007a01d7723e44 __clone (libc.so.6 + 0x123e44)
Stack trace of thread 1549880:
#0 0x00007a01d76a5a02 __syscall_cancel_arch (libc.so.6 + 0xa5a02)
#1 0x00007a01d769910c __internal_syscall_cancel (libc.so.6 + 0x9910c)
#2 0x00007a01d769988c __futex_abstimed_wait_common (libc.so.6 + 0x9988c)
#3 0x00007a01d769c2ee pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x9c2ee)
#4 0x00007a01d95ad8f9 uv_cond_wait (libuv.so.1 + 0x238f9)
#5 0x00007a01d9598e8a worker (libuv.so.1 + 0xee8a)
#6 0x00007a01d769ce53 start_thread (libc.so.6 + 0x9ce53)
#7 0x00007a01d7723e44 __clone (libc.so.6 + 0x123e44)
Stack trace of thread 1549868:
#0 0x00007a01d76a5a02 __syscall_cancel_arch (libc.so.6 + 0xa5a02)
#1 0x00007a01d769910c __internal_syscall_cancel (libc.so.6 + 0x9910c)
#2 0x00007a01d7699184 __syscall_cancel (libc.so.6 + 0x99184)
#3 0x00007a01d77242f5 epoll_pwait (libc.so.6 + 0x1242f5)
#4 0x00007a01d95b2e80 uv__io_poll (libuv.so.1 + 0x28e80)
#5 0x00007a01d959f156 uv_run (libuv.so.1 + 0x15156)
#6 0x000063dee3830b95 _ZZN4node23WorkerThreadsTaskRunner20DelayedTaskScheduler5StartEvENUlPvE_4_FUNES2_ (node + 0x630b95)
#7 0x00007a01d769ce53 start_thread (libc.so.6 + 0x9ce53)
#8 0x00007a01d7723e44 __clone (libc.so.6 + 0x123e44)
Stack trace of thread 1549871:
#0 0x00007a01d76a5a02 __syscall_cancel_arch (libc.so.6 + 0xa5a02)
#1 0x00007a01d769910c __internal_syscall_cancel (libc.so.6 + 0x9910c)
#2 0x00007a01d769988c __futex_abstimed_wait_common (libc.so.6 + 0x9988c)
#3 0x00007a01d769c2ee pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x9c2ee)
#4 0x00007a01d95ad8f9 uv_cond_wait (libuv.so.1 + 0x238f9)
#5 0x000063dee382bbab _ZN4node12_GLOBAL__N_1L20PlatformWorkerThreadEPv (node + 0x62bbab)
#6 0x00007a01d769ce53 start_thread (libc.so.6 + 0x9ce53)
#7 0x00007a01d7723e44 __clone (libc.so.6 + 0x123e44)
Stack trace of thread 1549877:
#0 0x00007a01d76a5a02 __syscall_cancel_arch (libc.so.6 + 0xa5a02)
#1 0x00007a01d769910c __internal_syscall_cancel (libc.so.6 + 0x9910c)
#2 0x00007a01d769988c __futex_abstimed_wait_common (libc.so.6 + 0x9988c)
#3 0x00007a01d769c2ee pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x9c2ee)
#4 0x00007a01d95ad8f9 uv_cond_wait (libuv.so.1 + 0x238f9)
#5 0x00007a01d9598e8a worker (libuv.so.1 + 0xee8a)
#6 0x00007a01d769ce53 start_thread (libc.so.6 + 0x9ce53)
#7 0x00007a01d7723e44 __clone (libc.so.6 + 0x123e44)
Stack trace of thread 1549878:
#0 0x00007a01d76a5a02 __syscall_cancel_arch (libc.so.6 + 0xa5a02)
#1 0x00007a01d769910c __internal_syscall_cancel (libc.so.6 + 0x9910c)
#2 0x00007a01d769988c __futex_abstimed_wait_common (libc.so.6 + 0x9988c)
#3 0x00007a01d769c2ee pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x9c2ee)
#4 0x00007a01d95ad8f9 uv_cond_wait (libuv.so.1 + 0x238f9)
#5 0x00007a01d9598e8a worker (libuv.so.1 + 0xee8a)
#6 0x00007a01d769ce53 start_thread (libc.so.6 + 0x9ce53)
#7 0x00007a01d7723e44 __clone (libc.so.6 + 0x123e44)
Stack trace of thread 1549873:
#0 0x00007a01d76a5a02 __syscall_cancel_arch (libc.so.6 + 0xa5a02)
#1 0x00007a01d769910c __internal_syscall_cancel (libc.so.6 + 0x9910c)
#2 0x00007a01d769988c __futex_abstimed_wait_common (libc.so.6 + 0x9988c)
#3 0x00007a01d76a58f8 __new_sem_wait_slow64.constprop.0 (libc.so.6 + 0xa58f8)
#4 0x00007a01d95ad97a uv_sem_wait (libuv.so.1 + 0x2397a)
#5 0x000063dee39a1b81 _ZN4node9inspector12_GLOBAL__N_1L17StartIoThreadMainEPv (node + 0x7a1b81)
#6 0x00007a01d769ce53 start_thread (libc.so.6 + 0x9ce53)
#7 0x00007a01d7723e44 __clone (libc.so.6 + 0x123e44)
Stack trace of thread 1549872:
#0 0x00007a01d76a5a02 __syscall_cancel_arch (libc.so.6 + 0xa5a02)
#1 0x00007a01d769910c __internal_syscall_cancel (libc.so.6 + 0x9910c)
#2 0x00007a01d769988c __futex_abstimed_wait_common (libc.so.6 + 0x9988c)
#3 0x00007a01d769c2ee pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x9c2ee)
#4 0x00007a01d95ad8f9 uv_cond_wait (libuv.so.1 + 0x238f9)
#5 0x000063dee382bbab _ZN4node12_GLOBAL__N_1L20PlatformWorkerThreadEPv (node + 0x62bbab)
#6 0x00007a01d769ce53 start_thread (libc.so.6 + 0x9ce53)
#7 0x00007a01d7723e44 __clone (libc.so.6 + 0x123e44)
ELF object binary architecture: AMD x86-64
Additional context
Took a cursory look myself. Google gemini suggests this is due to a version mismatch in the node version better_sqlite.node was built with. I notice in the build process for the package that there is no handling for this pre-built binary. Taking care of that might resolve it. Will dig deeper when I get a chance.
System metadata
[dominion@cyberservermkii:~]$ nix-shell -p nix-info --run "nix-info -m"
fetching path input 'path:/nix/store/x9dr1vn67ci9dhlr9aw87ynlbkrwk6xc-source'
this path will be fetched (0.02 MiB download, 0.06 MiB unpacked):
/nix/store/w60q4s3anfrlnn72841kw60fsjc0qmhk-stdenv-linux
copying path '/nix/store/w60q4s3anfrlnn72841kw60fsjc0qmhk-stdenv-linux' from 'https://cache.nixos.org'...
- system: `"x86_64-linux"`
- host os: `Linux 6.18.42, NixOS, 26.11 (Zokor), 26.11.20260818.b47ad65`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Lix, like Nix) 2.95.2
System type: x86_64-linux
Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux, x86_64-v4-linux
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /home/dominion/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/dominion/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/dominion/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/dominion/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/vnafrww9nnqb9y6p9m1nq5nmbafwm7db-lix-2.95.2/share`
- nixpkgs: `/nix/store/x9dr1vn67ci9dhlr9aw87ynlbkrwk6xc-source`
Notify maintainers
@t4ccer @isabelroses
Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)
I assert that this issue is relevant for Nixpkgs
Is this issue important to you?
Add a 👍 reaction to issues you find important.
Nixpkgs version
Describe the bug
On revision f4b6996, bluesky-pds regularly crashes inside the
better-sqlite3.nodebinarySteps to reproduce
This will regularly cause the PDS to crash and restart, resulting in a degraded UX as the site receives error responses
Expected behaviour
No crashes, stable web interface
Screenshots
No response
Relevant log output
Additional context
Took a cursory look myself. Google gemini suggests this is due to a version mismatch in the
nodeversionbetter_sqlite.nodewas built with. I notice in the build process for the package that there is no handling for this pre-built binary. Taking care of that might resolve it. Will dig deeper when I get a chance.System metadata
Notify maintainers
@t4ccer @isabelroses
Note for maintainers: Please tag this issue in your pull request description. (i.e.
Resolves #ISSUE.)I assert that this issue is relevant for Nixpkgs
Is this issue important to you?
Add a 👍 reaction to issues you find important.