Add a new process objet to the internal process object list after signals have been checked.

[INTERPRETER]
* BUG: Add a new process objet to the internal process object list after signals have been checked.
This commit is contained in:
Benoît Minisini 2023-10-31 13:26:18 +01:00
parent 350b5e8b22
commit b891f3a81e
3 changed files with 7 additions and 12 deletions

View file

@ -628,15 +628,16 @@ static void run_process(CPROCESS *process, int mode, void *cmd, CARRAY *env)
goto __ABORT_ERRNO;
}
// Adding to the running process list
add_process_to_running_list(process);
OBJECT_REF(process);
// Start the SIGCHLD callback
init_child();
// Adding to the running process list after, because init_child() checks the signal handlers,
// and may call callback_child().
add_process_to_running_list(process);
OBJECT_REF(process);
// Block SIGCHLD and fork
sigemptyset(&sig);

View file

@ -262,7 +262,7 @@ CLASS *class_replace_global(CLASS *class)
if (!CLASS_is_loaded(class))
return class;
if (class->count == 0)
return class_keep_global(class);

View file

@ -2443,12 +2443,6 @@ _BYREF:
/*-----------------------------------------------*/
_SUBR_COMPN:
SYNC_PC();
SYNC_SP();
_SUBR_compe(code);
goto _NEXT;
_SUBR_COMPE:
SYNC_PC();