Closed Bug 1470223 Opened 3 years ago Closed 3 years ago should prefer FUNC records over PUBLIC records, currently does the opposite


(Testing :: General, enhancement, P3)

Version 3


(firefox64 fixed)

Tracking Status
firefox64 --- fixed


(Reporter: ted, Assigned: gsvelto)



(1 file)

While looking at the code for the symbolication API on I noticed that it had a bug where it would prefer PUBLIC records over FUNC records:

I went to look at for comparison and it has the same bug:

That code just sticks all FUNC and PUBLIC addresses in the same list and then binary searches it by address, and has a single dict of address => function name. PUBLIC records usually come after FUNC records in a .sym file, so we'll always overwrite FUNC info with PUBLIC info. Additionally, the code should use the size field in FUNC records to check whether an address actually falls within a function.

I think the code should be changed to build two lists of addresses: one for FUNCs and one for PUBLICs. Additionally FUNC sizes should be stored and we should check that the address falls within [func addr, func addr + size). If no FUNC is found for an address, then the closest PUBLIC record with an address less than the address in question can be returned.

See the Breakpad code that does these lookups for reference:
Priority: -- → P3
This patch changes the way we search symbols when fixing up a stack.
Previously we would find the closest PUBLIC or FUNC entry lower than a given
address. Because of how symbol files were processed we preferred PUBLIC
entries to FUNC ones. Now we look first for the function that contains the
address (obtained from the FUNC entries) then if none is available we look for
the closest, lower PUBLIC entry.
Assignee: nobody → gsvelto
This is a tentative patch as I haven't tested it yet but I wanted some feedback on the overall approach.
Comment on attachment 9006571 [details]
Bug 1470223 - Prefer FUNC entries to PUBLIC entries when fixing symbols

Ted Mielczarek [:ted] [:ted.mielczarek] has approved the revision.
Attachment #9006571 - Flags: review+
Pushed by
Prefer FUNC entries to PUBLIC entries when fixing symbols r=ted
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.