Bug 92916 - elf_add freeing strtab_view in fail, even though it shouldn't
Summary: elf_add freeing strtab_view in fail, even though it shouldn't
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: libbacktrace (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-11 23:01 UTC by Marc Streckfuß
Modified: 2020-04-03 22:06 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Streckfuß 2019-12-11 23:01:06 UTC
First of all, apologies if this report doesn't follow the correct convention, but since this is a libbacktrace bug, most of it doesn't apply.

I'm keeping this rather short, since I guess the maintainer is the same one as the github version (https://github.com/ianlancetaylor/libbacktrace), so this is mostly to help internal/upstream tracking and coordination:

https://github.com/ianlancetaylor/libbacktrace/blob/master/elf.c#L2965 claims, that "we hold on to the string table permanently.", which is only true until a https://github.com/ianlancetaylor/libbacktrace/blob/master/elf.c#L3197, which is caused by https://github.com/ianlancetaylor/libbacktrace/blob/master/elf.c#L3071

Now I don't know if it's "okay" for L3071 to fail, like this expected, then Line 3197 is just wrong.
If this is a more critical fault or releasing the symnames there is required, then the changes made to the state (symdata) have to be rolled back, so no one is relying on them as the error is not propagated back, but skipped.

the mentioned backtrace_get_view fails because of backtrace_get_view L77 -> file too short, size = 2884504395, got = 2147479552.

see https://github.com/ianlancetaylor/libbacktrace/issues/29 for where I intially reported this.
Comment 1 Marc Streckfuß 2020-04-03 22:04:22 UTC
This is fixed in https://github.com/ianlancetaylor/libbacktrace, if the changes are also upstream, this bug can be closed.
Comment 2 Ian Lance Taylor 2020-04-03 22:06:13 UTC
I've been postponing a merge from the GitHub repo to the GCC repo because GCC development is in stage 4 (only changes that fix significant bugs).