unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] ds: Reset at END
@ 2023-09-14 12:50 Eric Wong
  2023-09-14 13:02 ` [PATCH 2/1] test_common: call DS->Reset instead of cleanup_task Eric Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Wong @ 2023-09-14 12:50 UTC (permalink / raw)
  To: meta

This seems to avoid some DBI teardown segfaults on OpenBSD 7.3;
but there may be other places where something similar is necessary.
---
 lib/PublicInbox/DS.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm
index d47df491..919a4b67 100644
--- a/lib/PublicInbox/DS.pm
+++ b/lib/PublicInbox/DS.pm
@@ -55,6 +55,9 @@ our (
 
 Reset();
 
+# clobber everything explicitly to avoid DESTROY ordering problems w/ DBI
+END { Reset() }
+
 #####################################################################
 ### C L A S S   M E T H O D S
 #####################################################################

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/1] test_common: call DS->Reset instead of cleanup_task
  2023-09-14 12:50 [PATCH] ds: Reset at END Eric Wong
@ 2023-09-14 13:02 ` Eric Wong
  2023-09-14 20:52   ` [PATCHv2 2/1] test_common: eliminate call to non-existent cleanup_task Eric Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Wong @ 2023-09-14 13:02 UTC (permalink / raw)
  To: meta

cleanup_task is long gone since all that cleanup work got moved
into DS itself.  Forcing a Reset here may solve some cleanup
segfaults I've noticed on OpenBSD 7.3 (and no other OSes).
---
 lib/PublicInbox/TestCommon.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm
index a8323e4d..a0c3d065 100644
--- a/lib/PublicInbox/TestCommon.pm
+++ b/lib/PublicInbox/TestCommon.pm
@@ -365,7 +365,7 @@ sub run_script ($;$$) {
 			chdir $d or die "chdir $d: $!";
 		}
 		_run_sub($sub, $key, \@argv);
-		eval { PublicInbox::Inbox::cleanup_task() };
+		eval { PublicInbox::DS->Reset() };
 		die "fchdir(restore): $!" if $cwdfh && !chdir($cwdfh);
 		_undo_redirects($orig_io);
 		select STDOUT;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCHv2 2/1] test_common: eliminate call to non-existent cleanup_task
  2023-09-14 13:02 ` [PATCH 2/1] test_common: call DS->Reset instead of cleanup_task Eric Wong
@ 2023-09-14 20:52   ` Eric Wong
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Wong @ 2023-09-14 20:52 UTC (permalink / raw)
  To: meta

cleanup_task is long gone since all that cleanup work got moved
into DS itself.  Adding a DS->Reset here breaks t/imapd.t (and
possibly other tests), and is actually unlikely to avoid any
cleanup segfaults on OpenBSD since those are only happening
after `END {}' blocks are called.
---
 Original 2/1 patch broke t/imapd.t :x

 lib/PublicInbox/TestCommon.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm
index a8323e4d..4c819a4f 100644
--- a/lib/PublicInbox/TestCommon.pm
+++ b/lib/PublicInbox/TestCommon.pm
@@ -365,7 +365,8 @@ sub run_script ($;$$) {
 			chdir $d or die "chdir $d: $!";
 		}
 		_run_sub($sub, $key, \@argv);
-		eval { PublicInbox::Inbox::cleanup_task() };
+		# n.b. all our uses of PublicInbox::DS should be fine
+		# with this and we can't Reset here.
 		die "fchdir(restore): $!" if $cwdfh && !chdir($cwdfh);
 		_undo_redirects($orig_io);
 		select STDOUT;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-14 20:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-14 12:50 [PATCH] ds: Reset at END Eric Wong
2023-09-14 13:02 ` [PATCH 2/1] test_common: call DS->Reset instead of cleanup_task Eric Wong
2023-09-14 20:52   ` [PATCHv2 2/1] test_common: eliminate call to non-existent cleanup_task Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).