Skip to content

Commit 4c01dab

Browse files
committed
fix: post merge issues
1 parent ef4edda commit 4c01dab

File tree

5 files changed

+67
-20
lines changed

5 files changed

+67
-20
lines changed

.github/ubuntu-24.04-expected.txt

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,2 @@
1-
none/tests/fdleak_cmsg (stderr)
2-
none/tests/fdleak_cmsg_supp (stderr)
3-
none/tests/fdleak_creat (stderr)
4-
none/tests/fdleak_creat_sup (stderr)
5-
none/tests/fdleak_dup (stderr)
6-
none/tests/fdleak_dup2 (stderr)
7-
none/tests/fdleak_fcntl (stderr)
8-
none/tests/fdleak_ipv4 (stderr)
9-
none/tests/fdleak_open (stderr)
10-
none/tests/fdleak_pipe (stderr)
11-
none/tests/fdleak_socketpair (stderr)
12-
none/tests/file_dclose (stderr)
13-
none/tests/file_dclose_sup (stderr)
14-
none/tests/socket_close (stderr)
1+
none/tests/track_high (stderr)
2+
none/tests/track_yes (stderr)

coregrind/m_initimg/initimg-darwin.c

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,55 @@ static HChar *copy_str(HChar **tab, const HChar *str)
277277
return orig;
278278
}
279279

280+
/*
281+
* @todo PJF Make this multi-platform
282+
*/
283+
static Bool try_get_interp(const HChar* args_exe, HChar* interp_out)
284+
{
285+
HChar hdr[4096];
286+
Int len = sizeof hdr;
287+
SysRes res;
288+
Int fd;
289+
HChar* end;
290+
HChar* cp;
291+
HChar* interp;
292+
293+
res = VG_(open)(args_exe, VKI_O_RDONLY, 0);
294+
if (sr_isError(res)) {
295+
return False;
296+
} else {
297+
fd = sr_Res(res);
298+
}
299+
300+
res = VG_(pread)(fd, hdr, len, 0);
301+
302+
if (sr_isError(res)) {
303+
VG_(close)(fd);
304+
return False;
305+
} else {
306+
len = sr_Res(res);
307+
}
308+
309+
if (0 != VG_(memcmp)(hdr, "#!", 2)) {
310+
VG_(close)(fd);
311+
return False;
312+
}
313+
314+
end = hdr + len;
315+
interp = hdr + 2;
316+
while (interp < end && (*interp == ' ' || *interp == '\t'))
317+
interp++;
318+
319+
for (cp = interp; cp < end && !VG_(isspace)(*cp); cp++)
320+
;
321+
322+
*cp = '\0';
323+
324+
VG_(sprintf)(interp_out, "%s", interp);
325+
326+
VG_(close)(fd);
327+
return True;
328+
}
280329

281330
/* ----------------------------------------------------------------
282331
@@ -491,6 +540,17 @@ Addr setup_client_stack( void* init_sp,
491540

492541
/* client_SP is pointing at client's argc/argv */
493542

543+
if (VG_(resolved_exename) == NULL) {
544+
const HChar *exe_name = VG_(find_executable)(VG_(args_the_exename));
545+
HChar interp_name[VKI_PATH_MAX];
546+
if (try_get_interp(exe_name, interp_name)) {
547+
exe_name = interp_name;
548+
}
549+
HChar resolved_name[VKI_PATH_MAX];
550+
VG_(realpath)(exe_name, resolved_name);
551+
VG_(resolved_exename) = VG_(strdup)("initimg-darwin.scs.2", resolved_name);
552+
}
553+
494554
if (0) VG_(printf)("startup SP = %#lx\n", client_SP);
495555
return client_SP;
496556
}

coregrind/m_sigframe/sigframe-arm64-darwin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ void VG_(sigframe_destroy)( ThreadId tid, Bool isRT )
253253

254254
if (VG_(clo_trace_signals))
255255
VG_(message)(Vg_DebugMsg,
256-
"sigframe_destroy (thread %d): "
256+
"sigframe_destroy (thread %u): "
257257
"valid magic; next PC=%#llx\n",
258258
tid, tst->arch.vex.guest_PC);
259259

memcheck/tests/wcpncpy.stderr.exp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
Conditional jump or move depends on uninitialised value(s)
2-
at 0x........: wcpncpy (vg_replace_strmem.c:2583)
2+
at 0x........: wcpncpy (vg_replace_strmem.c:2584)
33
by 0x........: main (wcpncpy.c:14)
44

55
Invalid write of size 4
6-
at 0x........: wcpncpy (vg_replace_strmem.c:2583)
6+
at 0x........: wcpncpy (vg_replace_strmem.c:2584)
77
by 0x........: main (wcpncpy.c:27)
88
Address 0x........ is 20 bytes inside a block of size 22 alloc'd
99
at 0x........: malloc (vg_replace_malloc.c:...)
1010
by 0x........: main (wcpncpy.c:10)
1111

1212
Source and destination overlap in wcpncpy(0x........, 0x........)
13-
at 0x........: wcpncpy (vg_replace_strmem.c:2583)
13+
at 0x........: wcpncpy (vg_replace_strmem.c:2584)
1414
by 0x........: main (wcpncpy.c:35)
1515

1616
Source and destination overlap in wcpncpy(0x........, 0x........)
17-
at 0x........: wcpncpy (vg_replace_strmem.c:2583)
17+
at 0x........: wcpncpy (vg_replace_strmem.c:2584)
1818
by 0x........: main (wcpncpy.c:43)
1919

none/tests/iropt-test/unary.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ get_expected_value(const irop_t *op, const test_data_t *data)
162162
// case Iop_16to1: expected = opnd & 0x1; break;
163163
case Iop_16to8: expected = opnd & UINT8_MAX; break;
164164
case Iop_16HIto8: expected = opnd >> 8; break;
165-
break;
166165

167166
case Iop_32to1: expected = opnd & 0x1; break;
168167
case Iop_32to8: expected = opnd & UINT8_MAX; break;

0 commit comments

Comments
 (0)