]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
t/watch_filter_rubylang.t: DS->Reset to avoid segfault
authorEric Wong <e@80x24.org>
Wed, 6 Sep 2023 00:08:26 +0000 (00:08 +0000)
committerEric Wong <e@80x24.org>
Thu, 7 Sep 2023 00:48:40 +0000 (00:48 +0000)
Object destruction order needs to be managed manually here to
avoid an occasional segfault at _rthread_mutex_timedlock() with
the following callstack:

XS_DBI_dispatch()
XS_DBD__SQLite__st_DESTROY()
sqlite_st_destroy()
sqlite3_finalize()
_rthread_mutex_timedlock()

...on OpenBSD 7.3 (Perl 5.36, DBD::SQLite 1.70v0, DBI 1.643p0,
sqlite 3.41.0).  I'm not sure exactly where the bug is, but I
suspect it's something inherent in Perl's unpredictable
destruction order at process teardown (something I've had to
workaround in the past when dealing with XS extensions).

There's no downloadable debug-* OpenBSD packages to ease
debugging for these components, either.

t/watch_filter_rubylang.t

index 004e794ec8c224cedc7ac4e5bd63cdcb23553a95..643dbb8a6e020ccea27bc98059875566838a043a 100644 (file)
@@ -99,6 +99,9 @@ EOF
        }
        $w->scan('full');
 
+       # ensure orderly destruction to avoid SQLite segfault:
+       PublicInbox::DS->Reset;
+
        $cfg = PublicInbox::Config->new(\$orig);
        $ibx = $cfg->lookup_name($v);
        $ibx->{-no_fsync} = 1;