binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

DWARF Debug Info Errors for Debug BinaryView

Open fuzyll opened this issue 1 year ago • 3 comments

Version and Platform (required):

  • Binary Ninja Version: 4.1.5553-dev
  • OS: macOS
  • OS Version: 14.5
  • CPU Architecture: aarch64

Bug Description: At some point in the last week or so, DWARF debug info has regressed slightly in that all of these errors are being printed again:

[Analysis] Attempting to add function not backed by file: 0x1af5a
[Analysis] Attempting to add function not backed by file: 0x53c52
[Analysis] Attempting to add function not backed by file: 0x2b6c4
[Analysis] Attempting to add function not backed by file: 0x6b316
[Analysis] Attempting to add function not backed by file: 0xd00aa
[Analysis] Attempting to add function not backed by file: 0x727b6
[Analysis] Attempting to add function not backed by file: 0x2667c
[Analysis] Attempting to add function not backed by file: 0xbea1c
[Analysis] Attempting to add function not backed by file: 0x3e3d2
[Analysis] Attempting to add function not backed by file: 0xa8456
[Analysis] Attempting to add function not backed by file: 0x674fa
[Analysis] Attempting to add function not backed by file: 0x8aafa
[Analysis] Attempting to add function not backed by file: 0x668ac
[Analysis] Attempting to add function not backed by file: 0x6083a
[Analysis] Attempting to add function not backed by file: 0x2cd34

This is very similar to #5231, except that these errors are not from the BinaryView that we are applying the DWARF information to, but the one we are setting up to copy from. You won't see these in the log at all if you have Log Scope -> Current Tab on.

Steps To Reproduce: Please provide all steps required to reproduce the behavior:

  1. Open a file with Options
  2. Select an external debug info source that includes DWARF information
  3. Open the file and observe the error messages
  4. If you don't see them, make sure your Log Scope includes Global messages

Expected Behavior: There shouldn't be any error messages since, as near I can tell, we are actually applying all of the debug information correctly. (At least, I don't actually see anything missing that I expected.)

Binary: Available upon request, but I have many that exhibit this so I believe it should be fairly easy to reproduce.

Additional Information: From a cursory glance, both of these commits touched DWARF information after I did and may have inadvertently caused the issue:

  • d75066545afdc9b5d0a52bd2518e43f683c671a5
  • 7fe90070052c19d174585e7152ba66f3057328e7

fuzyll avatar Jun 21 '24 02:06 fuzyll

I only encounter this when enabling permissive linear sweep and was told that was expected but should probably be reduced to lower logger level. The dwarf parsing is showing me a LOT more information after the updates that were made to it this week.

ccarpenter04 avatar Jun 22 '24 18:06 ccarpenter04

When we load a debug info ELF we parse the symbol tables in the file and try to create functions at locations not backed by file contents

negasora avatar Jul 03 '24 18:07 negasora

The right way to fix this is to have separate parse and load steps for views, so we don't try to add function definitions to header-only files

negasora avatar Jul 03 '24 21:07 negasora

Fixed in 5.3.8649-dev

negasora avatar Nov 19 '25 22:11 negasora