Bug 30114 - Add valgrind annotations to obstack
Summary: Add valgrind annotations to obstack
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: build (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-11 17:07 UTC by Tom Tromey
Modified: 2023-09-15 15:55 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Tromey 2023-02-11 17:07:26 UTC
https://sourceware.org/bugzilla/show_bug.cgi?id=25479#c7 points out
that valgrind annotations could be added to the obstack code,
and then we could detect buffer overruns there as well.

 http://valgrind.org/docs/manual/mc-manual.html#mc-manual.mempools
Comment 1 Tom Tromey 2023-02-12 14:41:36 UTC
I wonder though if this could be done in libc first, or maybe gnulib.
And perhaps the libiberty copy should be sync'd with one of those.
Comment 2 Tom Tromey 2023-09-15 13:52:12 UTC
There are also ASAN annotations available.
Comment 3 Simon Marchi 2023-09-15 13:54:12 UTC
(In reply to Tom Tromey from comment #2)
> There are also ASAN annotations available.

I suppose you are talking about:

https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning
Comment 4 Tom Tromey 2023-09-15 15:55:37 UTC
(In reply to Simon Marchi from comment #3)

> I suppose you are talking about:

Yes, thanks for the link.

It would also be good to instrument objalloc, which is used by BFD.
For that one, maybe in the sanitizer case, every allocation could
just be done in a new chunk.