From b010b2536495bb6a78a2634b5aa348189503811f Mon Sep 17 00:00:00 2001 From: ThomasBreuer Date: Tue, 1 Oct 2024 11:09:10 +0200 Subject: [PATCH] close the stream in `PqDescendants` otherwise the process is still running, and calling `PqDescendants` too many times will result in a `"failed to launch child process"` error in `PQ_START`. --- lib/anupga.gi | 3 +++ tst/bugfix.tst | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/lib/anupga.gi b/lib/anupga.gi index 310750a..6315ba1 100644 --- a/lib/anupga.gi +++ b/lib/anupga.gi @@ -352,6 +352,9 @@ InstallGlobalFunction( PQ_DESCENDANTS, function( args ) if HasIsCapable(datarec.group) and not IsCapable(datarec.group) and VALUE_PQ_OPTION("SetupFile") = fail then datarec.descendants := []; + if datarec.calltype = "non-interactive" then + PQ_COMPLETE_NONINTERACTIVE_FUNC_CALL(datarec); + fi; return datarec.descendants; fi; diff --git a/tst/bugfix.tst b/tst/bugfix.tst index 33ae148..2ad2c28 100644 --- a/tst/bugfix.tst +++ b/tst/bugfix.tst @@ -28,6 +28,12 @@ gap> PqDescendantsTreeCoclassOne( PqStart( G ) : TreeDepth := 5, CapableDescenda #I Number of descendants of group #1;1 #1;1 #1;1 to class 4: 1 #I Number of descendants of group #1;1 #1;1 #1;1 #1;1 to class 5: 1 +# Check that the stream gets closed also in early exit cases. +gap> G:= ExtraspecialGroup( 3^3, "-" );; +gap> IsCapable( G ); +false +gap> for i in [ 1 .. 100 ] do PqDescendants( G ); od; + # gap> PqQuitAll(); gap> STOP_TEST( "bugfix.tst", 1 );