#4383 closed defect (fixed)

covoar keeps DWARF info in memory too long

Reported by: Alex White Owned by: Alex White
Priority: normal Milestone: 6.1
Component: tool Version: 6
Severity: normal Keywords: coverage, covoar
Cc: Blocked By:


To get covoar working again, the ELF and DWARF info cleanup was moved from the ExecutableInfo constructor to the ExecutableInfo destructor. Without this change, covoar would report the locations of symbols as unknown:-1. This is because the DWARF info is used later in the ExecutableInfo::getSourceAndLine() method with a call to debug.get_source().

This caused a new issue: the ELF and DWARF info is now held in memory for the life of the program. This causes very high memory usage when running covoar, more than 10 GB for some BSPs.

A quick and dirty solution is to find what is being referenced in debug.get_source() and preserve it after debug.end() is called. It appears that refraining from calling cus.clear() in rld::dwarf::file::end() would be a good place to start. Additionally, the rld::dwarf::sources class will likely need to be changed to copy out the DWARF source file info.

Change History (3)

comment:1 Changed on 04/08/21 at 17:50:19 by Alex White

Owner: set to Alex White
Status: newaccepted

comment:2 Changed on 06/17/21 at 21:05:37 by Alex White <alex.white@…>

In a88be93/rtems-tools:

covoar: Store only the file name in ExecutableInfo?

This changes the ExecutableInfo? class to only store the executable
file's name rather than an entire instance of rld::files::object. This
allows the rld::files::object to be cleaned up in the ExecutableInfo?

Updates #4383

comment:3 Changed on 06/17/21 at 21:05:39 by Alex White <alex.white@…>

Resolution: fixed
Status: acceptedclosed

In ac56fce/rtems-tools:

covoar: Store address-to-line info outside of DWARF

This adds the AddressToLineMapper? class and supporting classes to
assume responsibility of tracking address-to-line information.

This allows the DWARF library to properly cleanup all of its resources
and leads to significant memory savings.

Closes #4383

Note: See TracTickets for help on using tickets.