You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
1
|
|
2
|
3
|
4
|
5
(4) |
6
(3) |
7
(3) |
8
(2) |
|
9
(1) |
10
(1) |
11
(2) |
12
(2) |
13
(3) |
14
(7) |
15
(2) |
|
16
|
17
|
18
(1) |
19
|
20
(4) |
21
(1) |
22
(1) |
|
23
|
24
|
25
(2) |
26
(1) |
27
(2) |
28
(2) |
29
(1) |
|
From: Carl L. <ce...@us...> - 2020-02-13 21:54:12
|
Valgrind developers: The PPC architecture has a number of "new" regression errors. There appear to be two root causes for these issues. Not sure if the first of these issues has caused issues on other 64-bit architectures as well. Bug 416760 - ppc64le Assertion 'VG_IS_16_ALIGNED(sizeof(struct rt_sigframe))' failed https://bugs.kde.org/show_bug.cgi?id=416760 Bug 417427 - commit to fix vki_siginfo_t definition created numerous regression errors on PPC64 https://bugs.kde.org/show_bug.cgi?id=417427 Basically the issue comes from commit: commit 3bac39a10abf292d332bb20ab58c6dd5c28f9108 Author: Eugene Syromyatnikov <ev...@gm...> Date: Fri Mar 8 04:07:00 2019 +0100 include/vki: fix vki_siginfo_t definition on amd64, arm64, and ppc64 As it turned out, the size of vki_siginfo_t is incorrect on these 64-bit architectures: (gdb) p sizeof(vki_siginfo_t) $1 = 136 (gdb) ptype struct vki_siginfo type = struct vki_siginfo { int si_signo; int si_errno; int si_code; union { int _pad[29]; struct {...} _kill; struct {...} _timer; struct {...} _rt; struct {...} _sigchld; struct {...} _sigfault; struct {...} _sigpoll; } _sifields; } etc. The issue is the struct rt_sigframe is not properly aligned. The following patch fixed the issue on ppc64 reducing the number of regression errors from == 649 tests, 38 stderr failures, 13 stdout failures, 1 stderrB failure, 5 stdoutB failures, 2 post failures to == 649 tests, 6 stderr failures, 3 stdout failures, 0 stderrB failures, 2 stdoutB failures, 2 post failures == ----------------------------------------------- --- coregrind/m_sigframe/sigframe-ppc64-linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coregrind/m_sigframe/sigframe-ppc64-linux.c b/coregrind/m_sigframe/sigframe-ppc64-linux.c index 0406f3c..b54c4e0 100644 --- a/coregrind/m_sigframe/sigframe-ppc64-linux.c +++ b/coregrind/m_sigframe/sigframe-ppc64-linux.c @@ -112,7 +112,7 @@ struct rt_sigframe { vki_siginfo_t info; struct vg_sig_private priv; UChar abigap[288]; // unused -}; +} __attribute__ ((aligned (16))); #define SET_SIGNAL_LR(zztst, zzval) \ do { tst->arch.vex.guest_LR = (zzval); \ -- 2.7.4 --------------------------------------------------- I would like to get some testing done on other architectures to see if it fixes issues on other systems and if it causes any additional issues before committing this patch to Valgrind. Thanks for your help on this. Carl Love |
|
From: Carl L. <ce...@us...> - 2020-02-13 21:53:58
|
Julian:
The second issue that is causing regression errors on PPC64 has to do
with the grail changes as mentioned in some private emails. Currently
there is no bugzilla for this issue.
Specifically the commit in question is:
commit 076a79a48e251067758e1e9d8e50681450ed3889
Author: Julian Seward <js...@ac...>
Date: Wed Nov 27 08:52:45 2019 +0100
'grail' fixes for ppc32 and ppc64:
* do_minimal_initial_iropt_BB: for ppc64, flatten rather than
assert flatness.
(Kludge. Sigh.)
etc.
The patch adds the following code in ir_opt.c
// FIXME2 The TOC-redirect-hacks generators in m_translate.c -- gen_PUSH()
// and gen_PO() -- don't generate flat IR, and so cause this assertion
// to fail. For the time being, hack around this by flattening,
// rather than asserting for flatness, on the afflicted platforms.
// This is a kludge, yes.
if (guest_arch == VexArchPPC64) {
bb0 = flatten_BB(bb0); // Kludge!
} else {
vassert(isFlatIRSB(bb0)); // How it Really Should Be (tm).
}
The issue comes from the new expressions generated by flatten_BB(bb0).
As mentioned in previous private emails, the flatten_BB() generates
V128 expressions for Iex_ITE which is not supported.
The following patch adds the needed support for Iex_ITE for V128
expressions. I kinda get what the Iex_ITE needs to do but don't claim
to completely understand it all or why the kludge calls flatten_BB()
only for the PPC64 architecture. It appears you are planning to remove
the hack once things were "properly" fixed. Not sure if this fix will
be needed for the "proper" fix or not. But either way, it might be
nice to have this additional functionality available.
I need some additional review of this code as I don't claim to
completely understand the grail changes that were being done or if my
fix is OK. With this fix, the PPC64 regression test failures is
reduced to:
== 649 tests, 3 stderr failures, 0 stdout failures, 0 stderrB failures, 1 stdoutB failure, 2 post failures ==
gdbserver_tests/nlcontrolc (stdoutB)
memcheck/tests/bug340392 (stderr)
memcheck/tests/leak_cpp_interior (stderr)
memcheck/tests/linux/rfcomm (stderr)
massif/tests/new-cpp (post)
massif/tests/overloaded-new (post)
As expected.
Thanks for the help on the review.
Carl Love
---------------------------------------------
additional grail' fixes for ppc32 and ppc64
The grail changes introduce a kludge call for ppc64. The call fails
on some tests as the flatten call generates adds
addStmtToIRSB(bb, IRStmt_WrTmp(t1,
IRExpr_ITE(flatten_Expr(bb, ex->Iex.ITE.cond),
flatten_Expr(bb, ex->Iex.ITE.iftrue),
flatten_Expr(bb, ex->Iex.ITE.iffalse))));
for V128 expressions. Iex_ITE isn't supported for V128 type. This patch
adds the needed V128 support for the Iex_ITE expressions.
---
VEX/priv/host_ppc_defs.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++
VEX/priv/host_ppc_defs.h | 8 +++++++
VEX/priv/host_ppc_isel.c | 12 ++++++++++
3 files changed, 79 insertions(+)
diff --git a/VEX/priv/host_ppc_defs.c b/VEX/priv/host_ppc_defs.c
index 6c298fa..a58ceb9 100644
--- a/VEX/priv/host_ppc_defs.c
+++ b/VEX/priv/host_ppc_defs.c
@@ -1526,6 +1526,15 @@ PPCInstr* PPCInstr_AvBCDV128Binary ( PPCAvOp op, HReg dst,
i->Pin.AvBCDV128Binary.src2 = src2;
return i;
}
+PPCInstr* PPCInstr_V128CMov ( PPCCondCode cond, HReg dst, HReg src ) {
+ PPCInstr* i = LibVEX_Alloc_inline(sizeof(PPCInstr));
+ i->tag = Pin_V128CMov;
+ i->Pin.FpCMov.cond = cond;
+ i->Pin.FpCMov.dst = dst;
+ i->Pin.FpCMov.src = src;
+ vassert(cond.test != Pct_ALWAYS);
+ return i;
+}
/* Pretty Print instructions */
@@ -2177,6 +2186,27 @@ void ppPPCInstr ( const PPCInstr* i, Bool mode64 )
ppHRegPPC(i->Pin.AvBCDV128Binary.src2);
return;
+ case Pin_V128CMov:
+ vex_printf("v128cmov (%s) ", showPPCCondCode(i->Pin.FpCMov.cond));
+ ppHRegPPC(i->Pin.V128CMov.dst);
+ vex_printf(",");
+ ppHRegPPC(i->Pin.V128CMov.src);
+ vex_printf(": ");
+ vex_printf("if (v128_dst != v128_src) { ");
+ if (i->Pin.FpCMov.cond.test != Pct_ALWAYS) {
+ vex_printf("if (%s) { ", showPPCCondCode(i->Pin.FpCMov.cond));
+ }
+ vex_printf("vor ");
+ ppHRegPPC(i->Pin.V128CMov.dst);
+ vex_printf(",");
+ ppHRegPPC(i->Pin.V128CMov.src);
+ vex_printf(",");
+ ppHRegPPC(i->Pin.V128CMov.src);
+ if (i->Pin.FpCMov.cond.test != Pct_ALWAYS)
+ vex_printf(" }");
+ vex_printf(" }");
+ return;
+
case Pin_Dfp64Unary:
vex_printf("%s ", showPPCFpOp(i->Pin.Dfp64Unary.op));
ppHRegPPC(i->Pin.Dfp64Unary.dst);
@@ -2767,6 +2797,10 @@ void getRegUsage_PPCInstr ( HRegUsage* u, const PPCInstr* i, Bool mode64 )
addHRegUse(u, HRmRead, i->Pin.Dfp128Cmp.srcR_hi);
addHRegUse(u, HRmRead, i->Pin.Dfp128Cmp.srcR_lo);
return;
+ case Pin_V128CMov:
+ addHRegUse(u, HRmModify, i->Pin.V128CMov.dst);
+ addHRegUse(u, HRmRead, i->Pin.V128CMov.src);
+ return;
case Pin_EvCheck:
/* We expect both amodes only to mention the GSP (r31), so this
is in fact pointless, since GSP isn't allocatable, but
@@ -3118,6 +3152,10 @@ void mapRegs_PPCInstr ( HRegRemap* m, PPCInstr* i, Bool mode64 )
mapReg(m, &i->Pin.Dfp128Cmp.srcR_hi);
mapReg(m, &i->Pin.Dfp128Cmp.srcR_lo);
return;
+ case Pin_V128CMov:
+ mapReg(m, &i->Pin.V128CMov.dst);
+ mapReg(m, &i->Pin.V128CMov.src);
+ return;
case Pin_EvCheck:
/* We expect both amodes only to mention the GSP (r31), so this
is in fact pointless, since GSP isn't allocatable, but
@@ -6302,6 +6340,27 @@ Int emit_PPCInstr ( /*MB_MOD*/Bool* is_profInc,
goto done;
}
+ case Pin_V128CMov: {
+ UInt v_dst = vregEnc(i->Pin.V128CMov.dst);
+ UInt v_src = vregEnc(i->Pin.V128CMov.src);
+ PPCCondCode cc = i->Pin.V128CMov.cond;
+
+ if (v_dst == v_src) goto done;
+
+ vassert(cc.test != Pct_ALWAYS);
+
+ /* jmp fwds if !condition */
+ if (cc.test != Pct_ALWAYS) {
+ /* bc !ct,cf,n_bytes>>2 */
+ p = mkFormB(p, invertCondTest(cc.test), cc.flag, 8>>2, 0, 0,
+ endness_host);
+ }
+
+ // move register, use vor dst, src, src op1 = 4, opc2 = 1156
+ p = mkFormVX( p, 4, v_dst, v_src, v_src, 1156, endness_host );
+ goto done;
+ }
+
case Pin_EvCheck: {
/* This requires a 32-bit dec/test in both 32- and 64-bit
modes. */
diff --git a/VEX/priv/host_ppc_defs.h b/VEX/priv/host_ppc_defs.h
index 70c3b6c..f1a97fd 100644
--- a/VEX/priv/host_ppc_defs.h
+++ b/VEX/priv/host_ppc_defs.h
@@ -584,6 +584,7 @@ typedef
* round */
Pin_DfpQuantize128, /* D128 quantize using register value, significance
* round */
+ Pin_V128CMov, /* Vector 128-bit conditional move */
Pin_EvCheck, /* Event check */
Pin_ProfInc /* 64-bit profile counter increment */
}
@@ -1068,6 +1069,12 @@ typedef
HReg srcR_hi;
HReg srcR_lo;
} Dfp128Cmp;
+ /* V128 mov src to dst on the given condition. */
+ struct {
+ PPCCondCode cond;
+ HReg dst;
+ HReg src;
+ } V128CMov;
struct {
PPCAMode* amCounter;
PPCAMode* amFailAddr;
@@ -1188,6 +1195,7 @@ extern PPCInstr* PPCInstr_InsertExpD128 ( PPCFpOp op, HReg dst_hi,
extern PPCInstr* PPCInstr_Dfp64Cmp ( HReg dst, HReg srcL, HReg srcR );
extern PPCInstr* PPCInstr_Dfp128Cmp ( HReg dst, HReg srcL_hi, HReg srcL_lo,
HReg srcR_hi, HReg srcR_lo );
+extern PPCInstr* PPCInstr_V128CMov ( PPCCondCode, HReg dst, HReg src );
extern PPCInstr* PPCInstr_EvCheck ( PPCAMode* amCounter,
PPCAMode* amFailAddr );
extern PPCInstr* PPCInstr_ProfInc ( void );
diff --git a/VEX/priv/host_ppc_isel.c b/VEX/priv/host_ppc_isel.c
index 9c954da..25ab559 100644
--- a/VEX/priv/host_ppc_isel.c
+++ b/VEX/priv/host_ppc_isel.c
@@ -5587,6 +5587,18 @@ static HReg iselVecExpr_wrk ( ISelEnv* env, const IRExpr* e,
vassert(e);
vassert(ty == Ity_V128);
+ if (e->tag == Iex_ITE) {
+ HReg r1 = iselVecExpr( env, e->Iex.ITE.iftrue, IEndianess );
+ HReg r0 = iselVecExpr( env, e->Iex.ITE.iffalse, IEndianess );
+ HReg r_dst = newVRegV(env);
+
+ // Use OR operator to do move r1 to r_dst
+ addInstr(env, PPCInstr_AvBinary( Pav_OR, r_dst, r0, r0));
+ PPCCondCode cc = iselCondCode(env, e->Iex.ITE.cond, IEndianess);
+ addInstr(env, PPCInstr_V128CMov(cc, r_dst, r1));
+ return r_dst;
+ }
+
if (e->tag == Iex_RdTmp) {
return lookupIRTemp(env, e->Iex.RdTmp.tmp);
}
--
2.7.4
|
|
From: Paul F. <pj...@wa...> - 2020-02-12 18:50:58
|
Arrgh please ignore. I had forgotten to set the signal handlers. A+ Paul |
|
From: Paul F. <pj...@wa...> - 2020-02-12 16:49:08
|
Hi
Currently if I run memcheck under gd I'm gett ing a sigsegv. I don't get this when running outside of gdb. (on Linux amd64, a fairly old gdb, 7.11.1-86.fc24)
The test application just does one trivial malloc
#include
int main(void)
{
int* pi = malloc(4);
}
Judging by the scheduler output, the code being executed is in ld.so dl_main.
I set the following breakpoints
(gdb) info breakpoints
Num Type Disp Enb Address What
1 breakpoint keep y 0x00000000580694c4 in vgPlain_translate at m_translate.c:1599
stop only if bbs_done == 509
breakpoint already hit 1 time
2 breakpoint keep n 0x00000000580c3b00 in run_thread_for_a_while at m_scheduler/scheduler.c:933
The first was based on the last message that I saw, with the condition bbs_done == 509.
The second breakpoint is just to get closer to the crash site a bit more quickly.
The last code to execute in 'run_a_thread_for_a_while' is
>│1031 SCHEDSETJMP(
│1032 tid,
│1033 jumped,
│1034 VG_(disp_run_translations)(
│1035 two_words,
│1036 (volatile void*)&tst->arch.vex,
│1037 host_code_addr
│1038 )
│1039 );
It's VG_(disp_run_translations) that corrupts the stack
The input arguments are
(gdb) p two_words
$3 = (HWord *) 0x1003039eb0
(gdb) p tst->arch.vex
$4 = {host_EvC_FAILADDR = 1477127896, host_EvC_COUNTER = 99491, pad0 = 0, guest_RAX = 0, guest_RCX = 69357824, guest_RDX = 0, guest_RBX = 69357824, guest_RSP = 137422176144, guest_RBP = 137422176656, guest_RSI = 67109208,
guest_RDI = 137422180173, guest_R8 = 67235712, guest_R9 = 1, guest_R10 = 4, guest_R11 = 69359304, guest_R12 = 1, guest_R13 = 1879048225, guest_R14 = 69357872, guest_R15 = 0, guest_CC_OP = 20, guest_CC_DEP1 = 137422180173,
guest_CC_DEP2 = 0, guest_CC_NDEP = 0, guest_DFLAG = 1, guest_RIP = 67128168, guest_ACFLAG = 0, guest_IDFLAG = 0, guest_FS_CONST = 0, guest_SSEROUND = 0, guest_YMM0 = {0, 0, 0, 0, 0, 0, 0, 0}, guest_YMM1 = {1, 0, 1651076143,
1815032886, 0, 0, 0, 0}, guest_YMM2 = {0, 65793, 0, 0, 0, 0, 0, 0}, guest_YMM3 = {0, 0, 0, 0, 0, 0, 0, 0}, guest_YMM4 = {0, 0, 0, 0, 0, 0, 0, 0}, guest_YMM5 = {0, 0, 0, 0, 0, 0, 0, 0}, guest_YMM6 = {0, 0, 0, 0, 0, 0, 0, 0},
guest_YMM7 = {0, 0, 0, 0, 0, 0, 0, 0}, guest_YMM8 = {0, 0, 0, 0, 0, 0, 0, 0}, guest_YMM9 = {0, 0, 0, 0, 0, 0, 0, 0}, guest_YMM10 = {0, 0, 0, 0, 0, 0, 0, 0}, guest_YMM11 = {0, 0, 0, 0, 0, 0, 0, 0}, guest_YMM12 = {0, 0, 0, 0, 0, 0, 0,
0}, guest_YMM13 = {0, 0, 0, 0, 0, 0, 0, 0}, guest_YMM14 = {0, 0, 0, 0, 0, 0, 0, 0}, guest_YMM15 = {0, 0, 0, 0, 0, 0, 0, 0}, guest_YMM16 = {0, 0, 0, 0, 0, 0, 0, 0}, guest_FTOP = 0, pad1 = 0, guest_FPREG = {0, 0, 0, 0, 0, 0, 0, 0},
guest_FPTAG = "\000\000\000\000\000\000\000", guest_FPROUND = 0, guest_FC3210 = 0, guest_EMNOTE = 0, pad2 = 0, guest_CMSTART = 0, guest_CMLEN = 0, guest_NRADDR = 0, guest_SC_CLASS = 0, guest_GS_CONST = 0, guest_IP_AT_SYSCALL = 0,
pad3 = 0}
(gdb) p host_code_addr
$5 = 68770170016
At the end of VG_(disp_run_translations) there is
jmpq *%rdx
rdx 0x10030584a0 68770170016
and
(gdb) p/x *$rdx
$11 = 0x79084dff
gdb can't disassemble this address
stepping into the jump causes the segfault.
Going back to 'run_a_thread_for_a_while', 'host_code_addr' is coming from VG_(lookupInFastCache)
Any ideas why this address is getting into the cache?
A+
Paul
|
|
From: Andreas A. <ar...@so...> - 2020-02-11 18:29:54
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=b729c0f35cf9663e610756b0d56fbbf3705b5209 commit b729c0f35cf9663e610756b0d56fbbf3705b5209 Author: Andreas Arnez <ar...@li...> Date: Mon Feb 10 13:37:03 2020 +0100 s390x: Fix printing of virtual register numbers As noticed by Julian Seward, the code for printing s390x register names currently does not show the virtual register numbers correctly. Although it distinguishes between virtual and real registers, it uses the hardware register number for both cases. This is fixed. Diff: --- VEX/priv/host_s390_defs.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/VEX/priv/host_s390_defs.c b/VEX/priv/host_s390_defs.c index 162550f..9ad7240 100644 --- a/VEX/priv/host_s390_defs.c +++ b/VEX/priv/host_s390_defs.c @@ -112,12 +112,9 @@ s390_hreg_as_string(HReg reg) "%v24", "%v25", "%v26", "%v27", "%v28", "%v29", "%v30", "%v31" }; - UInt r; /* hregNumber() returns an UInt */ - - r = hregNumber(reg); - /* Be generic for all virtual regs. */ if (hregIsVirtual(reg)) { + UInt r = hregIndex(reg); buf[0] = '\0'; switch (hregClass(reg)) { case HRcInt64: vex_sprintf(buf, "%%vR%u", r); break; @@ -129,6 +126,7 @@ s390_hreg_as_string(HReg reg) } /* But specific for real regs. */ + UInt r = hregNumber(reg); switch (hregClass(reg)) { case HRcInt64: vassert(r < 16); return ireg_names[r]; case HRcFlt64: vassert(r < 16); return freg_names[r]; |
|
From: Louis B. <lou...@gm...> - 2020-02-11 11:36:10
|
Hi, I have been investigating the problem and I have a fix (patch included). Some context: it is difficult to be sure without the libpthread sources for 10.15, but if you check libpthread-330.250.2 (for 10.14), you will find a parse_ptr_munge_params function that tries to get ptr_munge value from the environment (through the Apple environment or an actual environment variable, PTHREAD_PTR_MUNGE_TOKEN). In previous versions, __pthread_init would just carry on even if the value wasn't defined, but while stepping through the code, I have found that macOS 10.15 seems to crash using the ud2 instruction just after the environment variable check, hinting that this value is now required. My patch adds PTHREAD_PTR_MUNGE_TOKEN with a value of 1 everytime valgrind starts a program. Note that a value of 0 is considered an error by pthread. Disclaimer: while I found where ptr_munge is generated (kernel) and used (some kind of conversion in jmp instructions in libplatform), I don't understand what it does exactly. On the other hand, the dummy value doesn't seem to make a difference when executing a program with valgrind. Best regards, Louis Brunner |
|
From: Paul F. <pj...@wa...> - 2020-02-10 20:36:00
|
Hi The main problem that I have at the moment is that readelf and co aren't redirecting any allocation functions like malloc and free. I cranked up the tracing (4x -v and 4x -d, --trace=symtab=yes). For libc I see (this is just a tiny extract) ------ start ELF OBJECT ------------------------------------------------------- ------ name = /lib/libc.so.7 --48619-- object doesn't have a symbol table --- Reading (ELF, standard) dynamic symbol table (3158 entries) --- raw symbol [ 971]: WEA FUN : svma 0x000011e990, sz 3662 malloc rec(t) [ 971]: val 0x0004ead990, sz 3662 malloc And for libc++ I see ------ start ELF OBJECT ------------------------------------------------------- ------ name = /usr/home/paulf/tools/clang/lib/libc++.so.1.0 --- Reading (ELF, standard) symbol table (3163 entries) --- raw symbol [1179]: WEA FUN : svma 0x00000a7400, sz 116 _Znwm rec(t) [1179]: val 0x0004cfa400, sz 116 _Znwm I'll try the same thing on Linux to try to see where FreeBSD is losing the plot Can anyone suggest where to look for redirection problems? A+ Paul |
|
From: Mark W. <ma...@kl...> - 2020-02-09 11:02:20
|
Hi Julian, On Wed, Feb 05, 2020 at 09:40:03AM +0100, Julian Seward wrote: > In the Developer Toolroom at FOSDEM20 last Sunday, there was a bit of > discussion regarding the release date for 3.16.0. The following was agreed: > > * freeze for large changes on Monday 2 March 2020. > > * final release on Monday 16 March 2020. > > This gives us just under four weeks to land any large changes for 3.16, > followed by a two week stabilisation period before the release. This would be nice for the Fedora 32 schedule. 2020-03-17 is the current beta target (1 day after the 3.16.0 release). > My list of changes still to do for 3.16 are: > > * make the new &&-idiom-recognition stuff work also on s390 and MIPS. This > was discussed with both the s390 and MIPS folks on Sunday. If it is not > fixable in the timescale, it's not a disaster since that functionality can > remain disabled on those targets, as it is now. But if possible it would be > nice to have it fixed. > > * 64-bit time-related syscalls on 32-bit Linux targets are now failing (esp > for Fedora Rawhide). Mark and/or me can look at this; other volunteers > welcome. This is https://bugs.kde.org/show_bug.cgi?id=416753 It is 20 new time64 syscall variants. The syscall numbers are the same on all arches. > * Continue testing with gcc 10 (and maybe glibc-the-latest?); make sure it > works. I have been building valgrind 3.15.0 with backports against Fedora rawhide, which contains both gcc10 pre-release and glibc 3.21. Things now look reasonable on most architectures Fedora supports except for x86 and armhf because they are 32bit arches where the new glibc defaults to the new time syscalls. See valgrind f32 build.logs from: https://koji.fedoraproject.org/koji/packageinfo?packageID=98 They contain make regtest results plus .diff files. > * [me] I'd like to land 253657 (improvements to PDB reading) if possible. > > * I would like to remove the exp-sgcheck tool. It hasn't been usable for > years (if ever); it doesn't work at all on non-x86/amd64 targets, and is > generally pointless to keep around. Are there any objections to removing > it? Yes, please! > * I'll make another pass through the open bugs within the next week, but I'm > not aware of any critical bugs right now. https://bugs.kde.org/show_bug.cgi?id=417075 pwritev(vector[...]) suppression ignored Is somewhat annoying, but I am not sure how to proceed. https://bugs.kde.org/show_bug.cgi?id=416760 ppc64le Assertion 'VG_IS_16_ALIGNED(sizeof(struct rt_sigframe))' failed Is a regression caused by the fix for https://bugs.kde.org/show_bug.cgi?id=405201 Incorrect size of struct vki_siginfo on 64-bit Linux architectures > If this schedule is a problem for anyone, please let us know immediately. > Also, of course, if there are other changes that should go in 3.16, speak up > now. Looks doable to me. Thanks, Mark |
|
From: Paul F. <pj...@wa...> - 2020-02-08 19:43:49
|
> On 7 Feb 2020, at 16:57, Paul Floyd <pj...@wa...> wrote:
>
>
>
>> On 14 Mar 2019, at 19:16, Ed Maste <em...@fr...> wrote:
>>
>> On Thu, 14 Mar 2019 at 11:20, Tom Hughes <tom...@so...> wrote:
>>>
>>> commit 09566120e705d8831aaa7076b439d3ad90b78773
>>> Author: Tom Hughes <to...@co...>
>>> Date: Thu Mar 14 15:15:41 2019 +0000
>>>
>>> Suppress FSGSBASE flag from cpuid results
>>>
>>> We don't support {rd,wr}{fs,gs}base so we shouldn't say we do.
>>
>> Thanks, I have rebased the FreeBSD patch set on master now and the
>> test results are consistent with earlier runs.
>>
>
>
> Hi
>
> Since I have a bit of free time on my hands (one more week in theory), I’ve also been looking at the FreeBSD port of Valgrind.
>
> Has any work been done on this since last March?
>
> I now have FreeBSD 12.1 reinstalled with Phil Longstaff’s work plus a few of my changes. It seems to work at least for trivial tests - I haven’t yet tried running the regression tests.
>
> At the moment there are 4 things that I see that I need to do
>
> 1. Rebase everything onto the main Valgrind development branch
> 2. I’ve noticed that there is a big issue with clang compiled executables. The problem is that the binaries have 3 PT_LOAD sections (ro, rx, rw) while GCC (and clang on Linux) only generates 2 (rw and rx). This is causing symtab loading to fail. This limits the usefulness somewhat.
> 3. There were a lot of syscall changes in FreeBSD 12, so I think that ‘configure’ needs to handle/define a freebsd_version variable.
> 4. There are still quite a few missing syscalls.
An update on this
1. I’ve done the rebase. That was fun. Looks like most of the regtests are failing though, and there seems to be an issue with reading semaphores.
2. I’m still seeing this problem, though I’ve seen that Mark Wielaard made a change that should that looks like it should fix this. I’ll look at that next.
3 and 4. No progress yet.
A+
Paul
|
|
From: Philippe W. <phi...@so...> - 2020-02-08 13:49:08
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=fe9c80daa266558eb357025822dcde3b74b8a4be commit fe9c80daa266558eb357025822dcde3b74b8a4be Author: Philippe Waroquiers <phi...@sk...> Date: Sat Feb 8 13:01:24 2020 +0100 Add option -T to vgdb to output timestamps in vgdb information/error messages Also cleanup some trailink blanks. Diff: --- NEWS | 2 + coregrind/vgdb-invoker-none.c | 8 +-- coregrind/vgdb-invoker-ptrace.c | 86 ++++++++++++++++---------------- coregrind/vgdb.c | 108 +++++++++++++++++++++++----------------- coregrind/vgdb.h | 25 ++++++---- docs/xml/manual-core-adv.xml | 7 +++ 6 files changed, 135 insertions(+), 101 deletions(-) diff --git a/NEWS b/NEWS index c9ec9fa..79b3d7c 100644 --- a/NEWS +++ b/NEWS @@ -53,6 +53,8 @@ support for X86/macOS 10.13, AMD64/macOS 10.13 and nanoMIPS/Linux. * New and modified GDB server monitor features: + - Option -T tells vgdb to output a timestamp in the vgdb information messages. + - The gdbserver monitor commands that require an address and an optional length argument now accepts the alternate 'C like' syntax "address[length]". For example, the memcheck command "monitor who_points_at 0x12345678 120" diff --git a/coregrind/vgdb-invoker-none.c b/coregrind/vgdb-invoker-none.c index 8acf9e0..561638d 100644 --- a/coregrind/vgdb-invoker-none.c +++ b/coregrind/vgdb-invoker-none.c @@ -31,10 +31,10 @@ void invoker_restrictions_msg(void) { - fprintf(stderr, - "Note: vgdb invoker not implemented on this platform.\n" - "For more info: read user manual section" - " 'Limitations of the Valgrind gdbserver'.\n"); + TSFPRINTF(stderr, + "Note: vgdb invoker not implemented on this platform.\n" + "For more info: read user manual section" + " 'Limitations of the Valgrind gdbserver'.\n"); } void invoker_cleanup_restore_and_detach(void *v_pid) diff --git a/coregrind/vgdb-invoker-ptrace.c b/coregrind/vgdb-invoker-ptrace.c index 5a4104e..cb37677 100644 --- a/coregrind/vgdb-invoker-ptrace.c +++ b/coregrind/vgdb-invoker-ptrace.c @@ -110,20 +110,20 @@ int ptrace_read_memory (pid_t inferior_pid, CORE_ADDR memaddr, /* Allocate buffer of that many longwords. */ register PTRACE_XFER_TYPE *buffer = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE)); - + /* Read all the longwords */ for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE)) { errno = 0; - buffer[i] = ptrace (PTRACE_PEEKTEXT, inferior_pid, + buffer[i] = ptrace (PTRACE_PEEKTEXT, inferior_pid, (PTRACE_ARG3_TYPE) addr, 0); if (errno) return errno; } - + /* Copy appropriate bytes out of the buffer. */ - memcpy (myaddr, + memcpy (myaddr, (char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)), len); - + return 0; } @@ -133,7 +133,7 @@ int ptrace_read_memory (pid_t inferior_pid, CORE_ADDR memaddr, returns the value of errno. */ __attribute__((unused)) /* not used on all platforms */ static -int ptrace_write_memory (pid_t inferior_pid, CORE_ADDR memaddr, +int ptrace_write_memory (pid_t inferior_pid, CORE_ADDR memaddr, const void *myaddr, size_t len) { register int i; @@ -141,24 +141,24 @@ int ptrace_write_memory (pid_t inferior_pid, CORE_ADDR memaddr, register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE); /* Round ending address up; get number of longwords that makes. */ register int count - = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1) + = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1) / sizeof (PTRACE_XFER_TYPE); /* Allocate buffer of that many longwords. */ - register PTRACE_XFER_TYPE *buffer + register PTRACE_XFER_TYPE *buffer = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE)); - + if (debuglevel >= 1) { DEBUG (1, "Writing "); for (i = 0; i < len; i++) PDEBUG (1, "%02x", ((const unsigned char*)myaddr)[i]); PDEBUG(1, " to %p\n", (void *) memaddr); } - + /* Fill start and end extra bytes of buffer with existing memory data. */ - + buffer[0] = ptrace (PTRACE_PEEKTEXT, inferior_pid, (PTRACE_ARG3_TYPE) addr, 0); - + if (count > 1) { buffer[count - 1] = ptrace (PTRACE_PEEKTEXT, inferior_pid, @@ -166,22 +166,22 @@ int ptrace_write_memory (pid_t inferior_pid, CORE_ADDR memaddr, * sizeof (PTRACE_XFER_TYPE)), 0); } - + /* Copy data to be written over corresponding part of buffer */ - - memcpy ((char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)), + + memcpy ((char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)), myaddr, len); - + /* Write the entire buffer. */ - + for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE)) { errno = 0; - ptrace (PTRACE_POKETEXT, inferior_pid, + ptrace (PTRACE_POKETEXT, inferior_pid, (PTRACE_ARG3_TYPE) addr, buffer[i]); if (errno) return errno; } - + return 0; } @@ -209,18 +209,18 @@ HChar* name_of_ThreadStatus ( ThreadStatus status ) } } -static +static char *status_image (int status) { static char result[256]; // large enough int sz = 0; #define APPEND(...) sz += snprintf (result+sz, 256 - sz - 1, __VA_ARGS__) - + result[0] = 0; if (WIFEXITED(status)) APPEND ("WIFEXITED %d ", WEXITSTATUS(status)); - + if (WIFSIGNALED(status)) { APPEND ("WIFSIGNALED %d ", WTERMSIG(status)); if (WCOREDUMP(status)) APPEND ("WCOREDUMP "); @@ -259,10 +259,10 @@ Bool waitstopped (pid_t pid, int signal_expected, const char *msg) DEBUG(1, "waitstopped %s before waitpid signal_expected %d\n", msg, signal_expected); p = waitpid(pid, &status, __WALL); - DEBUG(1, "after waitpid pid %d p %d status 0x%x %s\n", pid, p, + DEBUG(1, "after waitpid pid %d p %d status 0x%x %s\n", pid, p, status, status_image (status)); if (p != pid) { - ERROR(errno, "%s waitpid pid %d in waitstopped %d status 0x%x %s\n", + ERROR(errno, "%s waitpid pid %d in waitstopped %d status 0x%x %s\n", msg, pid, p, status, status_image (status)); return False; } @@ -300,7 +300,7 @@ Bool waitstopped (pid_t pid, int signal_expected, const char *msg) // realloc a bigger queue, and store new signal at the end. // This is not very efficient but we assume not many sigs are queued. signal_queue_sz++; - signal_queue = vrealloc(signal_queue, + signal_queue = vrealloc(signal_queue, sizeof(siginfo_t) * signal_queue_sz); newsiginfo = signal_queue + (signal_queue_sz - 1); @@ -340,7 +340,7 @@ Bool stop (pid_t pid, const char *msg) ERROR(errno, "%s SIGSTOP pid %d %ld\n", msg, pid, res); return False; } - + return waitstopped (pid, SIGSTOP, msg); } @@ -354,7 +354,7 @@ Bool attach (pid_t pid, const char *msg) long res; static Bool output_error = True; static Bool initial_attach = True; - // For a ptrace_scope protected system, we do not want to output + // For a ptrace_scope protected system, we do not want to output // repetitively attach error. We will output once an error // for the initial_attach. Once the 1st attach has succeeded, we // again show all errors. @@ -375,7 +375,7 @@ Bool attach (pid_t pid, const char *msg) return waitstopped(pid, SIGSTOP, msg); } -/* once we are attached to the pid, get the list of threads and stop +/* once we are attached to the pid, get the list of threads and stop them all. Returns True if all threads properly suspended, False otherwise. */ static @@ -420,7 +420,7 @@ Bool acquire_and_suspend_threads (pid_t pid) ERROR(rw, "status ptrace_read_memory\n"); return False; } - + rw = ptrace_read_memory(pid, vgt+off_lwpid, &(vgdb_threads[i].lwpid), sizeof(Int)); @@ -428,14 +428,14 @@ Bool acquire_and_suspend_threads (pid_t pid) ERROR(rw, "lwpid ptrace_read_memory\n"); return False; } - + if (vgdb_threads[i].status != VgTs_Empty) { DEBUG(1, "found tid %d status %s lwpid %d\n", i, name_of_ThreadStatus(vgdb_threads[i].status), vgdb_threads[i].lwpid); nr_live_threads++; if (vgdb_threads[i].lwpid <= 1) { - if (vgdb_threads[i].lwpid == 0 + if (vgdb_threads[i].lwpid == 0 && vgdb_threads[i].status == VgTs_Init) { DEBUG(1, "not set lwpid tid %d status %s lwpid %d\n", i, name_of_ThreadStatus(vgdb_threads[i].status), @@ -455,7 +455,7 @@ Bool acquire_and_suspend_threads (pid_t pid) pid_found = True; } else { if (!attach(vgdb_threads[i].lwpid, "attach_thread")) { - ERROR(0, "ERROR attach pid %d tid %d\n", + ERROR(0, "ERROR attach pid %d tid %d\n", vgdb_threads[i].lwpid, i); return False; } @@ -483,7 +483,7 @@ void detach_from_all_threads (pid_t pid) if (vgdb_threads[i].status == VgTs_Init && vgdb_threads[i].lwpid == 0) { DEBUG(1, "skipping PTRACE_DETACH pid %d tid %d status %s\n", - vgdb_threads[i].lwpid, i, + vgdb_threads[i].lwpid, i, name_of_ThreadStatus (vgdb_threads[i].status)); } else { if (vgdb_threads[i].lwpid == pid) { @@ -491,11 +491,11 @@ void detach_from_all_threads (pid_t pid) pid_found = True; } DEBUG(1, "PTRACE_DETACH pid %d tid %d status %s\n", - vgdb_threads[i].lwpid, i, + vgdb_threads[i].lwpid, i, name_of_ThreadStatus (vgdb_threads[i].status)); res = ptrace (PTRACE_DETACH, vgdb_threads[i].lwpid, NULL, NULL); if (res != 0) { - ERROR(errno, "PTRACE_DETACH pid %d tid %d status %s res %ld\n", + ERROR(errno, "PTRACE_DETACH pid %d tid %d status %s res %ld\n", vgdb_threads[i].lwpid, i, name_of_ThreadStatus (vgdb_threads[i].status), res); @@ -544,7 +544,7 @@ static int has_working_ptrace_getregset = -1; #endif /* Get the registers from pid into regs. - regs_bsz value gives the length of *regs. + regs_bsz value gives the length of *regs. Returns True if all ok, otherwise False. */ static Bool getregs (pid_t pid, void *regs, long regs_bsz) @@ -660,7 +660,7 @@ Bool getregs (pid_t pid, void *regs, long regs_bsz) } /* Set the registers of pid to regs. - regs_bsz value gives the length of *regs. + regs_bsz value gives the length of *regs. Returns True if all ok, otherwise False. */ static Bool setregs (pid_t pid, void *regs, long regs_bsz) @@ -885,8 +885,8 @@ Bool invoker_invoke_gdbserver (pid_t pid) sp = sp - regsize; DEBUG(1, "push check arg ptrace_write_memory\n"); assert(regsize == sizeof(check)); - rw = ptrace_write_memory(pid, sp, - &check, + rw = ptrace_write_memory(pid, sp, + &check, regsize); if (rw != 0) { ERROR(rw, "push check arg ptrace_write_memory"); @@ -898,7 +898,7 @@ Bool invoker_invoke_gdbserver (pid_t pid) DEBUG(1, "push bad_return return address ptrace_write_memory\n"); // Note that for a 64 bits vgdb, only 4 bytes of NULL bad_return // are written. - rw = ptrace_write_memory(pid, sp, + rw = ptrace_write_memory(pid, sp, &bad_return, regsize); if (rw != 0) { @@ -1070,7 +1070,7 @@ Bool invoker_invoke_gdbserver (pid_t pid) else { assert(0); } - + if (!setregs(pid, &user_mod.regs, sizeof(user_mod.regs))) { detach_from_all_threads(pid); return False; @@ -1080,9 +1080,9 @@ Bool invoker_invoke_gdbserver (pid_t pid) must restore the registers in case of cleanup. */ pid_of_save_regs = pid; pid_of_save_regs_continued = False; - - /* We PTRACE_CONT-inue pid. + + /* We PTRACE_CONT-inue pid. Either gdbserver will be invoked directly (if all threads are interruptible) or gdbserver will be called soon by the scheduler. In the first case, diff --git a/coregrind/vgdb.c b/coregrind/vgdb.c index 8d21359..745fe32 100644 --- a/coregrind/vgdb.c +++ b/coregrind/vgdb.c @@ -67,9 +67,28 @@ */ int debuglevel; -struct timeval dbgtv; +Bool timestamp = False; +char timestamp_out[20]; static char *vgdb_prefix = NULL; +char *timestamp_str (Bool produce) +{ + static char out[50]; + char *ptr; + struct timeval dbgtv; + struct tm *ts_tm; + + if (produce) { + gettimeofday(&dbgtv, NULL); + ts_tm = localtime(&dbgtv.tv_sec); + ptr = out + strftime(out, sizeof(out), "%H:%M:%S", ts_tm); + sprintf(ptr, ".%6.6ld ", dbgtv.tv_usec); + } else { + out[0] = 0; + } + return out; +} + /* Will be set to True when any condition indicating we have to shutdown is encountered. */ Bool shutting_down = False; @@ -488,8 +507,7 @@ void wait_for_gdb_connect(int in_port) if (-1 == bind(listen_gdb, (struct sockaddr *)&addr, sizeof(addr))) { XERROR(errno, "bind failed"); } - fprintf(stderr, "listening on port %d ...", in_port); - fflush(stderr); + TSFPRINTF(stderr, "listening on port %d ...", in_port); if (-1 == listen(listen_gdb, 1)) { XERROR(errno, "error listen failed"); } @@ -570,7 +588,7 @@ readchar(int fd) if (bufcnt <= 0) { if (bufcnt == 0) { - fprintf(stderr, "readchar: Got EOF\n"); + TSFPRINTF(stderr, "readchar: Got EOF\n"); return -2; } else { ERROR(errno, "readchar\n"); @@ -636,8 +654,8 @@ getpkt(char *buf, int fromfd, int ackfd) if (csum == (c1 << 4) + c2) break; - fprintf(stderr, "Bad checksum, sentsum=0x%x, csum=0x%x, buf=%s\n", - (c1 << 4) + c2, csum, buf); + TSFPRINTF(stderr, "Bad checksum, sentsum=0x%x, csum=0x%x, buf=%s\n", + (c1 << 4) + c2, csum, buf); if (write(ackfd, "-", 1) != 1) ERROR(0, "error when writing - (nack)\n"); else @@ -822,8 +840,7 @@ void gdb_relay(int pid) int to_pid = -1; /* fd to write to pid */ int shutdown_loop = 0; - fprintf(stderr, "relaying data between gdb and process %d\n", pid); - fflush(stderr); + TSFPRINTF(stderr, "relaying data between gdb and process %d\n", pid); if (max_invoke_ms > 0) pthread_create(&invoke_gdbserver_in_valgrind_thread, NULL, @@ -986,8 +1003,7 @@ void standalone_send_commands(int pid, } for (nc = 0; nc <= last_command; nc++) { - fprintf(stderr, "sending command %s to pid %d\n", commands[nc], pid); - fflush(stderr); + TSFPRINTF(stderr, "sending command %s to pid %d\n", commands[nc], pid); /* prepare hexcommand $qRcmd,xxxx....................xx#cc */ hexcommand = vmalloc(packet_len_for_command(commands[nc])); @@ -1077,7 +1093,7 @@ void report_pid(int pid, Bool on_stdout) int fd, i; FILE *out = on_stdout ? stdout : stderr; - fprintf(out, "use --pid=%d for ", pid); + TSFPRINTF(out, "use --pid=%d for ", pid); sprintf(cmdline_file, "/proc/%d/cmdline", pid); fd = open(cmdline_file, O_RDONLY); @@ -1121,7 +1137,7 @@ void usage(void) " OPTIONS are [--pid=<number>] [--vgdb-prefix=<prefix>]\n" " [--wait=<number>] [--max-invoke-ms=<number>]\n" " [--port=<portnr>\n" -" [--cmd-time-out=<number>] [-l] [-D] [-d]\n" +" [--cmd-time-out=<number>] [-l] [-T] [-D] [-d]\n" " \n" " --pid arg must be given if multiple Valgrind gdbservers are found.\n" " --vgdb-prefix arg must be given to both Valgrind and vgdb utility\n" @@ -1136,6 +1152,7 @@ void usage(void) " --cmd-time-out (default 99999999) tells vgdb to exit if the found Valgrind\n" " gdbserver has not processed a command after number seconds\n" " -l arg tells to show the list of running Valgrind gdbserver and then exit.\n" +" -T arg tells to add timestamps to vgdb information messages.\n" " -D arg tells to show shared mem status and then exit.\n" " -d arg tells to show debug info. Multiple -d args for more debug info\n" "\n" @@ -1165,7 +1182,7 @@ int search_arg_pid(int arg_pid, int check_trials, Bool show_list) int pid = -1; if (arg_pid == 0 || arg_pid < -1) { - fprintf(stderr, "vgdb error: invalid pid %d given\n", arg_pid); + TSFPRINTF(stderr, "vgdb error: invalid pid %d given\n", arg_pid); exit(1); } else { /* search for a matching named fifo. @@ -1251,7 +1268,7 @@ int search_arg_pid(int arg_pid, int check_trials, Bool show_list) } } else if (nr_valid_pid > 1) { if (nr_valid_pid == 2) { - fprintf + TSFPRINTF (stderr, "no --pid= arg given" " and multiple valgrind pids found:\n"); @@ -1284,10 +1301,10 @@ int search_arg_pid(int arg_pid, int check_trials, Bool show_list) exit(1); } else if (pid == -1) { if (arg_pid == -1) - fprintf(stderr, "vgdb error: no FIFO found and no pid given\n"); + TSFPRINTF(stderr, "vgdb error: no FIFO found and no pid given\n"); else - fprintf(stderr, "vgdb error: no FIFO found matching pid %d\n", - arg_pid); + TSFPRINTF(stderr, "vgdb error: no FIFO found matching pid %d\n", + arg_pid); exit(1); } else if (pid == -2) { @@ -1369,35 +1386,37 @@ void parse_options(int argc, char** argv, show_shared_mem = True; } else if (is_opt(argv[i], "-l")) { show_list = True; + } else if (is_opt(argv[i], "-T")) { + timestamp = True; } else if (is_opt(argv[i], "--pid=")) { int newpid; if (!numeric_val(argv[i], &newpid)) { - fprintf(stderr, "invalid --pid argument %s\n", argv[i]); + TSFPRINTF(stderr, "invalid --pid argument %s\n", argv[i]); arg_errors++; } else if (arg_pid != -1) { - fprintf(stderr, "multiple --pid arguments given\n"); + TSFPRINTF(stderr, "multiple --pid arguments given\n"); arg_errors++; } else { arg_pid = newpid; } } else if (is_opt(argv[i], "--wait=")) { if (!numeric_val(argv[i], &check_trials)) { - fprintf(stderr, "invalid --wait argument %s\n", argv[i]); + TSFPRINTF(stderr, "invalid --wait argument %s\n", argv[i]); arg_errors++; } } else if (is_opt(argv[i], "--max-invoke-ms=")) { if (!numeric_val(argv[i], &max_invoke_ms)) { - fprintf(stderr, "invalid --max-invoke-ms argument %s\n", argv[i]); + TSFPRINTF(stderr, "invalid --max-invoke-ms argument %s\n", argv[i]); arg_errors++; } } else if (is_opt(argv[i], "--cmd-time-out=")) { if (!numeric_val(argv[i], &cmd_time_out)) { - fprintf(stderr, "invalid --cmd-time-out argument %s\n", argv[i]); + TSFPRINTF(stderr, "invalid --cmd-time-out argument %s\n", argv[i]); arg_errors++; } } else if (is_opt(argv[i], "--port=")) { if (!numeric_val(argv[i], &int_port)) { - fprintf(stderr, "invalid --port argument %s\n", argv[i]); + TSFPRINTF(stderr, "invalid --port argument %s\n", argv[i]); arg_errors++; } } else if (is_opt(argv[i], "--vgdb-prefix=")) { @@ -1407,7 +1426,7 @@ void parse_options(int argc, char** argv, commands[last_command] = vmalloc(1); commands[last_command][0] = '\0'; } else if (0 == strncmp(argv[i], "-", 1)) { - fprintf(stderr, "unknown or invalid argument %s\n", argv[i]); + TSFPRINTF(stderr, "unknown or invalid argument %s\n", argv[i]); arg_errors++; } else { int len; @@ -1424,7 +1443,7 @@ void parse_options(int argc, char** argv, strcat(commands[last_command], " "); strcat(commands[last_command], argv[i]); if (packet_len_for_command(commands[last_command]) > PBUFSIZ) { - fprintf(stderr, "command %s too long\n", commands[last_command]); + TSFPRINTF(stderr, "command %s too long\n", commands[last_command]); arg_errors++; } @@ -1440,38 +1459,38 @@ void parse_options(int argc, char** argv, && int_port == 0 && last_command == -1) { arg_errors++; - fprintf(stderr, - "Using vgdb standalone implies to give -D or -l or a COMMAND\n"); + TSFPRINTF(stderr, + "Using vgdb standalone implies to give -D or -l or a COMMAND\n"); } if (show_shared_mem && show_list) { arg_errors++; - fprintf(stderr, - "Can't use both -D and -l options\n"); + TSFPRINTF(stderr, + "Can't use both -D and -l options\n"); } if (max_invoke_ms > 0 && cmd_time_out != NEVER && (cmd_time_out * 1000) <= max_invoke_ms) { arg_errors++; - fprintf(stderr, - "--max-invoke-ms must be < --cmd-time-out * 1000\n"); + TSFPRINTF(stderr, + "--max-invoke-ms must be < --cmd-time-out * 1000\n"); } if (show_list && arg_pid != -1) { arg_errors++; - fprintf(stderr, - "Can't use both --pid and -l options\n"); + TSFPRINTF(stderr, + "Can't use both --pid and -l options\n"); } if (int_port > 0 && last_command != -1) { arg_errors++; - fprintf(stderr, - "Can't use --port to send commands\n"); + TSFPRINTF(stderr, + "Can't use --port to send commands\n"); } if (arg_errors > 0) { - fprintf(stderr, "args error. Try `vgdb --help` for more information\n"); + TSFPRINTF(stderr, "args error. Try `vgdb --help` for more information\n"); exit(1); } @@ -1520,15 +1539,14 @@ int main(int argc, char** argv) wait_for_gdb_connect(in_port); if (show_shared_mem) { - fprintf(stderr, - "vgdb %d " - "written_by_vgdb %d " - "seen_by_valgrind %d\n" - "vgdb pid %d\n", - VS_vgdb_pid, - VS_written_by_vgdb, - VS_seen_by_valgrind, - VS_vgdb_pid); + TSFPRINTF(stderr, + "vgdb %d " + "written_by_vgdb %d " + "seen_by_valgrind %d\n", + VS_vgdb_pid, + VS_written_by_vgdb, + VS_seen_by_valgrind); + TSFPRINTF(stderr, "vgdb pid %d\n", VS_vgdb_pid); exit(0); } diff --git a/coregrind/vgdb.h b/coregrind/vgdb.h index 4ca765e..0355329 100644 --- a/coregrind/vgdb.h +++ b/coregrind/vgdb.h @@ -35,14 +35,19 @@ #include <sys/types.h> +extern Bool timestamp; +extern char *timestamp_str (Bool produce); extern int debuglevel; -extern struct timeval dbgtv; -/* if level <= debuglevel, print timestamp, then print provided by debug info */ + +/* Optionally prints a timestamp, then prints the given info. This should + be used only at the beginning of a new line. */ +#define TSFPRINTF(stream, ...) ( \ + fprintf(stream, "%s", timestamp_str(timestamp)), \ + fprintf(stream, __VA_ARGS__),fflush(stream)) + +/* if level <= debuglevel, print timestamp, then prints provided debug info */ #define DEBUG(level, ...) (level <= debuglevel ? \ - gettimeofday(&dbgtv, NULL), \ - fprintf(stderr, "%ld.%6.6ld ", \ - (long int)dbgtv.tv_sec, \ - (long int)dbgtv.tv_usec), \ + fprintf(stderr, "%s", timestamp_str(True)), \ fprintf(stderr, __VA_ARGS__),fflush(stderr) \ : 0) @@ -51,15 +56,17 @@ extern struct timeval dbgtv; fprintf(stderr, __VA_ARGS__),fflush(stderr) \ : 0) -/* if errno != 0, +/* if errno != 0, report the errno and fprintf the ... varargs on stderr. */ #define ERROR(errno, ...) ((errno == 0 ? 0 : perror("syscall failed")), \ + fprintf(stderr, "%s", timestamp_str(timestamp)), \ fprintf(stderr, __VA_ARGS__), \ fflush(stderr)) /* same as ERROR, but also exits with status 1 */ #define XERROR(errno, ...) ((errno == 0 ? 0 : perror("syscall failed")), \ - fprintf(stderr, __VA_ARGS__), \ - fflush(stderr), \ + fprintf(stderr, "%s", timestamp_str(timestamp)), \ + fprintf(stderr, __VA_ARGS__), \ + fflush(stderr), \ exit(1)) /* Calls malloc (size). Exits if memory can't be allocated. */ diff --git a/docs/xml/manual-core-adv.xml b/docs/xml/manual-core-adv.xml index 362b916..e94a402 100644 --- a/docs/xml/manual-core-adv.xml +++ b/docs/xml/manual-core-adv.xml @@ -1264,6 +1264,13 @@ vgdb v.set log_output -c leak_check any </varlistentry> <varlistentry> + <term><option>-T</option></term> + <listitem><para>Instructs vgdb to add timestamps to vgdb + information messages. + </para></listitem> + </varlistentry> + + <varlistentry> <term><option>-D</option></term> <listitem><para>Instructs a standalone vgdb to show the state of the shared memory used by the Valgrind gdbserver. vgdb |
|
From: Olaf H. <ol...@ae...> - 2020-02-07 19:53:21
|
Am Wed, 5 Feb 2020 10:11:26 +0100 schrieb Olaf Hering <ol...@ae...>: > I will do so until this Friday. While I do have something that actually works with xen 4.13, it is not yet ready to submit. Olaf |
|
From: Paul F. <pj...@wa...> - 2020-02-07 15:57:25
|
> On 14 Mar 2019, at 19:16, Ed Maste <em...@fr...> wrote:
>
> On Thu, 14 Mar 2019 at 11:20, Tom Hughes <tom...@so...> wrote:
>>
>> commit 09566120e705d8831aaa7076b439d3ad90b78773
>> Author: Tom Hughes <to...@co...>
>> Date: Thu Mar 14 15:15:41 2019 +0000
>>
>> Suppress FSGSBASE flag from cpuid results
>>
>> We don't support {rd,wr}{fs,gs}base so we shouldn't say we do.
>
> Thanks, I have rebased the FreeBSD patch set on master now and the
> test results are consistent with earlier runs.
>
Hi
Since I have a bit of free time on my hands (one more week in theory), I’ve also been looking at the FreeBSD port of Valgrind.
Has any work been done on this since last March?
I now have FreeBSD 12.1 reinstalled with Phil Longstaff’s work plus a few of my changes. It seems to work at least for trivial tests - I haven’t yet tried running the regression tests.
At the moment there are 4 things that I see that I need to do
1. Rebase everything onto the main Valgrind development branch
2. I’ve noticed that there is a big issue with clang compiled executables. The problem is that the binaries have 3 PT_LOAD sections (ro, rx, rw) while GCC (and clang on Linux) only generates 2 (rw and rx). This is causing symtab loading to fail. This limits the usefulness somewhat.
3. There were a lot of syscall changes in FreeBSD 12, so I think that ‘configure’ needs to handle/define a freebsd_version variable.
4. There are still quite a few missing syscalls.
A+
Paul
|
|
From: Paul F. <pj...@wa...> - 2020-02-07 15:39:19
|
> On 19 Jan 2020, at 16:04, John Reiser <jr...@bi...> wrote: > >> ==== SB 2822 (evchecks 301498) [tid 1] 0x1005f5ecb __pthread_init+898 /usr/lib/system/libsystem_pthread.dylib+0xecb >> 0x1005F5ECB: call 0x1005FD7A6 >> 0x1005FD7A6: leaq 2759(%rip), %rcx >> 0x1005FD7AD: xorl %eax,%eax >> 0x1005FD7AF: movq %rcx,11002(%rip) >> 0x1005FD7B6: movq %rax,11043(%rip) >> 0x1005FD7BD: ud2 >> ==79936== valgrind: Unrecognised instruction at address 0x1005fd7bd. >> ==80006== at 0x1005FD7BD: __pthread_init.cold.2 (in /usr/lib/system/libsystem_pthread.dylib) > > The pthread library has detected an impossible situation regarding system calls, > and this is the calling sequence to report the fatal error to MacOS. > The bad emulation happened some time ago. > > See https://bugs.kde.org/show_bug.cgi?id=383723#c23 of 2.5 years ago where a similar ud2 > was found to result from an incomplete emulation of kevent_qos syscall. > > I’ve spent a good while looking at this and am still more or less scratching my head. Here’s what I’ve done. 1. Setup a macOS 10.14 Mojave VM, installed XCode and the same source. It builds and seems to work (at least for my minimal test). 2. Generate traces with —trace-syscalls=yes and --trace-flags=10000000 to see what sys calls and VEX are doing. Obviously there are tons of diffs between these two logs, PIDs and hex addresses to start with. However the logs aren’t enormously long - just 3807 lines on macOS 10,15. In the logs, I see 3 sections a. stat/open/mmap/vm_allocate/close to load all of the system .dylibs. The dylibs aren’t loaded in the same order, and macOS 10.15 has added one new one (feature flags). b. Another big chunk, this time in dyld and ImageLoader functions c. __libkernel_init, which is towards the end of the 10.15 log. I’ve mostly been looking in this part, though I’ve no reason to suppose that the previous two sections don’t contain the issue(s). One thing that I’ve seen in this last section is this on macOS 10,14 ==== SB 2625 (evchecks 343156) [tid 1] 0x1005f85d6 _setcontext+144 /usr/lib/system/libsystem_platform.dylib+0x75d6 Whilst the corresponding VEX output on 10.15 is ==== SB 2795 (evchecks 300971) [tid 1] 0x1005e862a _os_semaphore_wait.cold.1+110 /usr/lib/system/libsystem_platform.dylib+0x762a I’m not sure what is happening here. In both cases the offset is beyond the end of lib system_platform that I see from disassemby (0x756a and 0x75d4 respectively). These are the names of the last functions in the library. The last thing that I see before the failing call to pthread_init is a syscall to sysctl KERN_USRSTACK64 which seems to work OK. Any other suggestions? A+ Paul |
|
From: Andreas A. <ar...@so...> - 2020-02-06 11:31:46
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=e83c28e10c99d52b22ee69e25857dac8bf3d5240 commit e83c28e10c99d52b22ee69e25857dac8bf3d5240 Author: Andreas Arnez <ar...@li...> Date: Thu Jan 16 13:49:10 2020 +0100 Bug 416301 - s390x: Support "compare and signal" instructions Add VEX support for the s390x "compare and signal" instructions KEBR, KDBR, KXBR, KEB, and KDB. For now, let them behave exactly like their non-signalling counterparts. Enhance the bfp-4 test case to cover these instructions as well. Update the list of supported instructions in s390-opcodes.csv. Add a disclaimer to README.s390, explaining that FP signalling is not handled accurately on s390x at the moment. Diff: --- NEWS | 1 + README.s390 | 7 +- VEX/priv/guest_s390_toIR.c | 134 +++++++++++++++++++++++--------------- docs/internals/s390-opcodes.csv | 10 +-- none/tests/s390x/bfp-4.c | 130 +++++++++++++++++++++++------------- none/tests/s390x/bfp-4.stdout.exp | 86 ++++++++++++++++++++++-- 6 files changed, 255 insertions(+), 113 deletions(-) diff --git a/NEWS b/NEWS index 96ed2ff..c9ec9fa 100644 --- a/NEWS +++ b/NEWS @@ -105,6 +105,7 @@ where XXXXXX is the bug number as listed below. 415757 vex x86->IR: 0x66 0xF 0xCE 0x4F (bswapw) 416239 valgrind crashes when handling clock_adjtime 416286 DRD reports "conflicting load" error on std::mutex::lock() +416301 s390x: "compare and signal" not supported 416387 finit_module and bpf syscalls are unhandled on arm64 416464 Fix false reports for uninitialized memory for PR_CAPBSET_READ/DROP n-i-bz Fix minor one time leaks in dhat. diff --git a/README.s390 b/README.s390 index ac9485a..7df386e 100644 --- a/README.s390 +++ b/README.s390 @@ -11,7 +11,10 @@ Limitations ----------- - 31-bit client programs are not supported. - Hexadecimal floating point is not supported. -- Transactional memory is not supported. +- Transactional memory is not supported. The transactional-execution + facility is masked off from HWCAP. +- FP signalling is not accurate. E.g., the "compare and signal" + instructions behave like their non-signalling counterparts. - memcheck, cachegrind, drd, helgrind, massif, lackey, and none are supported. - On machine models predating z10, cachegrind will assume a z10 cache @@ -21,8 +24,6 @@ Limitations - Some gcc versions use mvc to copy 4/8 byte values. This will affect certain debug messages. For example, memcheck will complain about 4 one-byte reads/writes instead of just a single read/write. -- The transactional-execution facility is not supported; it is masked - off from HWCAP. Hardware facilities diff --git a/VEX/priv/guest_s390_toIR.c b/VEX/priv/guest_s390_toIR.c index a8f0d3a..ed95fc0 100644 --- a/VEX/priv/guest_s390_toIR.c +++ b/VEX/priv/guest_s390_toIR.c @@ -1204,6 +1204,16 @@ get_dpr_dw0(UInt archreg) return IRExpr_Get(fpr_dw0_offset(archreg), Ity_D64); } +/* Read a float of given type from an fpr. */ +static IRExpr * +get_fpr_float(UInt archreg, IRType type) +{ + if (type == Ity_F128) + return get_fpr_pair(archreg); + else + return IRExpr_Get(fpr_offset(archreg), type); +} + /*------------------------------------------------------------*/ /*--- gpr registers ---*/ /*------------------------------------------------------------*/ @@ -14055,94 +14065,103 @@ s390_irgen_AXBR(UChar r1, UChar r2) return "axbr"; } +/* Helper for "compare" insns CEBR, CDBR, CXBR, and their signalling + counterparts. */ static const HChar * -s390_irgen_CEBR(UChar r1, UChar r2) +s390_irgen_CxBR(const HChar *mnem, UChar r1, UChar r2, IRType type, IROp cmp_op) { - IRTemp op1 = newTemp(Ity_F32); - IRTemp op2 = newTemp(Ity_F32); + IRTemp op1 = newTemp(type); + IRTemp op2 = newTemp(type); IRTemp cc_vex = newTemp(Ity_I32); IRTemp cc_s390 = newTemp(Ity_I32); - assign(op1, get_fpr_w0(r1)); - assign(op2, get_fpr_w0(r2)); - assign(cc_vex, binop(Iop_CmpF32, mkexpr(op1), mkexpr(op2))); + assign(op1, get_fpr_float(r1, type)); + assign(op2, get_fpr_float(r2, type)); + assign(cc_vex, binop(cmp_op, mkexpr(op1), mkexpr(op2))); assign(cc_s390, convert_vex_bfpcc_to_s390(cc_vex)); s390_cc_thunk_put1(S390_CC_OP_SET, cc_s390, False); + return mnem; +} + +static const HChar * +s390_irgen_CEBR(UChar r1, UChar r2) +{ + return s390_irgen_CxBR("cebr", r1, r2, Ity_F32, Iop_CmpF32); +} - return "cebr"; +static const HChar * +s390_irgen_KEBR(UChar r1, UChar r2) +{ + return s390_irgen_CxBR("kebr", r1, r2, Ity_F32, Iop_CmpF32); } static const HChar * s390_irgen_CDBR(UChar r1, UChar r2) { - IRTemp op1 = newTemp(Ity_F64); - IRTemp op2 = newTemp(Ity_F64); - IRTemp cc_vex = newTemp(Ity_I32); - IRTemp cc_s390 = newTemp(Ity_I32); + return s390_irgen_CxBR("cdbr", r1, r2, Ity_F64, Iop_CmpF64); +} - assign(op1, get_fpr_dw0(r1)); - assign(op2, get_fpr_dw0(r2)); - assign(cc_vex, binop(Iop_CmpF64, mkexpr(op1), mkexpr(op2))); +static const HChar * +s390_irgen_KDBR(UChar r1, UChar r2) +{ + return s390_irgen_CxBR("kdbr", r1, r2, Ity_F64, Iop_CmpF64); +} - assign(cc_s390, convert_vex_bfpcc_to_s390(cc_vex)); - s390_cc_thunk_put1(S390_CC_OP_SET, cc_s390, False); +static const HChar * +s390_irgen_CXBR(UChar r1, UChar r2) +{ + return s390_irgen_CxBR("cxbr", r1, r2, Ity_F128, Iop_CmpF128); +} - return "cdbr"; +static const HChar * +s390_irgen_KXBR(UChar r1, UChar r2) +{ + return s390_irgen_CxBR("kxbr", r1, r2, Ity_F128, Iop_CmpF128); } +/* Helper for "compare" insns CEB, CDB, and their signalling counterparts. */ static const HChar * -s390_irgen_CXBR(UChar r1, UChar r2) +s390_irgen_CxB(const HChar *mnem, UChar r1, IRTemp op2addr, IRType type, + IROp cmp_op) { - IRTemp op1 = newTemp(Ity_F128); - IRTemp op2 = newTemp(Ity_F128); + IRTemp op1 = newTemp(type); + IRTemp op2 = newTemp(type); IRTemp cc_vex = newTemp(Ity_I32); IRTemp cc_s390 = newTemp(Ity_I32); - assign(op1, get_fpr_pair(r1)); - assign(op2, get_fpr_pair(r2)); - assign(cc_vex, binop(Iop_CmpF128, mkexpr(op1), mkexpr(op2))); + assign(op1, get_fpr_float(r1, type)); + assign(op2, load(type, mkexpr(op2addr))); + assign(cc_vex, binop(cmp_op, mkexpr(op1), mkexpr(op2))); assign(cc_s390, convert_vex_bfpcc_to_s390(cc_vex)); s390_cc_thunk_put1(S390_CC_OP_SET, cc_s390, False); - - return "cxbr"; + return mnem; } static const HChar * s390_irgen_CEB(UChar r1, IRTemp op2addr) { - IRTemp op1 = newTemp(Ity_F32); - IRTemp op2 = newTemp(Ity_F32); - IRTemp cc_vex = newTemp(Ity_I32); - IRTemp cc_s390 = newTemp(Ity_I32); - - assign(op1, get_fpr_w0(r1)); - assign(op2, load(Ity_F32, mkexpr(op2addr))); - assign(cc_vex, binop(Iop_CmpF32, mkexpr(op1), mkexpr(op2))); - - assign(cc_s390, convert_vex_bfpcc_to_s390(cc_vex)); - s390_cc_thunk_put1(S390_CC_OP_SET, cc_s390, False); + return s390_irgen_CxB("ceb", r1, op2addr, Ity_F32, Iop_CmpF32); +} - return "ceb"; +static const HChar * +s390_irgen_KEB(UChar r1, IRTemp op2addr) +{ + return s390_irgen_CxB("keb", r1, op2addr, Ity_F32, Iop_CmpF32); + return "keb"; } static const HChar * s390_irgen_CDB(UChar r1, IRTemp op2addr) { - IRTemp op1 = newTemp(Ity_F64); - IRTemp op2 = newTemp(Ity_F64); - IRTemp cc_vex = newTemp(Ity_I32); - IRTemp cc_s390 = newTemp(Ity_I32); - - assign(op1, get_fpr_dw0(r1)); - assign(op2, load(Ity_F64, mkexpr(op2addr))); - assign(cc_vex, binop(Iop_CmpF64, mkexpr(op1), mkexpr(op2))); - - assign(cc_s390, convert_vex_bfpcc_to_s390(cc_vex)); - s390_cc_thunk_put1(S390_CC_OP_SET, cc_s390, False); + return s390_irgen_CxB("cdb", r1, op2addr, Ity_F64, Iop_CmpF64); +} - return "cdb"; +static const HChar * +s390_irgen_KDB(UChar r1, IRTemp op2addr) +{ + return s390_irgen_CxB("kdb", r1, op2addr, Ity_F64, Iop_CmpF64); } static const HChar * @@ -19270,7 +19289,8 @@ s390_decode_4byte_and_irgen(const UChar *bytes) case 0xb306: s390_format_RRE_FF(s390_irgen_LXEBR, RRE_r1(ovl), RRE_r2(ovl)); goto ok; case 0xb307: /* MXDBR */ goto unimplemented; - case 0xb308: /* KEBR */ goto unimplemented; + case 0xb308: s390_format_RRE_FF(s390_irgen_KEBR, RRE_r1(ovl), + RRE_r2(ovl)); goto ok; case 0xb309: s390_format_RRE_FF(s390_irgen_CEBR, RRE_r1(ovl), RRE_r2(ovl)); goto ok; case 0xb30a: s390_format_RRE_FF(s390_irgen_AEBR, RRE_r1(ovl), @@ -19300,7 +19320,8 @@ s390_decode_4byte_and_irgen(const UChar *bytes) RRE_r2(ovl)); goto ok; case 0xb317: s390_format_RRE_FF(s390_irgen_MEEBR, RRE_r1(ovl), RRE_r2(ovl)); goto ok; - case 0xb318: /* KDBR */ goto unimplemented; + case 0xb318: s390_format_RRE_FF(s390_irgen_KDBR, RRE_r1(ovl), + RRE_r2(ovl)); goto ok; case 0xb319: s390_format_RRE_FF(s390_irgen_CDBR, RRE_r1(ovl), RRE_r2(ovl)); goto ok; case 0xb31a: s390_format_RRE_FF(s390_irgen_ADBR, RRE_r1(ovl), @@ -19351,7 +19372,8 @@ s390_decode_4byte_and_irgen(const UChar *bytes) case 0xb347: s390_format_RRF_UUFF(s390_irgen_FIXBRA, RRF2_m3(ovl), RRF2_m4(ovl), RRF2_r1(ovl), RRF2_r2(ovl)); goto ok; - case 0xb348: /* KXBR */ goto unimplemented; + case 0xb348: s390_format_RRE_FF(s390_irgen_KXBR, RRE_r1(ovl), + RRE_r2(ovl)); goto ok; case 0xb349: s390_format_RRE_FF(s390_irgen_CXBR, RRE_r1(ovl), RRE_r2(ovl)); goto ok; case 0xb34a: s390_format_RRE_FF(s390_irgen_AXBR, RRE_r1(ovl), @@ -21408,7 +21430,9 @@ s390_decode_6byte_and_irgen(const UChar *bytes) RXE_x2(ovl), RXE_b2(ovl), RXE_d2(ovl)); goto ok; case 0xed0000000007ULL: /* MXDB */ goto unimplemented; - case 0xed0000000008ULL: /* KEB */ goto unimplemented; + case 0xed0000000008ULL: s390_format_RXE_FRRD(s390_irgen_KEB, RXE_r1(ovl), + RXE_x2(ovl), RXE_b2(ovl), + RXE_d2(ovl)); goto ok; case 0xed0000000009ULL: s390_format_RXE_FRRD(s390_irgen_CEB, RXE_r1(ovl), RXE_x2(ovl), RXE_b2(ovl), RXE_d2(ovl)); goto ok; @@ -21448,7 +21472,9 @@ s390_decode_6byte_and_irgen(const UChar *bytes) case 0xed0000000017ULL: s390_format_RXE_FRRD(s390_irgen_MEEB, RXE_r1(ovl), RXE_x2(ovl), RXE_b2(ovl), RXE_d2(ovl)); goto ok; - case 0xed0000000018ULL: /* KDB */ goto unimplemented; + case 0xed0000000018ULL: s390_format_RXE_FRRD(s390_irgen_KDB, RXE_r1(ovl), + RXE_x2(ovl), RXE_b2(ovl), + RXE_d2(ovl)); goto ok; case 0xed0000000019ULL: s390_format_RXE_FRRD(s390_irgen_CDB, RXE_r1(ovl), RXE_x2(ovl), RXE_b2(ovl), RXE_d2(ovl)); goto ok; diff --git a/docs/internals/s390-opcodes.csv b/docs/internals/s390-opcodes.csv index 0765bd1..82332e4 100644 --- a/docs/internals/s390-opcodes.csv +++ b/docs/internals/s390-opcodes.csv @@ -268,11 +268,11 @@ cdbr,"compare long bfp",implemented, cdb,"compare long bfp",implemented, cebr,"compare short bfp",implemented, ceb,"compare short bfp",implemented, -kxbr,"compare and signal extended bfp","not implemented", -kdbr,"compare and signal long bfp","not implemented", -kdb,"compare and signal long bfp","not implemented", -kebr,"compare and signal short bfp","not implemented", -keb,"compare and signal short bfp","not implemented", +kxbr,"compare and signal extended bfp",implemented, +kdbr,"compare and signal long bfp",implemented, +kdb,"compare and signal long bfp",implemented, +kebr,"compare and signal short bfp",implemented, +keb,"compare and signal short bfp",implemented, cxfbr,"convert from fixed 32 to extended bfp",implemented, cdfbr,"convert from fixed 32 to long bfp",implemented, cefbr,"convert from fixed 32 to short bfp",implemented, diff --git a/none/tests/s390x/bfp-4.c b/none/tests/s390x/bfp-4.c index c2d8881..02315b6 100644 --- a/none/tests/s390x/bfp-4.c +++ b/none/tests/s390x/bfp-4.c @@ -1,61 +1,101 @@ #include <stdio.h> -/* Test BFP comparison for 32/64-bit. */ +static const char *const cmp_result_str[] = { + "==", "<", ">", "??" +}; -void cebr(float v1, float v2) +#define TEST_CxB(insn, fmt, mode, v1, v2) \ + do { \ + int cc; \ + \ + __asm__ volatile(insn " %[r1],%[r2]\n\t" \ + "ipm %[psw]\n\t" \ + "srl %[psw],28\n\t" \ + : [psw]"=d"(cc) \ + : [r1]"f"(v1), [r2]mode(v2) \ + : "cc"); \ + printf("%-6s" fmt " %s " fmt "\n", \ + insn ":", v1, cmp_result_str[cc], v2); \ + } while (0) + +/* Test BFP comparison for 32/64/128-bit. */ + +static void cebr(float a, float b) +{ + TEST_CxB("cebr", "%g", "f", a, b); +} + +static void ceb(float a, float b) +{ + TEST_CxB("ceb", "%g", "R", a, b); +} + +static void cdbr(double a, double b) { - int cc; + TEST_CxB("cdbr", "%g", "f", a, b); +} - __asm__ volatile("cebr %[r1],%[r2]\n\t" - "ipm %[psw]\n\t" - "srl %[psw],28\n\t" - : [psw]"=d"(cc) : [r1]"f"(v1), [r2]"f"(v2) : "cc"); - if (cc == 0) - printf("cfebr: %f == %f\n", v1, v2); - if (cc == 1) - printf("cfebr: %f < %f\n", v1, v2); - if (cc == 2) - printf("cfebr: %f > %f\n", v1, v2); +static void cdb(double a, double b) +{ + TEST_CxB("cdb", "%g", "R", a, b); } -void cdbr(double v1, double v2) +static void cxbr(long double a, long double b) { - int cc; + TEST_CxB("cxbr", "%Lg", "f", a, b); +} + +static void kebr(float a, float b) +{ + TEST_CxB("kebr", "%g", "f", a, b); +} - __asm__ volatile("cdbr %[r1],%[r2]\n\t" - "ipm %[psw]\n\t" - "srl %[psw],28\n\t" - : [psw]"=d"(cc) : [r1]"f"(v1), [r2]"f"(v2) : "cc"); - if (cc == 0) - printf("cdebr: %f == %f\n", v1, v2); - if (cc == 1) - printf("cdebr: %f < %f\n", v1, v2); - if (cc == 2) - printf("cdebr: %f > %f\n", v1, v2); +static void keb(float a, float b) +{ + TEST_CxB("keb", "%g", "R", a, b); +} + +static void kdbr(double a, double b) +{ + TEST_CxB("kdbr", "%g", "f", a, b); +} + +static void kdb(double a, double b) +{ + TEST_CxB("kdb", "%g", "R", a, b); +} + +static void kxbr(long double a, long double b) +{ + TEST_CxB("kxbr", "%Lg", "f", a, b); +} + +static void do_compare(float a, float b) +{ + cebr(a, b); + ceb(a, b); + kebr(a, b); + keb(a, b); + cdbr((double) a, (double) b); + cdb((double) a, (double) b); + kdbr((double) a, (double) b); + kdb((double) a, (double) b); + cxbr((long double) a, (long double) b); + kxbr((long double) a, (long double) b); } int main(void) { - float f1, f2; - float d1, d2; - - // compare 4 bytes - f1 = 3.14f; - f2 = f1; - cebr(f1, f2); - f2 = f1 + 10.; - cebr(f1, f2); - f2 = f1 - 100.; - cebr(f1, f2); - - // compare 8 bytes - d1 = 2.78; - d2 = d1; - cdbr(d1, d2); - d2 = d1 + 10.; - cdbr(d1, d2); - d2 = d1 - 100.; - cdbr(d1, d2); + float inf = 1.f / 0.; + float neg_inf = -1.f / 0.; + do_compare(3.14f, 3.14f); + do_compare(-2.78f, 2.78f); + do_compare(inf, inf); + do_compare(inf, neg_inf); + do_compare(neg_inf, neg_inf); + do_compare(inf, 1.f); + do_compare(neg_inf, -1.f); + do_compare(1.f / inf, -1.f / inf); return 0; } diff --git a/none/tests/s390x/bfp-4.stdout.exp b/none/tests/s390x/bfp-4.stdout.exp index eff1366..bc81ea6 100644 --- a/none/tests/s390x/bfp-4.stdout.exp +++ b/none/tests/s390x/bfp-4.stdout.exp @@ -1,6 +1,80 @@ -cfebr: 3.140000 == 3.140000 -cfebr: 3.140000 < 13.140000 -cfebr: 3.140000 > -96.860001 -cdebr: 2.780000 == 2.780000 -cdebr: 2.780000 < 12.780000 -cdebr: 2.780000 > -97.220001 +cebr: 3.14 == 3.14 +ceb: 3.14 == 3.14 +kebr: 3.14 == 3.14 +keb: 3.14 == 3.14 +cdbr: 3.14 == 3.14 +cdb: 3.14 == 3.14 +kdbr: 3.14 == 3.14 +kdb: 3.14 == 3.14 +cxbr: 3.14 == 3.14 +kxbr: 3.14 == 3.14 +cebr: -2.78 < 2.78 +ceb: -2.78 < 2.78 +kebr: -2.78 < 2.78 +keb: -2.78 < 2.78 +cdbr: -2.78 < 2.78 +cdb: -2.78 < 2.78 +kdbr: -2.78 < 2.78 +kdb: -2.78 < 2.78 +cxbr: -2.78 < 2.78 +kxbr: -2.78 < 2.78 +cebr: inf == inf +ceb: inf == inf +kebr: inf == inf +keb: inf == inf +cdbr: inf == inf +cdb: inf == inf +kdbr: inf == inf +kdb: inf == inf +cxbr: inf == inf +kxbr: inf == inf +cebr: inf > -inf +ceb: inf > -inf +kebr: inf > -inf +keb: inf > -inf +cdbr: inf > -inf +cdb: inf > -inf +kdbr: inf > -inf +kdb: inf > -inf +cxbr: inf > -inf +kxbr: inf > -inf +cebr: -inf == -inf +ceb: -inf == -inf +kebr: -inf == -inf +keb: -inf == -inf +cdbr: -inf == -inf +cdb: -inf == -inf +kdbr: -inf == -inf +kdb: -inf == -inf +cxbr: -inf == -inf +kxbr: -inf == -inf +cebr: inf > 1 +ceb: inf > 1 +kebr: inf > 1 +keb: inf > 1 +cdbr: inf > 1 +cdb: inf > 1 +kdbr: inf > 1 +kdb: inf > 1 +cxbr: inf > 1 +kxbr: inf > 1 +cebr: -inf < -1 +ceb: -inf < -1 +kebr: -inf < -1 +keb: -inf < -1 +cdbr: -inf < -1 +cdb: -inf < -1 +kdbr: -inf < -1 +kdb: -inf < -1 +cxbr: -inf < -1 +kxbr: -inf < -1 +cebr: 0 == -0 +ceb: 0 == -0 +kebr: 0 == -0 +keb: 0 == -0 +cdbr: 0 == -0 +cdb: 0 == -0 +kdbr: 0 == -0 +kdb: 0 == -0 +cxbr: 0 == -0 +kxbr: 0 == -0 |
|
From: Daniel F. <da...@fa...> - 2020-02-06 09:12:32
|
Hi, In the bugzilla there exists a couple of bugs regarding the setns syscall[1]. They even have patches attached to them, at least 343099 and 368923 does. What is the status of this? I have verified that the patches solves the issue. Is there anything that I can help with in order for this to be merged? Best regards, Daniel Fahlgren 1: https://bugs.kde.org/show_bug.cgi?id=343099 https://bugs.kde.org/show_bug.cgi?id=369031 https://bugs.kde.org/show_bug.cgi?id=368923 |
|
From: Philippe W. <phi...@sk...> - 2020-02-06 07:09:10
|
On Wed, 2020-02-05 at 09:40 +0100, Julian Seward wrote: > Also, of course, if there are other changes that should go in 3.16, speak up > now. I am wondering what we should do for prwritev (and similar syscall) supp entries not working anymore: https://bugs.kde.org/show_bug.cgi?id=417075 The origin of this bug has been identified as a backward incompatible change introduced in 3.15: some suppression entries working with 3.14 and before will not suppress anymore the same error in 3.15, but fixing this backward incompatibility in 3.16 might mean we are then breaking the supp entries working with 3.15 :(. Philippe |
|
From: Olaf H. <ol...@ae...> - 2020-02-05 09:11:46
|
Am Wed, 5 Feb 2020 10:02:49 +0100 schrieb Julian Seward <js...@ac...>: > Please attach a patch (not a PR) to bug 390553 which changes the current > sources in a way which you think is suitable. I will do so until this Friday. Olaf |
|
From: Olaf H. <ol...@ae...> - 2020-02-05 09:07:42
|
On Wed, Feb 05, Julian Seward wrote: > Also, of course, if there are other changes that should go in 3.16, speak up now. Would you consider fixing Xen for this release? The recent commit just stuffed some constants into the switch statements, which does not "add support for Xen x.y". If not, I will just rest my case. Olaf |
|
From: Julian S. <js...@ac...> - 2020-02-05 09:03:02
|
On 05/02/2020 09:49, Olaf Hering wrote: > On Wed, Feb 05, Julian Seward wrote: > Would you consider fixing Xen for this release? Yes. IIUC, you're referring to https://bugs.kde.org/show_bug.cgi?id=390553#c6. Yes? Please attach a patch (not a PR) to bug 390553 which changes the current sources in a way which you think is suitable. I have neither the expertise nor time to get into the details of Xen ioctls/syscalls, but I am happy to review and land patch(es) for Xen support. J |
|
From: Julian S. <js...@ac...> - 2020-02-05 08:40:13
|
Greetings. In the Developer Toolroom at FOSDEM20 last Sunday, there was a bit of discussion regarding the release date for 3.16.0. The following was agreed: * freeze for large changes on Monday 2 March 2020. * final release on Monday 16 March 2020. This gives us just under four weeks to land any large changes for 3.16, followed by a two week stabilisation period before the release. My list of changes still to do for 3.16 are: * make the new &&-idiom-recognition stuff work also on s390 and MIPS. This was discussed with both the s390 and MIPS folks on Sunday. If it is not fixable in the timescale, it's not a disaster since that functionality can remain disabled on those targets, as it is now. But if possible it would be nice to have it fixed. * 64-bit time-related syscalls on 32-bit Linux targets are now failing (esp for Fedora Rawhide). Mark and/or me can look at this; other volunteers welcome. * Continue testing with gcc 10 (and maybe glibc-the-latest?); make sure it works. * [me] I'd like to land 253657 (improvements to PDB reading) if possible. * I would like to remove the exp-sgcheck tool. It hasn't been usable for years (if ever); it doesn't work at all on non-x86/amd64 targets, and is generally pointless to keep around. Are there any objections to removing it? * I'll make another pass through the open bugs within the next week, but I'm not aware of any critical bugs right now. If this schedule is a problem for anyone, please let us know immediately. Also, of course, if there are other changes that should go in 3.16, speak up now. J |