Commit Graph

116378 Commits

Author SHA1 Message Date
GDB Administrator
6cb1a337b3 Automatic date update in version.in 2024-02-09 00:00:29 +00:00
GDB Administrator
4dde01ea00 Automatic date update in version.in 2024-02-08 00:01:44 +00:00
GDB Administrator
5c5907ece3 Automatic date update in version.in 2024-02-07 00:01:42 +00:00
Tom de Vries
7c709b26ba [gdb/tdep] Fix use-after-free in arm_exidx_fill_cache
On arm-linux the linaro CI occasionally reports:
...
 (gdb) up 10
 #4  0x0001b864 in pthread_join ()
 (gdb) FAIL: gdb.threads/staticthreads.exp: up 10
...
while this is expected:
...
 (gdb) up 10
 #3  0x00010568 in main (argc=1, argv=0xfffeede4) at staticthreads.c:76
 76          pthread_join (thread, NULL);
 (gdb) PASS: gdb.threads/staticthreads.exp: up 10
...

Thiago investigated the problem, and using valgrind found an invalid read in
arm_exidx_fill_cache.

The problem happens as follows:
- an objfile and corresponding per_bfd are allocated
- some memory is allocated in arm_exidx_new_objfile using
  objfile->objfile_obstack, for the "exception table entry cache".
- a symbol reread is triggered, and the objfile, including the
  objfile_obstack, is destroyed
- a new objfile is allocated, using the same per_bfd
- again arm_exidx_new_objfile is called, but since the same per_bfd is used,
  it doesn't allocate any new memory for the "exception table entry cache".
- the "exception table entry cache" is accessed by arm_exidx_fill_cache,
  and we have a use-after-free.

This is a regression since commit a2726d4ff8 ("[ARM] Store exception handling
information per-bfd instead of per-objfile"), which changed the "exception
table entry cache" from per-objfile to per-bfd, but failed to update the
obstack_alloc.

Fix this by using objfile->per_bfd->storage_obstack instead of
objfile->objfile_obstack.

I couldn't reproduce the FAIL myself, but Thiago confirmed that the patch
fixes it.

Tested on arm-linux.

Approved-By: Luis Machado <luis.machado@arm.com>

PR tdep/31254
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31254
2024-02-06 17:59:06 -03:00
GDB Administrator
9163aee2af Automatic date update in version.in 2024-02-06 00:01:45 +00:00
GDB Administrator
fb2afe5818 Automatic date update in version.in 2024-02-05 00:00:44 +00:00
GDB Administrator
76b6b4211e Automatic date update in version.in 2024-02-04 00:01:26 +00:00
GDB Administrator
3f40b80cfa Automatic date update in version.in 2024-02-03 00:00:39 +00:00
GDB Administrator
13e289fc38 Automatic date update in version.in 2024-02-02 00:01:30 +00:00
GDB Administrator
d341144d05 Automatic date update in version.in 2024-02-01 00:01:47 +00:00
GDB Administrator
e35596ea05 Automatic date update in version.in 2024-01-31 00:00:53 +00:00
GDB Administrator
d9ecf4bc08 Automatic date update in version.in 2024-01-30 00:01:27 +00:00
GDB Administrator
c75cd1d04d Automatic date update in version.in 2024-01-29 00:01:25 +00:00
GDB Administrator
d09744378c Automatic date update in version.in 2024-01-28 00:00:32 +00:00
GDB Administrator
04049e81f1 Automatic date update in version.in 2024-01-27 00:01:05 +00:00
GDB Administrator
c5f15eb674 Automatic date update in version.in 2024-01-26 00:01:00 +00:00
GDB Administrator
724ddc0eeb Automatic date update in version.in 2024-01-25 00:02:01 +00:00
GDB Administrator
d739d4fd45 Automatic date update in version.in 2024-01-24 00:01:35 +00:00
Guinevere Larsen
4fe1a40c7c gdb: fix "list ." related crash
When a user attempts to use the "list ." command with an inferior that
doesn't have debug symbols, GDB would crash. This was reported as PR
gdb/31256.

The crash would happen when attempting to get the current symtab_and_line
for the stop location, because the symtab would return a null pointer
and we'd attempt to dereference it to print the line.

This commit fixes that by checking for an empty symtab and erroring out
of the function if it happens.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31256
Approved-By: Tom Tromey <tom@tromey.com>
2024-01-23 17:00:40 +01:00
GDB Administrator
9ccb91f0c2 Automatic date update in version.in 2024-01-23 00:01:39 +00:00
GDB Administrator
91e7b0888a Automatic date update in version.in 2024-01-22 00:01:08 +00:00
GDB Administrator
e9b351798f Automatic date update in version.in 2024-01-21 00:01:06 +00:00
GDB Administrator
96fdb048b1 Automatic date update in version.in 2024-01-20 00:00:29 +00:00
GDB Administrator
76b6f2cfa3 Automatic date update in version.in 2024-01-19 00:01:32 +00:00
GDB Administrator
715331f0bb Automatic date update in version.in 2024-01-18 00:01:23 +00:00
GDB Administrator
9843c0189f Automatic date update in version.in 2024-01-17 00:01:47 +00:00
GDB Administrator
021f424ff0 Automatic date update in version.in 2024-01-16 00:01:28 +00:00
GDB Administrator
90637940cd Automatic date update in version.in 2024-01-15 00:00:57 +00:00
GDB Administrator
eb6ac7880a Automatic date update in version.in 2024-01-14 00:00:27 +00:00
GDB Administrator
82d9840bb3 Automatic date update in version.in 2024-01-13 00:00:31 +00:00
GDB Administrator
9076a9fe74 Automatic date update in version.in 2024-01-12 00:01:11 +00:00
GDB Administrator
f4f45bdde3 Automatic date update in version.in 2024-01-11 00:01:51 +00:00
GDB Administrator
ec75ee60a3 Automatic date update in version.in 2024-01-10 00:04:02 +00:00
GDB Administrator
3fb7f9d13d Automatic date update in version.in 2024-01-09 00:04:27 +00:00
GDB Administrator
96e96de206 Automatic date update in version.in 2024-01-08 00:01:34 +00:00
GDB Administrator
ee51e3fda3 Automatic date update in version.in 2024-01-07 00:03:52 +00:00
GDB Administrator
0677303ae2 Automatic date update in version.in 2024-01-06 00:01:59 +00:00
GDB Administrator
42d6bc8346 Automatic date update in version.in 2024-01-05 00:03:21 +00:00
GDB Administrator
25c9c6d65b Automatic date update in version.in 2024-01-04 00:02:58 +00:00
GDB Administrator
dd325ea5aa Automatic date update in version.in 2024-01-03 00:02:30 +00:00
GDB Administrator
3293cc2c26 Automatic date update in version.in 2024-01-02 00:01:34 +00:00
GDB Administrator
e3be5019f2 Automatic date update in version.in 2024-01-01 00:01:08 +00:00
GDB Administrator
b2567d4757 Automatic date update in version.in 2023-12-31 00:00:40 +00:00
GDB Administrator
6d513780c5 Automatic date update in version.in 2023-12-30 00:00:48 +00:00
GDB Administrator
fccb562142 Automatic date update in version.in 2023-12-29 00:01:00 +00:00
GDB Administrator
551400b4d3 Automatic date update in version.in 2023-12-28 00:02:54 +00:00
GDB Administrator
345162ea6f Automatic date update in version.in 2023-12-27 00:01:49 +00:00
GDB Administrator
e74fd29164 Automatic date update in version.in 2023-12-26 00:02:12 +00:00
GDB Administrator
45be6654f0 Automatic date update in version.in 2023-12-25 00:01:32 +00:00
GDB Administrator
bf3e158cc5 Automatic date update in version.in 2023-12-24 00:01:18 +00:00