Open VincentGibert opened 9 years ago
Sorry, I've completely missed this bug report.
It might have something to do with shared library support I think, which perhaps isn't working well together with the --pid= option. Shared libraries are handled via a LD_PRELOAD override, but for an already started process, the LD_PRELOAD wasn't set at startup time. Therefore kcov doesn't detect the loaded libraries when it starts.
You should still get hits from snmpd itself, but not from the other libraries loaded by it.
It makes sense, I will try with a static binary to confirm your analysis.
I just tested with a static version of busybox and it worked well so it seems you guessed right.
Great, thanks for testing!
I think I'll resolve this issue by adding a few lines to the documentation - I don't think it will be very easy to fix the core issue.
You may probably retrieve the list of loaded shared libraries by the process through /proc/
Yes, maybe that's a possibility. I'll keep the bug report open for further investigation.
I took a look at this bug again, and I believe it should be doable to parse /proc/
It will still not cover all cases since it will be difficult to detect dlopen():ing shared libraries this way (which is done via the LD_PRELOAD stuff above as well).
Anyway, it will be Linux-only, but the shared library handling depends on dl_iterate_phdr() as it is today, so it's already Linux-specific.
Hi (again),
When I use kcov with the
--pid
flag, I don't manage to get coverage results.Environment
Processus executed:
/usr/sbin/snmpd
from net-snmp-5.5 compiled using-g -O0
(snmpd binary is not stripped, debug symbols are not in a separate build id).Steps to reproduce
Additional information
If the snmp daemon is executed directly by kcov, coverage results are correctly generated.
-f
flag which prevents snmpd from forking.When running kcov with
--debug=15
, the following message appears:What does it mean ? Maybe some debug information are missing on my system ?