There is a race condition in _init_logfile() in trace.c If a application fork and execute child process by execl() value of CAIRO_TRACE_FD is also duplicated and the value of CAIRO_TRACE_FD will be -1 in child process. In that case child process doesn,t create new log file and we can,t get trace file of child process. Thanks.
You can see the reason why it has to be like that? The trace file is a sequential stream and can't handle multiple processes simultaneously. To handle such tracing, the idea was to specify a directory and for each trace to be written to a separate file (in CAIRO_TRACE_OUTDIR). However, looks like that's broken if the child is spawned after the logfile is open. Can you please try: diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c index da7d2f0..f7945e7 100644 --- a/util/cairo-trace/trace.c +++ b/util/cairo-trace/trace.c @@ -832,7 +832,7 @@ _init_logfile (void) filename, name, getpid()); filename = buf; - + } else { setenv ("CAIRO_TRACE_FD", "-1", 1); }
Hi, Chris If I block setenv() I can get trace from both Parent and Child process. Actually I already got trace by workaround but I just want to let you know the problem. Thank you.
In general, that will lead to an unreplayable trace.
If Parent and Child don't share any resources (context, surface, pattern etc) each other Do I still get unreplayable trace ?
You will get a broken trace if the parent and child ever call into cairo concurrently - that is if A sets up some state then B performs a fill assuming its own earlier state was still valid.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/cairo/cairo/issues/227.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.