cutter icon indicating copy to clipboard operation
cutter copied to clipboard

Long ELF section names break UI

Open nametoolong opened this issue 1 year ago • 1 comments

Environment information

  • Operating System: Debian sid
  • Cutter version: 2.3.1
  • Obtained from:
    • [ ] Built from source
    • [x] Downloaded release from Cutter website or GitHub
    • [ ] Distribution repository
  • File format: ELF

Describe the bug

When loading a ELF file with very long section names, Cutter's main window is stretched to exceed the screen size, widgets have weird margins, and graphs become innavigable.

To Reproduce

Steps to reproduce the behavior:

echo "int aAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA(){return 1;}" > example.c
gcc -ffunction-sections -c example.c
cutter example.o

If gcc is called with -fno-function-sections, the UI only shows tiny breakage as per #1904 instead of becoming unusable.

Expected behavior

Cutter works with long ELF section names.

nametoolong avatar Aug 26 '23 19:08 nametoolong

It would be reasonable to truncate, such as aAAA...AAAA

lionkor avatar Aug 27 '23 10:08 lionkor