ovni/test/emu/ovni/empty-stream.c
Rodrigo Arias 0df018cf5f Fix segfault reading empty streams
The check_clock_gate() was trying to access to the first event in all
streams. However, streams that are empty don't have any event, so they
cause a NULL dereference. Skipping not active streams avoids the
problem.
2023-10-23 10:07:44 +02:00

20 lines
338 B
C

/* Copyright (c) 2023 Barcelona Supercomputing Center (BSC)
* SPDX-License-Identifier: GPL-3.0-or-later */
#include <ovni.h>
#include "instr.h"
/* Create a trace where a stream doesn't contain any event */
int
main(void)
{
instr_start(0, 1);
/* Don't flush the thread to create an empty stream */
ovni_proc_fini();
return 0;
}