Debian Codegraph @

build/debian-packages/valgrind.diff

raw
1 diff -Nru valgrind-3.20.0/debian/changelog valgrind-3.20.0/debian/changelog
2 --- valgrind-3.20.0/debian/changelog 2023-01-11 00:51:40.000000000 +0900
3 +++ valgrind-3.20.0/debian/changelog 2024-09-10 08:52:50.000000000 +0900
4 @@ -1,3 +1,9 @@
5 +valgrind (1:3.20.0-1moz1) UNRELEASED; urgency=medium
6 +
7 + * Apply fix for https://bugs.kde.org/show_bug.cgi?id=492663
8 +
9 + -- Mike Hommey <[email protected]> Tue, 10 Sep 2024 08:52:50 +0900
10 +
11 valgrind (1:3.20.0-1) experimental; urgency=medium
12
13 * New upstream release.
14 diff -Nru valgrind-3.20.0/debian/patches/fix-upstream-bug492663 valgrind-3.20.0/debian/patches/fix-upstream-bug492663
15 --- valgrind-3.20.0/debian/patches/fix-upstream-bug492663 1970-01-01 09:00:00.000000000 +0900
16 +++ valgrind-3.20.0/debian/patches/fix-upstream-bug492663 2024-09-10 08:52:39.000000000 +0900
17 @@ -0,0 +1,96 @@
18 +--- valgrind-3.20.0.orig/coregrind/m_debuginfo/debuginfo.c
19 ++++ valgrind-3.20.0/coregrind/m_debuginfo/debuginfo.c
20 +@@ -1073,7 +1073,8 @@ static ULong di_notify_ACHIEVE_ACCEPT_ST
21 + load_client -> VG_(do_exec) -> VG_(do_exec_inner) ->
22 + exe_handlers->load_fn ( == VG_(load_ELF) ).
23 +
24 +- This does the mmap'ing and creats the associated NSegments.
25 ++ This does the mmap'ing with VG_(am_do_mmap_NO_NOTIFY)
26 ++ and creates the associated NSegments.
27 +
28 + The NSegments may get merged, (see maybe_merge_nsegments)
29 + so there could be more PT_LOADs than there are NSegments.
30 +@@ -1124,7 +1125,7 @@ static ULong di_notify_ACHIEVE_ACCEPT_ST
31 + ULong VG_(di_notify_mmap)( Addr a, Bool allow_SkFileV, Int use_fd )
32 + {
33 + NSegment const * seg;
34 +- Int rw_load_count;
35 ++ Int expected_rw_load_count;
36 + const HChar* filename;
37 + Bool is_rx_map, is_rw_map, is_ro_map;
38 +
39 +@@ -1348,9 +1349,9 @@ ULong VG_(di_notify_mmap)( Addr a, Bool
40 + /* We're only interested in mappings of object files. */
41 + # if defined(VGO_linux) || defined(VGO_solaris) || defined(VGO_freebsd)
42 +
43 +- rw_load_count = 0;
44 ++ expected_rw_load_count = 0;
45 +
46 +- elf_ok = ML_(check_elf_and_get_rw_loads) ( actual_fd, filename, &rw_load_count );
47 ++ elf_ok = ML_(check_elf_and_get_rw_loads) ( actual_fd, filename, &expected_rw_load_count, use_fd == -1 );
48 +
49 + if (use_fd == -1) {
50 + VG_(close)( actual_fd );
51 +@@ -1363,7 +1364,7 @@ ULong VG_(di_notify_mmap)( Addr a, Bool
52 + # elif defined(VGO_darwin)
53 + if (!ML_(is_macho_object_file)( buf1k, (SizeT)sr_Res(preadres) ))
54 + return 0;
55 +- rw_load_count = 1;
56 ++ expected_rw_load_count = 1;
57 + # else
58 + # error "unknown OS"
59 + # endif
60 +@@ -1423,8 +1424,8 @@ ULong VG_(di_notify_mmap)( Addr a, Bool
61 + /* So, finally, are we in an accept state? */
62 + vg_assert(!di->have_dinfo);
63 + if (di->fsm.have_rx_map &&
64 +- rw_load_count >= 1 &&
65 +- di->fsm.rw_map_count == rw_load_count) {
66 ++ expected_rw_load_count >= 1 &&
67 ++ di->fsm.rw_map_count == expected_rw_load_count) {
68 + /* Ok, so, finally, we found what we need, and we haven't
69 + already read debuginfo for this object. So let's do so now.
70 + Yee-ha! */
71 +@@ -1437,7 +1438,8 @@ ULong VG_(di_notify_mmap)( Addr a, Bool
72 + /* If we don't have an rx and rw mapping, go no further. */
73 + if (debug)
74 + VG_(dmsg)("di_notify_mmap-6: "
75 +- "no dinfo loaded %s (no rx or no rw mapping)\n", filename);
76 ++ "no dinfo loaded %s (no rx or rw mappings (%d) not reached expected count (%d))\n",
77 ++ filename, di->fsm.rw_map_count, expected_rw_load_count);
78 + return 0;
79 + }
80 + }
81 +--- valgrind-3.20.0.orig/coregrind/m_debuginfo/priv_readelf.h
82 ++++ valgrind-3.20.0/coregrind/m_debuginfo/priv_readelf.h
83 +@@ -52,7 +52,8 @@ extern Bool ML_(is_elf_object_file)( con
84 + */
85 + extern Bool ML_(read_elf_debug_info) ( DebugInfo* di );
86 +
87 +-extern Bool ML_(check_elf_and_get_rw_loads) ( Int fd, const HChar* filename, Int * rw_load_count );
88 ++extern Bool ML_(check_elf_and_get_rw_loads) ( Int fd, const HChar* filename,
89 ++ Int * rw_load_count, Bool from_nsegments );
90 +
91 +
92 + #endif /* ndef __PRIV_READELF_H */
93 +--- valgrind-3.20.0.orig/coregrind/m_debuginfo/readelf.c
94 ++++ valgrind-3.20.0/coregrind/m_debuginfo/readelf.c
95 +@@ -3650,7 +3650,8 @@ Bool ML_(read_elf_debug_info) ( struct _
96 + /* NOTREACHED */
97 + }
98 +
99 +-Bool ML_(check_elf_and_get_rw_loads) ( Int fd, const HChar* filename, Int * rw_load_count )
100 ++Bool ML_(check_elf_and_get_rw_loads) ( Int fd, const HChar* filename,
101 ++ Int * rw_load_count, Bool from_nsegments )
102 + {
103 + Bool res, ok;
104 + UWord i;
105 +@@ -3719,7 +3720,7 @@ Bool ML_(check_elf_and_get_rw_loads) ( I
106 + * second PT_LOAD falls exactly on 0x1000) then the NSegements
107 + * will get merged and VG_(di_notify_mmap) only gets called once. */
108 + if (*rw_load_count == 2 &&
109 +- ehdr_m.e_type == ET_EXEC &&
110 ++ from_nsegments &&
111 + a_phdr.p_offset == VG_PGROUNDDN(a_phdr.p_offset) )
112 + {
113 + *rw_load_count = 1;
114 diff -Nru valgrind-3.20.0/debian/patches/series valgrind-3.20.0/debian/patches/series
115 --- valgrind-3.20.0/debian/patches/series 2022-11-11 00:49:21.000000000 +0900
116 +++ valgrind-3.20.0/debian/patches/series 2024-09-10 08:52:21.000000000 +0900
117 @@ -7,3 +7,4 @@
118 11_arm64-cache-flush.patch
119 13_fix-path-to-vgdb.patch
120 armhf_neon.patch
121 +fix-upstream-bug492663