[igt-dev] [PATCH i-g-t] sw_sync: Initialise struct before use

Jani Nikula jani.nikula at linux.intel.com
Thu Jan 31 09:10:53 UTC 2019


On Wed, 30 Jan 2019, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> sw_sync: ../lib/igt_core.c:1592: __igt_fork_helper: Assertion `!proc->running'
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108889
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

So the compiler sees the variable is uninitialized, but it's being
passed to a function... jolly good, that must do the initialization. :/

I trust you checked the other call sites.

Reviewed-by: Jani Nikula <jani.nikula at intel.com>



> ---
>  tests/sw_sync.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/tests/sw_sync.c b/tests/sw_sync.c
> index 207908ed7..ac4caf8ba 100644
> --- a/tests/sw_sync.c
> +++ b/tests/sw_sync.c
> @@ -171,12 +171,11 @@ static void test_sync_busy(void)
>  
>  static void test_sync_busy_fork_unixsocket(void)
>  {
> +	struct igt_helper_process proc = {};
>  	int fence;
>  	int timeline;
>  	int skip = 0;
>  	int sv[2];
> -	struct igt_helper_process proc;
> -
>  
>  	timeline = sw_sync_timeline_create();
>  	fence = sw_sync_timeline_create_fence(timeline, 1);
> @@ -258,10 +257,10 @@ out:
>  
>  static void test_sync_busy_fork(void)
>  {
> +	struct igt_helper_process proc = {};
>  	int fence;
>  	int timeline;
>  	int skip = 0;
> -	struct igt_helper_process proc;
>  
>  	timeline = sw_sync_timeline_create();
>  	fence = sw_sync_timeline_create_fence(timeline, 1);

-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the igt-dev mailing list