Simon McVittie  
		
	
	76148fc6db 
	
	
	tests: Don't assume that sh optimizes simple commands into exec  
		
			... 
			Depending on the operating system, /bin/sh might either be bash (for
example on Fedora or Arch) or dash (for example on Debian or Ubuntu)
or some other POSIX shell.
When bash is asked to run a simple command with no shell keywords or
metacharacters, like this one, it replaces itself with the program
via execve(), but dash does not have that optimization and treats it
like any other program invocation in a larger script: it will fork,
exec the program in the child, and wait for the child in the parent.
This seems like it conflicts with sleep_and_kill() assuming that it can
use the subprocess's process ID as the sleep(1) process ID. Specifically,
if it sends SIGKILL, it will go to the sh(1) process and not the sleep(1)
child, which could result in the sh(1) process being terminated and
its sleep(1) child being leaked.
To get the bash-like behaviour portably, explicitly use the exec builtin
to instruct the shell to replace itself with sleep(1), so that the
process ID previously used for the shell becomes the process ID of the
sleep process.
This appears to resolve an intermittent hang and test timeout on Debian
machines (especially slower ones), although I'm not 100% clear on the
mechanics of how it happens.
Resolves: https://gitlab.gnome.org/GNOME/glib/-/issues/3157 
Signed-off-by: Simon McVittie <smcv@collabora.com > 
		
	 
 
		2023-11-01 17:56:48 +00:00 
	 
	
	
	
		  ..
	 
	
	
		
			
			
			
			
			
			2022-01-07 11:27:56 -06:00 
		 
	
		
	
		
			
			
			
			
			
			2023-05-10 10:56:44 +07:00 
		 
	
		
			
			
			
			
			
			2023-01-08 00:33:14 +00:00 
		 
	
		
			
			
			
			
			
			2022-10-13 20:53:56 -04:00 
		 
	
		
	
		
			
			
			
			
			
			2022-09-20 11:30:02 -04:00 
		 
	
		
	
		
	
		
			
			
			
			
			
			2020-11-15 17:34:27 +01:00 
		 
	
		
	
		
			
			
			
			
			
			2023-10-02 17:17:24 +01:00 
		 
	
		
	
		
			
			
			
			
			
			2022-09-13 02:44:25 +02:00 
		 
	
		
	
		
	
		
			
			
			
			
			
			2022-12-12 15:58:13 +01:00 
		 
	
		
	
		
			
			
			
			
			
			2020-06-10 09:48:02 +01:00 
		 
	
		
	
		
			
			
			
			
			
			2023-10-22 23:34:00 +01:00 
		 
	
		
			
			
			
			
			
			2022-12-09 10:45:21 +00:00 
		 
	
		
			
			
			
			
			
			2023-04-20 16:37:32 +02:00 
		 
	
		
			
			
			
			
			
			2023-10-03 09:10:21 +01:00 
		 
	
		
			
			
			
			
			
			2022-11-02 12:34:19 +00:00 
		 
	
		
			
			
			
			
			
			2022-11-02 12:34:19 +00:00 
		 
	
		
	
		
			
			
			
			
			
			2023-05-22 22:44:52 +02:00 
		 
	
		
			
			
			
			
			
			2022-11-02 12:34:19 +00:00 
		 
	
		
	
		
			
			
			
			
			
			2022-12-15 19:30:43 +01:00 
		 
	
		
			
			
			
			
			
			2023-08-14 23:46:09 -03:00 
		 
	
		
			
			
			
			
			
			2022-11-07 11:30:32 +00:00 
		 
	
		
			
			
			
			
			
			2022-12-13 14:07:58 +00:00 
		 
	
		
			
			
			
			
			
			2022-11-02 12:34:19 +00:00 
		 
	
		
			
			
			
			
			
			2022-11-02 12:34:19 +00:00 
		 
	
		
			
			
			
			
			
			2023-10-12 11:45:03 +02:00 
		 
	
		
			
			
			
			
			
			2022-11-02 12:34:19 +00:00 
		 
	
		
			
			
			
			
			
			2022-11-02 12:34:19 +00:00 
		 
	
		
			
			
			
			
			
			2022-12-19 12:45:02 +00:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2023-08-03 09:16:26 -05:00 
		 
	
		
			
			
			
			
			
			2022-06-21 12:50:31 +01:00 
		 
	
		
			
			
			
			
			
			2022-09-21 11:19:31 +01:00 
		 
	
		
			
			
			
			
			
			2023-10-03 14:05:27 +02:00 
		 
	
		
			
			
			
			
			
			2021-05-13 20:16:46 +00:00 
		 
	
		
			
			
			
			
			
			2020-11-14 19:03:18 +00:00 
		 
	
		
	
		
			
			
			
			
			
			2022-06-22 20:07:25 +02:00 
		 
	
		
			
			
			
			
			
			2023-01-17 21:08:49 +01:00 
		 
	
		
			
			
			
			
			
			2023-01-17 21:08:49 +01:00 
		 
	
		
			
			
			
			
			
			2022-12-09 10:45:21 +00:00 
		 
	
		
			
			
			
			
			
			2022-12-08 05:21:19 +01:00 
		 
	
		
			
			
			
			
			
			2023-10-16 18:12:49 +03:00 
		 
	
		
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2022-11-02 12:34:19 +00:00 
		 
	
		
			
			
			
			
			
			2023-10-03 09:32:44 +01:00 
		 
	
		
			
			
			
			
			
			2022-11-02 12:34:19 +00:00 
		 
	
		
			
			
			
			
			
			2022-11-02 12:34:19 +00:00 
		 
	
		
	
		
	
		
			
			
			
			
			
			2021-05-13 20:16:46 +00:00 
		 
	
		
			
			
			
			
			
			2021-05-13 20:16:46 +00:00 
		 
	
		
	
		
	
		
			
			
			
			
			
			2023-05-22 22:44:52 +02:00 
		 
	
		
			
			
			
			
			
			2023-05-02 13:42:54 +02:00 
		 
	
		
			
			
			
			
			
			2022-06-23 10:47:13 +01:00 
		 
	
		
			
			
			
			
			
			2022-11-23 11:15:20 +00:00 
		 
	
		
			
			
			
			
			
			2023-03-13 11:21:17 +00:00 
		 
	
		
			
			
			
			
			
			2022-11-23 11:15:20 +00:00 
		 
	
		
			
			
			
			
			
			2023-08-16 14:31:40 +01:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2022-11-23 11:15:20 +00:00 
		 
	
		
			
			
			
			
			
			2023-05-02 13:42:54 +02:00 
		 
	
		
			
			
			
			
			
			2022-11-23 11:15:20 +00:00 
		 
	
		
			
			
			
			
			
			2021-05-13 20:16:46 +00:00 
		 
	
		
			
			
			
			
			
			2022-11-23 11:15:20 +00:00 
		 
	
		
			
			
			
			
			
			2021-04-15 10:19:29 +02:00 
		 
	
		
	
		
			
			
			
			
			
			2020-10-01 16:32:50 +01:00 
		 
	
		
			
			
			
			
			
			2021-05-13 20:16:46 +00:00 
		 
	
		
			
			
			
			
			
			2023-01-31 11:44:44 +00:00 
		 
	
		
			
			
			
			
			
			2023-03-20 13:03:04 +00:00 
		 
	
		
			
			
			
			
			
			2021-04-23 10:43:05 +02:00 
		 
	
		
			
			
			
			
			
			2021-04-23 10:43:05 +02:00 
		 
	
		
	
		
			
			
			
			
			
			2021-05-13 20:16:46 +00:00 
		 
	
		
			
			
			
			
			
			2021-05-13 20:16:46 +00:00 
		 
	
		
			
			
			
			
			
			2022-11-23 11:15:20 +00:00 
		 
	
		
			
			
			
			
			
			2023-01-06 11:46:01 +00:00 
		 
	
		
			
			
			
			
			
			2022-11-23 11:15:20 +00:00 
		 
	
		
			
			
			
			
			
			2022-11-23 11:15:20 +00:00 
		 
	
		
			
			
			
			
			
			2022-12-16 10:28:50 +00:00 
		 
	
		
			
			
			
			
			
			2022-11-23 11:15:20 +00:00 
		 
	
		
			
			
			
			
			
			2022-06-23 10:47:13 +01:00 
		 
	
		
			
			
			
			
			
			2022-11-23 11:15:20 +00:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2022-09-02 21:21:34 +02:00 
		 
	
		
			
			
			
			
			
			2022-11-23 11:15:20 +00:00 
		 
	
		
			
			
			
			
			
			2022-11-23 11:15:20 +00:00 
		 
	
		
			
			
			
			
			
			2022-11-23 11:15:20 +00:00 
		 
	
		
			
			
			
			
			
			2022-11-23 11:15:20 +00:00 
		 
	
		
			
			
			
			
			
			2022-07-18 19:39:41 +01:00 
		 
	
		
			
			
			
			
			
			2023-08-28 11:11:37 +01:00 
		 
	
		
			
			
			
			
			
			2022-11-10 14:25:47 +00:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2022-06-01 12:44:23 +01:00 
		 
	
		
			
			
			
			
			
			2023-06-30 22:59:37 +02:00 
		 
	
		
			
			
			
			
			
			2022-11-23 11:15:20 +00:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2022-06-01 12:44:23 +01:00 
		 
	
		
			
			
			
			
			
			2023-01-17 21:08:49 +01:00 
		 
	
		
			
			
			
			
			
			2022-11-23 11:15:20 +00:00 
		 
	
		
			
			
			
			
			
			2020-11-17 15:50:07 +00:00 
		 
	
		
			
			
			
			
			
			2022-06-28 11:19:21 +01:00 
		 
	
		
			
			
			
			
			
			2021-11-17 14:40:38 +01:00 
		 
	
		
			
			
			
			
			
			2022-11-07 11:30:32 +00:00 
		 
	
		
			
			
			
			
			
			2023-01-06 11:46:01 +00:00 
		 
	
		
			
			
			
			
			
			2023-05-02 13:42:54 +02:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2022-06-01 12:44:23 +01:00 
		 
	
		
			
			
			
			
			
			2022-07-25 22:30:22 +01:00 
		 
	
		
			
			
			
			
			
			2022-06-23 10:47:13 +01:00 
		 
	
		
			
			
			
			
			
			2023-10-04 14:50:54 +01:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2023-11-01 17:56:48 +00:00 
		 
	
		
			
			
			
			
			
			2023-10-26 10:54:34 +02:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2022-06-01 12:44:23 +01:00 
		 
	
		
			
			
			
			
			
			2023-05-22 22:44:52 +02:00 
		 
	
		
			
			
			
			
			
			2022-06-01 12:44:23 +01:00 
		 
	
		
			
			
			
			
			
			2021-05-13 20:16:46 +00:00 
		 
	
		
			
			
			
			
			
			2022-11-02 12:34:19 +00:00 
		 
	
		
			
			
			
			
			
			2022-11-02 12:34:19 +00:00 
		 
	
		
			
			
			
			
			
			2023-02-16 13:50:15 +00:00 
		 
	
		
			
			
			
			
			
			2020-06-12 15:01:08 +01:00 
		 
	
		
			
			
			
			
			
			2022-10-27 14:50:48 +01:00 
		 
	
		
			
			
			
			
			
			2022-11-02 12:34:19 +00:00 
		 
	
		
			
			
			
			
			
			2021-09-06 14:46:15 +02:00 
		 
	
		
			
			
			
			
			
			2023-10-02 15:00:23 +01:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2022-11-02 12:34:19 +00:00 
		 
	
		
			
			
			
			
			
			2022-07-15 22:07:03 +02:00 
		 
	
		
			
			
			
			
			
			2023-11-01 11:24:17 +00:00 
		 
	
		
			
			
			
			
			
			2021-04-15 10:19:29 +02:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2022-06-01 12:44:23 +01:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2023-08-14 09:32:43 +01:00 
		 
	
		
			
			
			
			
			
			2022-06-01 12:44:23 +01:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2022-07-15 22:07:03 +02:00 
		 
	
		
			
			
			
			
			
			2021-06-04 12:09:24 +00:00 
		 
	
		
	
		
	
		
	
		
			
			
			
			
			
			2023-08-03 09:16:26 -05:00 
		 
	
		
			
			
			
			
			
			2022-11-02 12:34:19 +00:00 
		 
	
		
			
			
			
			
			
			2023-01-27 11:58:56 +03:00 
		 
	
		
			
			
			
			
			
			2023-10-02 15:00:23 +01:00 
		 
	
		
			
			
			
			
			
			2022-11-24 20:03:39 +01:00 
		 
	
		
			
			
			
			
			
			2022-11-24 20:03:39 +01:00 
		 
	
		
			
			
			
			
			
			2022-11-24 20:03:39 +01:00 
		 
	
		
			
			
			
			
			
			2022-11-24 20:03:39 +01:00 
		 
	
		
			
			
			
			
			
			2022-11-24 20:03:39 +01:00 
		 
	
		
			
			
			
			
			
			2023-05-30 12:28:45 +01:00 
		 
	
		
			
			
			
			
			
			2023-05-30 12:28:45 +01:00 
		 
	
		
			
			
			
			
			
			2023-05-30 12:28:45 +01:00 
		 
	
		
			
			
			
			
			
			2023-05-30 12:28:45 +01:00 
		 
	
		
			
			
			
			
			
			2021-08-13 01:32:31 +02:00 
		 
	
		
			
			
			
			
			
			2023-10-02 15:00:23 +01:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2022-11-01 13:40:35 -05:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2021-04-29 12:40:05 +02:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2023-04-27 12:23:25 +01:00 
		 
	
		
			
			
			
			
			
			2022-10-13 20:53:56 -04:00 
		 
	
		
			
			
			
			
			
			2022-11-07 11:30:32 +00:00 
		 
	
		
			
			
			
			
			
			2022-11-24 20:03:39 +01:00 
		 
	
		
			
			
			
			
			
			2021-05-13 20:16:46 +00:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
	
		
			
			
			
			
			
			2023-04-29 21:48:03 +03:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2023-04-29 21:48:03 +03:00 
		 
	
		
			
			
			
			
			
			2023-04-29 21:48:03 +03:00 
		 
	
		
			
			
			
			
			
			2023-10-12 11:32:03 +02:00 
		 
	
		
			
			
			
			
			
			2022-11-02 12:34:19 +00:00 
		 
	
		
			
			
			
			
			
			2022-06-01 12:44:23 +01:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2020-11-17 15:50:07 +00:00 
		 
	
		
			
			
			
			
			
			2022-11-10 14:25:47 +00:00 
		 
	
		
	
		
	
		
			
			
			
			
			
			2020-06-12 15:01:08 +01:00 
		 
	
		
	
		
	
		
	
		
	
		
	
		
			
			
			
			
			
			2023-06-30 22:59:37 +02:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2022-06-01 12:44:23 +01:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2022-06-01 12:44:23 +01:00 
		 
	
		
			
			
			
			
			
			2020-11-14 19:03:18 +00:00 
		 
	
		
	
		
			
			
			
			
			
			2023-03-15 14:45:10 +00:00 
		 
	
		
			
			
			
			
			
			2022-11-02 12:34:19 +00:00 
		 
	
		
			
			
			
			
			
			2022-06-23 10:47:13 +01:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2022-06-01 12:44:23 +01:00 
		 
	
		
			
			
			
			
			
			2023-08-16 14:31:40 +01:00 
		 
	
		
			
			
			
			
			
			2022-05-18 09:20:07 +01:00 
		 
	
		
			
			
			
			
			
			2022-11-02 12:34:19 +00:00 
		 
	
		
			
			
			
			
			
			2023-08-29 11:22:43 +01:00 
		 
	
		
			
			
			
			
			
			2020-06-10 09:48:02 +01:00 
		 
	
		
			
			
			
			
			
			2022-11-02 12:34:19 +00:00 
		 
	
		
			
			
			
			
			
			2023-10-12 11:32:03 +02:00