Bug 395416

Summary: --log-file output isn't split correctly after call vgdb
Product: [Developer tools] valgrind Reporter: Opera Wang <opera.wang+kde>
Component: memcheckAssignee: Julian Seward <jseward>
Status: RESOLVED WORKSFORME    
Severity: normal CC: philippe.waroquiers
Priority: NOR    
Version First Reported In: 3.13.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Opera Wang 2018-06-15 08:31:19 UTC
To work around bug 395414 , we call vgdb periodically to see if the application calls exit() but does not quit.

However, it turns out call vgdb will make split log file does not work correctly, if we do not call vgdb, the fix in bug 162848 works fine. But if we call vgdb on parent process eg 29351:
/depotbld/RHEL5.5/tools/valgrind/3.13.0-rhel-6/bin/vgdb --pid=29351 v.info scheduler

Then child process 31414's log file only contains a few start information like valgrind command line options, and the left log will mixed in 29351's log:

--29351-- REDIR: 0xfe25cc0 (libc.so.6:strcspn) redirected to 0xa564730 (_vgnU_ifunc_wrapper)
--29351-- REDIR: 0xfed89e0 (libc.so.6:__strcspn_sse42) redirected to 0xa7700b0 (strcspn)
==31414== Reset valgrind output to log (reset_after_fork)
==31414== Warning: invalid file descriptor -1 in syscall close()
==31414==    at 0xB48F870: __close_nocancel (in /lib64/libpthread-2.12.so)
Comment 1 Philippe Waroquiers 2018-07-27 21:53:25 UTC
I tried to reproduce it, but could not.

Can you attach a compilable small C program to reproduce it,
together with the precise commands to reproduce the problem:
* valgrind options used to start the C program
* at what time do you start vgdb

Thanks

Philippe
Comment 2 Philippe Waroquiers 2018-09-03 21:29:55 UTC
Any news/feedback/additional data ?