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) |
2
(4) |
3
(1) |
4
(7) |
5
|
|
6
|
7
(4) |
8
|
9
(3) |
10
(6) |
11
(13) |
12
(6) |
|
13
(1) |
14
|
15
(1) |
16
|
17
(4) |
18
(3) |
19
(5) |
|
20
(5) |
21
(5) |
22
(5) |
23
(6) |
24
|
25
(1) |
26
(1) |
|
27
(1) |
28
(4) |
29
(5) |
30
|
|
|
|
|
From: <sv...@va...> - 2016-11-21 12:18:37
|
Author: sewardj
Date: Mon Nov 21 12:18:29 2016
New Revision: 16150
Log:
Add a tracking file for bugs in 3.12.
Added:
trunk/docs/internals/3_12_BUGSTATUS.txt
Modified:
trunk/docs/Makefile.am
Modified: trunk/docs/Makefile.am
==============================================================================
--- trunk/docs/Makefile.am (original)
+++ trunk/docs/Makefile.am Mon Nov 21 12:18:29 2016
@@ -31,6 +31,7 @@
internals/3_9_BUGSTATUS.txt \
internals/3_10_BUGSTATUS.txt \
internals/3_11_BUGSTATUS.txt \
+ internals/3_12_BUGSTATUS.txt \
internals/MERGE_3_10_1.txt \
internals/arm_thumb_notes_gdbserver.txt \
internals/avx-notes.txt \
Added: trunk/docs/internals/3_12_BUGSTATUS.txt
==============================================================================
--- trunk/docs/internals/3_12_BUGSTATUS.txt (added)
+++ trunk/docs/internals/3_12_BUGSTATUS.txt Mon Nov 21 12:18:29 2016
@@ -0,0 +1,454 @@
+
+Created Mon 21 Nov 12:58:23 CET 2016. All bugs after the release of
+3.12.0 go in here. Also, this contains bugs from 3_11_BUGSTATUS.txt
+that didn't get fixed in 3.12. These are marked "(carried over)".
+
+=== VEX/amd64 ==========================================================
+
+(carried over)
+356715 vex amd64->IR: 0xC4 0xE2 0x7D 0x13 0x4 0x4A 0xC5 0xFC
+ vcvtph2ps (%rdx,%rcx,2),%ymm0
+
+(carried over)
+360415 amd64 instructions ADCX and ADOX are not implemented in VEX
+ [has patch, could possibly take it, but needs cleanup/verification]
+
+(carried over)
+367543 bt/btc/btr/bts x86/x86_64 instructions are poorly-handled wrt flags
+ [Z flag behaviour is wrong]
+
+AMD XOP-prefixed insns:
+
+(carried over)
+356611 vex amd64->IR: 0x8F 0xEA 0xF8 0x10 0xC9 0x3 0x1D 0x0
+ [== 328357, still open]
+
+(carried over)
+339596 vex amd64->IR: 0x8F 0xE8 0x78 0xCD 0xC1 0x4 0xC5 0xF9
+ [AMD XOP/FMA support]
+ == 356138
+
+=== VEX/arm ============================================================
+
+(carried over)
+352630 valgrind: Unrecognised instruction at address 0x4fc4d33.
+ [what insn is this?]
+
+(carried over)
+355526 disInstr(arm): unhandled instruction: 0x1823E91
+ [what insn is this?]
+
+(carried over)
+n-i-bz Remove limit on strd's negative immediates
+ [dev@, Michael Daniels, 19 Nov 2015, easy fix, should land]
+
+(carried over)
+362934 [AsusWRT] Arm v7 illegal instruction
+ [unclear what this is; a SIGILL on generated code]
+
+=== VEX/arm64 ==========================================================
+
+=== VEX/x86 ============================================================
+
+=== VEX/mips ===========================================================
+
+=== VEX/ppc ============================================================
+
+(carried over)
+361405 disInstr(ppc): unhandled instruction: 0xFF81010C
+
+=== VEX/s390x ==========================================================
+
+(carried over)
+366413 s390x: New z13 instructions not implemented
+ [Per cborntraeger, is not important for 3.12.0]
+
+=== VEX general ========================================================
+
+=== Syscalls/ioctls on Linux ===========================================
+
+(carried over)
+348616 Wine/valgrind: Warning: noted but unhandled ioctl 0x5390 with
+ no size/direction hints. (DVD_READ_STRUCT)
+
+(carried over)
+352742 Custom allocator using sbrk() fails after about 800MB when running
+ under memcheck
+
+(carried over)
+352767 Wine/valgrind: Warning: noted but unhandled ioctl 0x5307 with
+ no size/direction hints. (CDROMSTOP)
+
+(carried over)
+355803 Add Lustre's IOC_MDC_GETFILESTRIPE ioctl [has patch]
+
+(carried over)
+357781 unhandled amd64-linux syscall: 317
+ [== 345414, still open]
+
+(carried over)
+358620 WARNING: unhandled syscall: 357
+ [arm32, 3.7.0, also an unhandled insn]
+
+(carried over)
+359705 memcheck causes segfault on a dynamically-linked test from
+ rustlang's test suite on i686
+
+(carried over)
+360429 Warning: noted but unhandled ioctl 0x530d with no size/direction hints.
+ (has patch, should take)
+
+(carried over)
+361726 WARNING:unhandled syscall on ppc64
+
+(carried over)
+361770 Missing F_ADD_SEALS
+
+(carried over)
+362892 test apk in android5.0.2,after fix the bug 344802,android log
+ "Unable to create protected region in stack for implicit overflow
+ check. Reason: Out of memory size: 4096"
+
+(carried over)
+362939 test apk in android 5.0 or most,at 0x6A23AB4:
+ art::Thread::InstallImplicitProtection() (in /system/lib/libart.so)
+ [initimg problems on Android]
+
+(carried over)
+364359 Valgrind crashes on fcntl(F_SETFL, O_NONBLOCK, fd)
+
+(carried over)
+367942 Segfault vgPlain_do_sys_sigaction (m_signals.c:1138)
+
+(carried over)
+368791 unhandled syscall: 167 (swapon, amd64-linux)
+ (should fix this for 3.12.1)
+
+=== Syscalls/ioctls on OSX =============================================
+
+(carried over)
+351632 UNKNOWN fcntl 97 on OS X 10.11
+
+(carried over)
+352021 Signals are ignored in OS X 10.10
+
+(carried over)
+353346 WARNING: unhandled amd64-darwin syscall: unix:330
+ == 211362 [not fixed]
+
+=== Debuginfo reader ===================================================
+
+(carried over)
+353192 Debug info/data section not detected on AMD64
+ [To do with rwx, combined code+data sections]
+
+(carried over)
+355197 Too strong assert in variable debug info code
+ [Still relevant?]
+
+(carried over)
+365750 Valgrind fails on binary with .text section not in default place
+ [Horrible hack to do with relocating .text section]
+
+=== Tools/Memcheck =====================================================
+
+(carried over)
+352364 ppc64: --expensive-definedness-checks=yes is not quite working here
+
+(carried over)
+353282 False uninitialised memory after bittwiddling
+
+(carried over)
+358980 32 byte leak reported when code uses dlopen and links against pthread
+
+(carried over)
+361504 dlopen()/dlclose() and shared object usage check [wishlist]
+
+(carried over)
+361810 valgrind duplicate stdin after fork
+
+(carried over)
+364279 False "Uninitialized" on atomic_compare_exchange
+
+(carried over)
+366035 valgrind misses buffer overflow, segfaults in malloc in localtime
+
+(carried over)
+366817 VALGRIND_MEMPOOL_CHANGE has a performance bug
+
+(carried over)
+368507 valgrind throws std::bad_alloc on memory allocations larger
+ than 34255421416 bytes
+ (increase usable address space post release, on trunk)
+
+=== Tools/DRD ==========================================================
+
+(carried over)
+356374 Assertion 'DRD_(g_threadinfo)[tid].pt_threadid
+ != INVALID_POSIX_THREADID' failed
+
+=== Tools/Helgrind =====================================================
+
+(carried over)
+358213 helgrind bar_bad testcase hangs
+ with new glibc pthread barrier implementation
+ [Also DRD is affected]
+
+(carried over)
+360557 helgrind reports data race which I can't see (involves rwlocks)
+ [probably a legit bug]
+
+(carried over)
+363740 Possible data race in vgPlain_amd64_linux_REDIR_FOR_vgettimeofday
+
+=== Tools/SGCheck ======================================================
+
+=== Tools/Massif =======================================================
+
+=== Tools/Cachegrind ===================================================
+
+=== Tools/Callgrind ====================================================
+
+(carried over)
+356675 callgrind test apk in android 5.0.2
+ [Unclear what this is. Might also be ARM or Android specific]
+
+=== Tools/Lackey =======================================================
+
+=== other/x86 ==========================================================
+
+=== other/mips =========================================================
+
+=== other/ppc ==========================================================
+
+365208 valgrind stuck after redirecting "memcpy"
+
+=== other/arm ==========================================================
+
+(carried over)
+364533 Process terminating with default action of signal 4 (SIGILL): dumping
+ core, : at 0x4000E7C: ??? (in /lib/ld-uClibc.so.0)
+
+(carried over)
+368529 Android arm target link error, missing atexit and pthread_atfork
+ (should take patch)
+
+=== other/arm64 ========================================================
+
+=== other/s390 =========================================================
+
+=== other/tilegx =======================================================
+
+=== other/Android ======================================================
+
+=== other/OS X =========================================================
+
+(carried over)
+351855 Possible false positive on OS X with setlocale
+
+(carried over)
+352384 mmap-FIXED failed in UME (load_segment2)
+
+(carried over)
+352567 Assertion tres.status == VexTransOK failed in m_translate.c
+ vgPlain_translate
+
+(carried over)
+353470 memcheck/tests/execve2 fails on OS X 10.11
+
+(carried over)
+353471 memcheck/tests/x86/xor-undef-x86 fails on OS X 10.11
+
+(carried over)
+354428 Bad report memory leak in OS X 10.11
+ == 258140 [still open]
+
+(carried over)
+354809 Error message for unsupported platform is unhelpful
+
+(carried over)
+356122 Apparent infinite loop calling GLib g_get_user_special_dir() function
+
+(carried over)
+359264 Memcheck shows 2,064 bytes possibly lost and 20,036 suppressed bytes
+ in simplistic program on OS X El Capitan
+
+(carried over)
+363123 SIGSEGV on Mac OS with very simple threaded code
+ == 349128 [still open]
+
+(carried over)
+365327 Support macOS Sierra (10.12)
+
+(carried over)
+366131 Illegal opcode in OS X 11.0 when using function getpwuid()
+
+=== other/Win32 ========================================================
+
+=== GDB server =========================================================
+
+351792 vgdb doesn't support remote file transfers
+356174 Enhance the embedded gdbserver to allow LLDB to use it
+
+=== Output =============================================================
+
+351857 confusing error message about valid command line option
+352395 Please provide SVN revision info in --version
+358569 Unhandled instructions cause creation of "orphan" stack traces
+ in XML output
+
+=== MPI ================================================================
+
+=== Documentation ======================================================
+
+=== Uncategorised/run ==================================================
+
+(carried over)
+356457 valgrind: m_mallocfree.c:2042 (vgPlain_arena_free):
+ Assertion 'blockSane(a, b)' failed.
+ [Possible V memory corruption?]
+
+(carried over)
+359249 valgrind unable to load 64-bit linux executable
+ linked with -mcmodel=medium
+
+(carried over)
+362223 valgrind: m_commandline.c:79 (read_dot_valgrindrc):
+ Assertion 'n >= 0 && n <= stat_buf.size+1' failed.
+
+(carried over)
+362680 --error-exitcode not honored when file descriptor leaks are found
+
+=== Uncategorised/build ================================================
+
+(carried over)
+358697 valgrind.h: Some code remains even when defining NVALGRIND
+ (we should fix this)
+
+(carried over)
+359202 Add musl libc configure/compile
+
+(carried over)
+359920 Configure fails with relative DESTDIR
+
+(carried over)
+362033 undeclared identifier build failures for getpid(), usleep(),
+ and getuid() [Valkyrie]
+
+(carried over)
+366345 Dirty compile from m_libcbase.c and vgdb-invoker-ptrace.c
+
+=== Intel Compiler problems ============================================
+
+(carried over)
+357010 drd regression tests fail to compile with Intel compiler
+
+(carried over)
+357011 Memcheck regression tests do not generate expected frame numbers
+ if compiled with intel compiler
+
+(carried over)
+357012 Memcheck regression tests do not match expected results
+ if compiled with intel compiler
+
+(carried over)
+357014 Helgrind regression tests do not match expected results
+ if compiled with intel compiler
+
+========================================================================
+========================================================================
+========================================================================
+========================================================================
+========================================================================
+
+Thu 15 Sep 12:55:21 CEST 2016
+
+368863 WARNING: unhandled arm64-linux syscall: 100
+368864 WARNING: unhandled arm64-linux syscall: 262
+368865 WARNING: unhandled arm64-linux syscall: 272
+368866 WARNING: unhandled arm64-linux syscall: 238
+368868 disInstr(arm64): unhandled instruction 0xD53BE000 = cntfrq_el0 (ARMv8)
+ (should fix this for 3.12.1)
+368873 Please add FreeBSD to supported OS list
+368913 WARNING: unhandled arm64-linux syscall: 117
+368914 WARNING: unhandled arm64-linux syscall: 142
+368916 WARNING: unhandled arm64-linux syscall: 234
+368917 WARNING: unhandled arm64-linux syscall: 218
+368918 WARNING: unhandled arm64-linux syscall: 127
+368919 WARNING: unhandled arm64-linux syscall: 274
+368920 WARNING: unhandled arm64-linux syscall: 275
+368921 WARNING: unhandled arm64-linux syscall: 162
+368922 WARNING: unhandled arm64-linux syscall: 161
+368923 WARNING: unhandled arm64-linux syscall: 268
+368924 WARNING: unhandled arm64-linux syscall: 84
+368925 WARNING: unhandled arm64-linux syscall: 130
+368926 WARNING: unhandled arm64-linux syscall: 97
+368960 WARNING: unhandled amd64-linux syscall: 163
+369026 WARNING: unhandled amd64-linux syscall: 169
+369027 WARNING: unhandled amd64-linux syscall: 216 (remap_file_pages)
+369028 WARNING: unhandled amd64-linux syscall: 314 (sched_setattr)
+369029 WARNING: unhandled amd64-linux syscall: 315 (sched_getattr)
+369030 WARNING: unhandled amd64-linux syscall: 171 (setdomainname)
+369031 WARNING: unhandled amd64-linux syscall: 308 (setns)
+369032 WARNING: unhandled amd64-linux syscall: 205 (set_thread_area)
+369033 WARNING: unhandled amd64-linux syscall: 139 (sysfs)
+369034 WARNING: unhandled amd64-linux syscall: 136 (ustat)
+369053 AMD64 fma4 instructions missing 256 bit support
+
+369409 null pointer dereference in vgPlain_do_syscall
+ possibly a dup of (fixed) 353370
+
+369456 callgrind_control failed to find an active callgrind run.
+ OSX specific
+
+369459 valgrind on arm64 violates the ARMv8 spec (ldxr/stxr)
+
+369509 ARMv8.1 LSE instructions are not supported
+369723 __builtin_longjmp not supported in clang/llvm on Android arm64 target
+ Has patch
+
+369854 Valgrind reports an Invalid Read in __intel_new_memcpy
+ Should be handled by --partial-loads-ok=yes
+
+370028 Reduce the number of compiler warnings on MIPS platforms
+370635 arm64 missing syscall getcpu
+ (should fix this for 3.12.1)
+
+371065 www: add CfP for FOSDEM 2017 in valgrind.org NEWS section
+
+Wed 19 Oct 17:07:42 CEST 2016
+
+371128 BCD add and subtract insns on Power BE in 32-bit mode do not work.
+371225 Fix order of timer_{gettime,getoverrun,settime} syscalls on arm64
+371227 Clean AArch64 syscall table
+371396 helgrind and drd pth_cond_destroy_busy testcase hang with
+ new glibc cond var implementation
+! 344139 x86 stack-seg overrides, needed by the Wine people
+371411 Unify fstat64/fstatat64 wrappers
+371439 Get coredump working on arm64
+371471 Valgrind complains about non legit memory leaks on placement new (C++)
+371491 handleAddrOverrides() is truncating the segment base address when
+ ASO prefix is used
+371503 disInstr(arm64): unhandled instruction 0xF89F0000
+371668 ppc64 clobbering of R2 is invalid.
+371770 Memleak trace back for overwritten or freed memory pointers
+371869 support '%' in symbol Z-encodin
+371916 execution tree xtree concept
+371966 No uninitialised values reported with PGI -Mstack_arrays
+371989 PCMPISTRM $0x72 validity bit propagation is imprecise
+372120 c++ demangler demangles symbols which are not c++
+372182 Support more languages/demangling styles than just C++ (and Rust)
+372185 Support of valgrind on ARMv8 with 32 bit executable
+372188 vex amd64->IR: 0x66 0xF 0x3A 0x62 0x4A 0x10 0x10 0x48 0x83 0xC2
+372195 Power PC, xxsel instruction is not always recognized.
+372358 vex amd64->IR: 0xC5 0xFA 0x7F 0x45 0x80 0xC5 0xFA 0x7F 0x4D 0x90
+372504 Hanging on exit_group
+372513 WARNING: unhandled ppc64be-linux syscall: 251
+372600 process loops forever when fatal signals are arriving quickly
+
+Mon 21 Nov 13:13:47 CET 2016
+
+
+========================================================================
+========================================================================
+
|
|
From: <sv...@va...> - 2016-11-21 12:18:15
|
Author: sewardj
Date: Mon Nov 21 12:18:08 2016
New Revision: 16149
Log:
Update.
Modified:
trunk/docs/internals/3_11_BUGSTATUS.txt
Modified: trunk/docs/internals/3_11_BUGSTATUS.txt
==============================================================================
--- trunk/docs/internals/3_11_BUGSTATUS.txt (original)
+++ trunk/docs/internals/3_11_BUGSTATUS.txt Mon Nov 21 12:18:08 2016
@@ -298,6 +298,8 @@
Wed 19 Oct 17:07:42 CEST 2016
+344139 x86 stack-seg overrides, needed by the Wine people
+
========================================================================
========================================================================
@@ -426,7 +428,10 @@
16080 -> 16089 mips: fix coredump creation in Valgrind
16081 -> 16090 Add another incompatibility between illumos and Solaris kernels.
-(tracked up to and including 16090/3282)
+16095 (B) -> 16099 (T) Build fixes for MacOS X 10.10.5.
+
+(tracked up to and including 16098/3282)
+3.12.0 final is 16098/3282.
========================================================================
========================================================================
|
|
From: <sv...@va...> - 2016-11-21 08:28:15
|
Author: mjw
Date: Mon Nov 21 08:28:07 2016
New Revision: 16148
Log:
Fix none/tests/pth_2sig.c build with (default) -std=gnu90.
error: ‘for’ loop initial declarations are only allowed in C99 mode
Modified:
trunk/none/tests/pth_2sig.c
Modified: trunk/none/tests/pth_2sig.c
==============================================================================
--- trunk/none/tests/pth_2sig.c (original)
+++ trunk/none/tests/pth_2sig.c Mon Nov 21 08:28:07 2016
@@ -14,7 +14,8 @@
int main(int argc, char **argv)
{
- for (int i = 0; i < 10; i++) {
+ int i;
+ for (i = 0; i < 10; i++) {
pthread_t slave;
if (pthread_create(&slave, 0, slavethread, 0)) {
perror("pthread_create");
@@ -26,7 +27,7 @@
switch (fork()) {
case 0: // child
sleep(2); // Should be enough to ensure (some) threads are created
- for (int i = 0; i < 20 && kill(pid, SIGTERM) == 0; i++)
+ for (i = 0; i < 20 && kill(pid, SIGTERM) == 0; i++)
;
exit(0);
case -1:
|
|
From: Ivo R. <iv...@iv...> - 2016-11-20 23:27:26
|
A gentle reminder to all Valgrind folks: we call for your participation at FOSDEM 2017, see below. The deadline for abstract submissions is in less than two weeks. Let us know if you have something in works and need slightly more time. See you all there, I. ----------------------------------- Valgrind developer room at FOSDEM 2017 (Brussels, Belgium, February 4th). FOSDEM is a free software event that offers open source communities a place to meet, share ideas and collaborate. It is renown for being highly developer-oriented and brings together 5000+ hackers from all over the world. It is held in the city of Brussels (Belgium). http://fosdem.org/ FOSDEM 2017 will take place during the weekend of Saturday, February 4th and Sunday February 5th 2017. On Saturday we will have a devroom for Valgrind. Devrooms are a place for development teams to meet, discuss, hack and publicly present the project's latest improvements and future directions. For the third time there will be a dedicated Valgrind devroom. We will have a whole day to hang out together as Valgrind community. Please join us, regardless of whether you are a Valgrind core hacker, Valgrind tool hacker, Valgrind user, Valgrind packager or hacker on a project that integrates, extends or complements Valgrind. Call For Participation We would like to organize a series of talks/discussions on various topics relevant to both core hackers, new developers, users, packagers and cross project functionality. Please do submit a talk proposal by Thursday December 1st 2016, so we can make a list of activities during the day. Some possible topics for talks/discussions are: - Recently added functional changes (for valgrind users). - State of the valgrind code base (core hackers). - Speeding up Memcheck by inlining of the fast cases of its helper function calls (core hackers). - Supporting Valgrind on new MacOS X versions (valgrind developers and users). - Status of current ports and possible future ports to other architectures (valgrind developers and users). - Valgrind and Wine (valgrind developers and users). - Helgrind - basic design, problems and opportunities (core and tools). - Get feedback on what what kinds of new functionality would be useful. Which tools users would like to see and/or which new features for the existing tools. (valgrind developers and users). - Modify memcheck to report the last leaked pointer to a block integrate "omega" as a memcheck option or omega as a separate tool. - Better support compiled and JITted code. allowing the JIT compiler to indicate the link between the JITted code and the source code. - Valgrind and transactional memory. - How to add simple features (adding syscalls for a platform or VEX instructions for an architecture port). (new core developers). - Making Valgrind really multi-threaded, parallelising Memcheck parallelising the rest of the framework, and tools (for core hackers). - Should we continue to support OS X? What about Valgrind on MS-Windows? Solaris? *BSD? (attracting new hackers). - Redo the JIT framework to reduce baseline overheads? (core hackers). - Discuss release/bugfixing strategy/policy (core hackers, packagers). - Packaging valgrind for distros, handling patches, suppressions, etc. (packagers). - Valgrind/GDB integration (cross project). - Valgrind vs the compiler. Compilers like GCC and clang now have "valgrind like" features, eg -fsanitize=address|thread|undefined. How does valgrind complement or improve on these features? - Eclipse and other visualisation tools for valgrind (cross project). - Practical examples of using Valgrind in (big) system automatic regression testing (users). Use the FOSDEM 'pentabarf' tool to submit your proposal: https://penta.fosdem.org/submission/FOSDEM17 - If necessary, create a Pentabarf account and activate it. Please reuse your account from previous years if you have already created it. - In the "Person" section, provide First name, Last name (in the "General" tab), Email (in the "Contact" tab) and Bio ("Abstract" field in the "Description" tab). - Submit a proposal by clicking on "Create event". - Important! Select the "Valgrind devroom" track (on the "General" tab). - Provide the title of your talk ("Event title" in the "General" tab). - Provide a description of the subject of the talk and the intended audience (in the "Abstract" field of the "Description" tab) - Provide a rough outline of the talk or goals of the session (a short list of bullet points covering topics that will be discussed) in the "Full description" field in the "Description" tab Julian, Philippe, Mark and Ivosh will review the proposals and organize the schedule for the day. Please feel free to suggest or discuss any ideas for the devroom on the Valgrind developer mailinglist before creating a proposal: valgrind-developers at lists.sourceforge.net Recording of talks As usually the FOSDEM organisers plan to have live streaming and recording fully working, both for remote/later viewing of talks, and so that people can watch streams in the hallways when rooms are full. This obviously requires speakers to consent to being recorded and streamed. If you plan to be a speaker, please understand that by doing so you implicitly give consent for your talk to be recorded and streamed. The recordings will be published under the same licence as all FOSDEM content (CC-BY). Important dates: Talk/Discussion Submission deadline: Thursday 1 Dec 2016 Devroom Schedule announcement: Thursday 15 Dec 2016 Devroom day: Saturday 4 Feb 2017 Hope to see you all at FOSDEM 2017 in the Valgrind devroom. Brussels (Belgium), Saturday February 4th 2017. https://fosdem.org/2017/schedule/track/valgrind/ |
Author: iraisr
Date: Sun Nov 20 15:06:08 2016
New Revision: 16147
Log:
Fix test none/tests/pth_2sig on Solaris.
When signal SIGINT was used, it got propagated to the parent shell
and therefore the regression test suite was terminated.
With SIGTERM only the parent exits, as is supposed.
Verified that this changed test case still reproduces the original problem
on Linux and Solaris, when r16140 is temporarily undone.
Follow up to r16140 and r16143 and BZ#372600.
Added:
trunk/none/tests/pth_2sig.stderr.exp-linux
- copied, changed from r16146, trunk/none/tests/pth_2sig.stderr.exp
trunk/none/tests/pth_2sig.stderr.exp-solaris
Removed:
trunk/none/tests/pth_2sig.stderr.exp
Modified:
trunk/none/tests/ (props changed)
trunk/none/tests/Makefile.am
trunk/none/tests/pth_2sig.c
trunk/none/tests/pth_2sig.vgtest
Modified: trunk/none/tests/Makefile.am
==============================================================================
--- trunk/none/tests/Makefile.am (original)
+++ trunk/none/tests/Makefile.am Sun Nov 20 15:06:08 2016
@@ -168,7 +168,7 @@
pth_rwlock.stderr.exp pth_rwlock.vgtest \
pth_stackalign.stderr.exp \
pth_stackalign.stdout.exp pth_stackalign.vgtest \
- pth_2sig.stderr.exp pth_2sig.vgtest \
+ pth_2sig.stderr.exp-linux pth_2sig.stderr.exp-solaris pth_2sig.vgtest \
pth_term_signal.stderr.exp pth_term_signal.vgtest \
rcrl.stderr.exp rcrl.stdout.exp rcrl.vgtest \
readline1.stderr.exp readline1.stdout.exp \
Modified: trunk/none/tests/pth_2sig.c
==============================================================================
--- trunk/none/tests/pth_2sig.c (original)
+++ trunk/none/tests/pth_2sig.c Sun Nov 20 15:06:08 2016
@@ -1,45 +1,41 @@
-#include <stdio.h>
-#include <unistd.h>
-#include <signal.h>
#include <pthread.h>
-#include <assert.h>
+#include <signal.h>
#include <stdlib.h>
-
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
#include <sys/wait.h>
-void *
-slavethread(void *arg)
+
+void *slavethread(void *arg)
{
- char c;
- while (1)
- (void)read(0, &c, 1);
+ while (1)
+ pause();
}
int main(int argc, char **argv)
{
- pthread_t slave;
- int i = 0;
- int pid = getpid();
+ for (int i = 0; i < 10; i++) {
+ pthread_t slave;
+ if (pthread_create(&slave, 0, slavethread, 0)) {
+ perror("pthread_create");
+ exit(2);
+ }
+ }
- for (i = 0; i < 10; i++)
- if (pthread_create(&slave, 0, &slavethread, 0))
- {
- perror("slave2");
- exit(2);
- }
- switch (fork())
- {
- case 0: // child
- sleep(2); // Should be enough to ensure (some) threads are created
- for (i = 0; i < 20 && kill(pid, 2) == 0; i++)
- ;
- exit(0);
- case -1:
- perror("fork");
- exit(4);
- }
+ pid_t pid = getpid();
+ switch (fork()) {
+ case 0: // child
+ sleep(2); // Should be enough to ensure (some) threads are created
+ for (int i = 0; i < 20 && kill(pid, SIGTERM) == 0; i++)
+ ;
+ exit(0);
+ case -1:
+ perror("fork");
+ exit(4);
+ }
- while (rand() >= 0)
- i++;
- fprintf(stderr, "strange, this program is supposed to be killed !!!!\n");
+ while (1)
+ pause();
+ fprintf(stderr, "strange, this program is supposed to be killed!\n");
return 1;
}
Removed: trunk/none/tests/pth_2sig.stderr.exp
==============================================================================
(empty)
Copied: trunk/none/tests/pth_2sig.stderr.exp-linux (from r16146, trunk/none/tests/pth_2sig.stderr.exp)
==============================================================================
--- trunk/none/tests/pth_2sig.stderr.exp (original)
+++ trunk/none/tests/pth_2sig.stderr.exp-linux Sun Nov 20 15:06:08 2016
@@ -0,0 +1 @@
+Terminated
Added: trunk/none/tests/pth_2sig.stderr.exp-solaris
==============================================================================
(empty)
Modified: trunk/none/tests/pth_2sig.vgtest
==============================================================================
--- trunk/none/tests/pth_2sig.vgtest (original)
+++ trunk/none/tests/pth_2sig.vgtest Sun Nov 20 15:06:08 2016
@@ -1,5 +1,2 @@
-# Disable this test on Solaris for now until it is investigated
-# why it messes badly with the regression test suite.
-prereq: (! ../../tests/os_test solaris)
prog: pth_2sig
vgopts: -q
|
Author: philippe
Date: Sun Nov 20 11:41:25 2016
New Revision: 16146
Log:
xtree: some documentation and --help-debug fine tuning
Modified:
trunk/NEWS
trunk/coregrind/m_main.c
trunk/helgrind/docs/hg-manual.xml
trunk/massif/docs/ms-manual.xml
trunk/memcheck/docs/mc-manual.xml
trunk/none/tests/cmdline2.stdout.exp
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Sun Nov 20 11:41:25 2016
@@ -12,19 +12,19 @@
10.10 and AMD64/MacOSX 10.10. There is also preliminary support for
X86/MacOSX 10.11/12, AMD64/MacOSX 10.11/12 and TILEGX/Linux.
-A significant change in 3.13 is the addition of the 'xtree' concept:
-An xtree is a tree of stacktraces with data associated to the stacktraces.
-This xtree is used by various tools (memcheck, helgrind, massif) to
-report the heap consumption of your program. The xtree reporting
-is controlled by the new options --xtree-memory=none|allocs|full and
---xtree-memory-file=<file>.
-An heap xtree memory profiling can also be produced on demand using
-a gdbserver monitor command.
-The xtree can be output in 2 formats: 'callgrind format'
-and 'massif format. The existing visualisers for these formats (e.g.
-callgrind_annotate, kcachegrind, ms_print) can be used to visualise
-and analyse these reports.
-For more details, read the user manual.
+* The 'xtree concept' was added in 3.13:
+ An xtree is a tree of stacktraces with data associated to the stacktraces.
+ This xtree is used by various tools (memcheck, helgrind, massif) to
+ report the heap consumption of your program. The xtree reporting
+ is controlled by the new options --xtree-memory=none|allocs|full and
+ --xtree-memory-file=<file>.
+ An heap xtree memory profiling can also be produced on demand using
+ the gdbserver monitor command 'xtmemory [<filename>]>'.
+ The xtree can be output in 2 formats: 'callgrind format'
+ and 'massif format. The existing visualisers for these formats (e.g.
+ callgrind_annotate, kcachegrind, ms_print) can be used to visualise
+ and analyse these reports.
+ For more details, read the user manual.
* ================== PLATFORM CHANGES =================
@@ -32,28 +32,18 @@
* Memcheck:
- - Support for --xtree-memory profiling.
-
- - A new monitor command 'xtmemory [<filename>]>' produces a
- heap usage profile report.
+ - Support for --xtree-memory and 'xtmemory [<filename>]>'.
* Massif:
- - Support for --xtree-memory profiling.
-
- - A new monitor command 'xtmemory [<filename>]>' produces a
- heap usage profile report.
+ - Support for --xtree-memory and 'xtmemory [<filename>]>'.
- For some workloads (typically, for big applications), Massif
memory consumption and CPU consumption decreases significantly.
* Helgrind:
- - Support for --xtree-memory profiling.
-
- - A new monitor command 'xtmemory [<filename>]>' produces a
- heap usage profile report.
-
+ - Support for --xtree-memory and 'xtmemory [<filename>]>'.
* ==================== OTHER CHANGES ====================
@@ -62,6 +52,7 @@
will append the inner guest stacktrace to the inner host stacktrace.
This helps to investigate the errors reported by the outer, when they
are caused by the inner guest program (such as an inner regtest).
+ See README_DEVELOPERS for more info.
* ==================== FIXED BUGS ====================
Modified: trunk/coregrind/m_main.c
==============================================================================
--- trunk/coregrind/m_main.c (original)
+++ trunk/coregrind/m_main.c Sun Nov 20 11:41:25 2016
@@ -294,6 +294,7 @@
"\n"
" debugging options for Valgrind tools that replace malloc:\n"
" --trace-malloc=no|yes show client malloc details? [no]\n"
+" --xtree-compress-strings=no|yes compress strings in xtree callgrind format [yes]\n"
"\n";
const HChar usage3[] =
Modified: trunk/helgrind/docs/hg-manual.xml
==============================================================================
--- trunk/helgrind/docs/hg-manual.xml (original)
+++ trunk/helgrind/docs/hg-manual.xml Sun Nov 20 11:41:25 2016
@@ -64,6 +64,11 @@
<varname>ANNOTATE_*</varname> macros defined
in <varname>helgrind.h</varname>.</para>
+<para>Helgrind also provides <xref linkend="manual-core.xtree"/> memory
+ profiling using the command line
+ option <computeroutput>--xtree-memory</computeroutput> and the monitor command
+ <computeroutput>xtmemory</computeroutput>.</para>
+
<para>Following those is a section containing
Modified: trunk/massif/docs/ms-manual.xml
==============================================================================
--- trunk/massif/docs/ms-manual.xml (original)
+++ trunk/massif/docs/ms-manual.xml Sun Nov 20 11:41:25 2016
@@ -46,6 +46,11 @@
which parts of your program are responsible for allocating the heap memory.
</para>
+<para>Massif also provides <xref linkend="manual-core.xtree"/> memory
+ profiling using the command line
+ option <computeroutput>--xtree-memory</computeroutput> and the monitor command
+ <computeroutput>xtmemory</computeroutput>.</para>
+
</sect1>
Modified: trunk/memcheck/docs/mc-manual.xml
==============================================================================
--- trunk/memcheck/docs/mc-manual.xml (original)
+++ trunk/memcheck/docs/mc-manual.xml Sun Nov 20 11:41:25 2016
@@ -57,8 +57,12 @@
<para>Problems like these can be difficult to find by other means,
often remaining undetected for long periods, then causing occasional,
-difficult-to-diagnose crashes.</para>
+ difficult-to-diagnose crashes.</para>
+<para>Memcheck also provides <xref linkend="manual-core.xtree"/> memory
+ profiling using the command line
+ option <computeroutput>--xtree-memory</computeroutput> and the monitor command
+ <computeroutput>xtmemory</computeroutput>.</para>
</sect1>
@@ -1040,6 +1044,13 @@
and/or by using a smaller value for the
option <varname>--num-callers</varname>.
</para>
+
+ <para>If you want to use
+ <computeroutput>--xtree-memory=full</computeroutput> memory profiling
+ (see <xref linkend="manual-core.xtree"/> ), then you cannot
+ specify <varname>--keep-stacktraces=free</varname>
+ or <varname>--keep-stacktraces=none</varname>.</para>
+
</listitem>
</varlistentry>
Modified: trunk/none/tests/cmdline2.stdout.exp
==============================================================================
--- trunk/none/tests/cmdline2.stdout.exp (original)
+++ trunk/none/tests/cmdline2.stdout.exp Sun Nov 20 11:41:25 2016
@@ -205,6 +205,7 @@
debugging options for Valgrind tools that replace malloc:
--trace-malloc=no|yes show client malloc details? [no]
+ --xtree-compress-strings=no|yes compress strings in xtree callgrind format [yes]
debugging options for Nulgrind:
(none)
|
Author: iraisr
Date: Sun Nov 20 05:19:02 2016
New Revision: 16145
Log:
Solaris: Add syscall wrapper for sigsendsys(108)
n-i-bz
Modified:
trunk/coregrind/m_syswrap/syswrap-solaris.c
trunk/include/vki/vki-scnums-solaris.h
trunk/include/vki/vki-solaris.h
trunk/memcheck/tests/solaris/scalar.c
trunk/memcheck/tests/solaris/scalar.stderr.exp
Modified: trunk/coregrind/m_syswrap/syswrap-solaris.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-solaris.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-solaris.c Sun Nov 20 05:19:02 2016
@@ -966,6 +966,7 @@
DECL_TEMPLATE(solaris, sys_fstatvfs);
DECL_TEMPLATE(solaris, sys_nfssys);
DECL_TEMPLATE(solaris, sys_waitid);
+DECL_TEMPLATE(solaris, sys_sigsendsys);
#if defined(SOLARIS_UTIMESYS_SYSCALL)
DECL_TEMPLATE(solaris, sys_utimesys);
#endif /* SOLARIS_UTIMESYS_SYSCALL */
@@ -5130,6 +5131,57 @@
POST_MEM_WRITE(ARG3, sizeof(vki_siginfo_t));
}
+PRE(sys_sigsendsys)
+{
+ /* int sigsendsys(procset_t *psp, int sig); */
+ PRINT("sys_sigsendsys( %#lx, %ld )", ARG1, SARG2);
+ PRE_REG_READ2(long, "sigsendsys", vki_procset_t *, psp, int, signal);
+ PRE_MEM_READ("sigsendsys(psp)", ARG1, sizeof(vki_procset_t));
+
+ if (!ML_(client_signal_OK)(ARG1)) {
+ SET_STATUS_Failure(VKI_EINVAL);
+ }
+ if (!ML_(safe_to_deref)((void *) ARG1, sizeof(vki_procset_t))) {
+ SET_STATUS_Failure(VKI_EFAULT);
+ }
+
+ /* Exit early if there are problems. */
+ if (FAILURE)
+ return;
+
+ vki_procset_t *psp = (vki_procset_t *) ARG1;
+ switch (psp->p_op) {
+ case VKI_POP_AND:
+ break;
+ default:
+ VG_(unimplemented)("Syswrap of the sigsendsys call with op %u.",
+ psp->p_op);
+ }
+
+ vki_id_t pid;
+ if ((psp->p_lidtype == VKI_P_PID) && (psp->p_ridtype == VKI_P_ALL)) {
+ pid = psp->p_lid;
+ } else if ((psp->p_lidtype == VKI_P_ALL) && (psp->p_ridtype == VKI_P_PID)) {
+ pid = psp->p_rid;
+ } else {
+ VG_(unimplemented)("Syswrap of the sigsendsys call with lidtype %u and"
+ "ridtype %u.", psp->p_lidtype, psp->p_ridtype);
+ }
+
+ if (VG_(clo_trace_signals))
+ VG_(message)(Vg_DebugMsg, "sigsendsys: sending signal to process %u\n",
+ pid);
+
+ /* Handle SIGKILL specially. */
+ if (ARG2 == VKI_SIGKILL && ML_(do_sigkill)(pid, -1)) {
+ SET_STATUS_Success(0);
+ return;
+ }
+
+ /* Check to see if this gave us a pending signal. */
+ *flags |= SfPollAfter;
+}
+
#if defined(SOLARIS_UTIMESYS_SYSCALL)
PRE(sys_utimesys)
{
@@ -10749,6 +10801,7 @@
SOLXY(__NR_fstatvfs, sys_fstatvfs), /* 104 */
SOLXY(__NR_nfssys, sys_nfssys), /* 106 */
SOLXY(__NR_waitid, sys_waitid), /* 107 */
+ SOLX_(__NR_sigsendsys, sys_sigsendsys), /* 108 */
#if defined(SOLARIS_UTIMESYS_SYSCALL)
SOLX_(__NR_utimesys, sys_utimesys), /* 110 */
#endif /* SOLARIS_UTIMESYS_SYSCALL */
Modified: trunk/include/vki/vki-scnums-solaris.h
==============================================================================
--- trunk/include/vki/vki-scnums-solaris.h (original)
+++ trunk/include/vki/vki-scnums-solaris.h Sun Nov 20 05:19:02 2016
@@ -157,7 +157,7 @@
#define __NR_nfssys SYS_nfssys
#define __NR_waitid SYS_waitid
#define __NR_waitsys SYS_waitsys /* = SYS_waitid (historical) */
-//#define __NR_sigsendsys SYS_sigsendsys
+#define __NR_sigsendsys SYS_sigsendsys
//#define __NR_hrtsys SYS_hrtsys
#if defined(SOLARIS_UTIMESYS_SYSCALL)
#define __NR_utimesys SYS_utimesys
Modified: trunk/include/vki/vki-solaris.h
==============================================================================
--- trunk/include/vki/vki-solaris.h (original)
+++ trunk/include/vki/vki-solaris.h Sun Nov 20 05:19:02 2016
@@ -814,6 +814,7 @@
#define VKI_P_PID P_PID
#define VKI_P_PGID P_PGID
#define VKI_P_ALL P_ALL
+#define VKI_POP_AND POP_AND
#define vki_procset_t procset_t
Modified: trunk/memcheck/tests/solaris/scalar.c
==============================================================================
--- trunk/memcheck/tests/solaris/scalar.c (original)
+++ trunk/memcheck/tests/solaris/scalar.c Sun Nov 20 05:19:02 2016
@@ -1934,7 +1934,8 @@
SY(SYS_waitid, x0 - 1, x0, x0, x0); FAIL;
/* SYS_sigsendsys 108 */
- /* XXX Missing wrapper. */
+ GO(SYS_sigsendsys, "2s 1m");
+ SY(SYS_sigsendsys, x0 - 1, x0); FAIL;
/* SYS_hrtsys 109 */
/* XXX Missing wrapper. */
Modified: trunk/memcheck/tests/solaris/scalar.stderr.exp
==============================================================================
--- trunk/memcheck/tests/solaris/scalar.stderr.exp (original)
+++ trunk/memcheck/tests/solaris/scalar.stderr.exp Sun Nov 20 05:19:02 2016
@@ -1851,6 +1851,19 @@
Address 0x........ is not stack'd, malloc'd or (recently) free'd
---------------------------------------------------------
+108: SYS_sigsendsys 2s 1m
+---------------------------------------------------------
+Syscall param sigsendsys(psp) contains uninitialised byte(s)
+ ...
+
+Syscall param sigsendsys(signal) contains uninitialised byte(s)
+ ...
+
+Syscall param sigsendsys(psp) points to unaddressable byte(s)
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
111: SYS_sigresend 3s 2m
---------------------------------------------------------
Syscall param sigresend(signal) contains uninitialised byte(s)
|
Author: iraisr
Date: Sun Nov 20 00:20:34 2016
New Revision: 16144
Log:
Solaris: Add syscall wrapper for sigsuspend(95)
n-i-bz
Modified:
trunk/coregrind/m_syswrap/syswrap-solaris.c
trunk/include/vki/vki-scnums-solaris.h
trunk/memcheck/tests/solaris/scalar.c
trunk/memcheck/tests/solaris/scalar.stderr.exp
Modified: trunk/coregrind/m_syswrap/syswrap-solaris.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-solaris.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-solaris.c Sun Nov 20 00:20:34 2016
@@ -956,6 +956,7 @@
DECL_TEMPLATE(solaris, sys_putmsg);
DECL_TEMPLATE(solaris, sys_lstat);
DECL_TEMPLATE(solaris, sys_sigprocmask);
+DECL_TEMPLATE(solaris, sys_sigsuspend);
DECL_TEMPLATE(solaris, sys_sigaction);
DECL_TEMPLATE(solaris, sys_sigpending);
DECL_TEMPLATE(solaris, sys_getsetcontext);
@@ -4807,6 +4808,26 @@
POST_MEM_WRITE(ARG3, sizeof(vki_sigset_t));
}
+PRE(sys_sigsuspend)
+{
+ *flags |= SfMayBlock;
+
+ /* int sigsuspend(const sigset_t *set); */
+ PRINT("sys_sigsuspend ( %#lx )", ARG1);
+ PRE_REG_READ1(long, "sigsuspend", vki_sigset_t *, set);
+ PRE_MEM_READ("sigsuspend(set)", ARG1, sizeof(vki_sigset_t));
+
+ /* Be safe. */
+ if (ARG1 && ML_(safe_to_deref((void *) ARG1, sizeof(vki_sigset_t)))) {
+ VG_(sigdelset)((vki_sigset_t *) ARG1, VG_SIGVGKILL);
+ /* We cannot mask VG_SIGVGKILL, as otherwise this thread would not
+ be killable by VG_(nuke_all_threads_except).
+ We thus silently ignore the user request to mask this signal.
+ Note that this is similar to what is done for e.g.
+ sigprocmask (see m_signals.c calculate_SKSS_from_SCSS). */
+ }
+}
+
PRE(sys_sigaction)
{
/* int sigaction(int signal, const struct sigaction *act,
@@ -10717,6 +10738,7 @@
GENX_(__NR_fchown, sys_fchown), /* 94 */
#endif /* SOLARIS_OLD_SYSCALLS */
SOLXY(__NR_sigprocmask, sys_sigprocmask), /* 95 */
+ SOLX_(__NR_sigsuspend, sys_sigsuspend), /* 96 */
GENXY(__NR_sigaltstack, sys_sigaltstack), /* 97 */
SOLXY(__NR_sigaction, sys_sigaction), /* 98 */
SOLXY(__NR_sigpending, sys_sigpending), /* 99 */
Modified: trunk/include/vki/vki-scnums-solaris.h
==============================================================================
--- trunk/include/vki/vki-scnums-solaris.h (original)
+++ trunk/include/vki/vki-scnums-solaris.h Sun Nov 20 00:20:34 2016
@@ -144,7 +144,7 @@
#define __NR_setgroups SYS_setgroups
#define __NR_getgroups SYS_getgroups
#define __NR_sigprocmask SYS_sigprocmask
-//#define __NR_sigsuspend SYS_sigsuspend
+#define __NR_sigsuspend SYS_sigsuspend
#define __NR_sigaltstack SYS_sigaltstack
#define __NR_sigaction SYS_sigaction
#define __NR_sigpending SYS_sigpending
Modified: trunk/memcheck/tests/solaris/scalar.c
==============================================================================
--- trunk/memcheck/tests/solaris/scalar.c (original)
+++ trunk/memcheck/tests/solaris/scalar.c Sun Nov 20 00:20:34 2016
@@ -1885,7 +1885,8 @@
SY(SYS_sigprocmask, x0, x0 + 1, x0 + 1); FAILx(EFAULT);
/* SYS_sigsuspend 96 */
- /* XXX Missing wrapper. */
+ GO(SYS_sigsuspend, "1s 1m");
+ SY(SYS_sigsuspend, x0 + 1); FAILx(EFAULT);
/* SYS_sigaltstack 97 */
GO(SYS_sigaltstack, "2s 2m");
Modified: trunk/memcheck/tests/solaris/scalar.stderr.exp
==============================================================================
--- trunk/memcheck/tests/solaris/scalar.stderr.exp (original)
+++ trunk/memcheck/tests/solaris/scalar.stderr.exp Sun Nov 20 00:20:34 2016
@@ -1623,6 +1623,16 @@
Address 0x........ is not stack'd, malloc'd or (recently) free'd
---------------------------------------------------------
+ 96: SYS_sigsuspend 1s 1m
+---------------------------------------------------------
+Syscall param sigsuspend(set) contains uninitialised byte(s)
+ ...
+
+Syscall param sigsuspend(set) points to unaddressable byte(s)
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
97: SYS_sigaltstack 2s 2m
---------------------------------------------------------
Syscall param sigaltstack(ss) contains uninitialised byte(s)
|
|
From: <sv...@va...> - 2016-11-19 23:28:25
|
Author: iraisr
Date: Sat Nov 19 23:28:18 2016
New Revision: 16143
Log:
Disable test none/tests/pth_2sig on Solaris for now until
it is investigated why it messes so badly with the regression test suite.
n-i-bz
Modified:
trunk/none/tests/pth_2sig.vgtest
Modified: trunk/none/tests/pth_2sig.vgtest
==============================================================================
--- trunk/none/tests/pth_2sig.vgtest (original)
+++ trunk/none/tests/pth_2sig.vgtest Sat Nov 19 23:28:18 2016
@@ -1,2 +1,5 @@
+# Disable this test on Solaris for now until it is investigated
+# why it messes badly with the regression test suite.
+prereq: (! ../../tests/os_test solaris)
prog: pth_2sig
vgopts: -q
|
|
From: <sv...@va...> - 2016-11-19 15:15:22
|
Author: iraisr
Date: Sat Nov 19 15:15:10 2016
New Revision: 16142
Log:
Fix the configure test for presense of __xpg[4,6] symbols
on Solaris so that only shared library is considered.
Previously a binary was checked which now started to produce
incorrect results with regards to vg_preload.
n-i-bz
Modified:
trunk/configure.ac
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Sat Nov 19 15:15:10 2016
@@ -2778,10 +2778,10 @@
AM_CONDITIONAL(SOLARIS_SUN_STUDIO_AS, test x$solaris_have_sun_studio_as = xyes)
# Solaris-specific check determining if symbols __xpg4 and __xpg6
-# are present in linked elfs when gcc is invoked with -std=gnu99.
+# are present in linked shared libraries when gcc is invoked with -std=gnu99.
# See solaris/vgpreload-solaris.mapfile for details.
-# gcc on Solaris instructs linker to include these symbols,
-# gcc on illumos does not.
+# gcc on older Solaris instructs linker to include these symbols,
+# gcc on illumos and newer Solaris does not.
#
# C-level symbol: none
# Automake-level symbol: SOLARIS_XPG_SYMBOLS_PRESENT
@@ -2789,34 +2789,21 @@
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -std=gnu99"
AC_MSG_CHECKING([if xpg symbols are present with -std=gnu99 (Solaris-specific)])
-AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#include <limits.h>
+temp_dir=$( /usr/bin/mktemp -d )
+cat <<_ACEOF >${temp_dir}/mylib.c
#include <stdio.h>
-#include <stdlib.h>
-
-int main(int argc, const char *argv[]) {
- char command[PATH_MAX + 50];
- snprintf(command, sizeof(command), "nm %s | egrep '__xpg[4,6]'", argv[0]);
-
- FILE *output = popen(command, "r");
- if (output == NULL) return -1;
-
- char buf[100];
- if (fgets(buf, sizeof(buf), output) != NULL) {
- pclose(output);
- return 0;
- } else {
- pclose(output);
- return 1;
- }
-}
-]])], [
-solaris_xpg_symbols_present=yes
-AC_MSG_RESULT([yes])
-], [
-solaris_xpg_symbols_present=no
-AC_MSG_RESULT([no])
-])
+int myfunc(void) { printf("LaPutyka\n"); }
+_ACEOF
+${CC} ${CFLAGS} -fpic -shared -o ${temp_dir}/mylib.so ${temp_dir}/mylib.c
+xpg_present=$( /usr/bin/nm ${temp_dir}/mylib.so | ${EGREP} '(__xpg4|__xpg6)' )
+if test "x${xpg_present}" = "x" ; then
+ solaris_xpg_symbols_present=no
+ AC_MSG_RESULT([no])
+else
+ solaris_xpg_symbols_present=yes
+ AC_MSG_RESULT([yes])
+fi
+rm -rf ${temp_dir}
AM_CONDITIONAL(SOLARIS_XPG_SYMBOLS_PRESENT, test x$solaris_xpg_symbols_present = xyes)
CFLAGS="$save_CFLAGS"
|
Author: philippe
Date: Sat Nov 19 14:54:44 2016
New Revision: 16141
Log:
Fix 372504 Hanging on exit_group
Note that it is unclear if the PRE syscall for rt_sigsuspend
is properly setting up a temporary mask in the thread state
tmp_sig_mask: if an handler is called while a thread is
calling sigsuspend, the mask during the handler run must be
the temporary mask set by sigsuspend.
It is not clear if/where the valgrind sigframe builder/handler
sets the tmp_sig_mask to the value as expected by the user
(i.e. the value of the temporary mask which was given to
the sigsuspend syscall)
Added:
trunk/none/tests/sigsusp.c
trunk/none/tests/sigsusp.stderr.exp
trunk/none/tests/sigsusp.vgtest
Modified:
trunk/NEWS
trunk/coregrind/m_syswrap/syswrap-linux.c
trunk/coregrind/pub_core_threadstate.h
trunk/none/tests/Makefile.am
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Sat Nov 19 14:54:44 2016
@@ -80,9 +80,9 @@
371869 support '%' in symbol Z-encoding
371916 execution tree xtree concept
372120 c++ demangler demangles symbols which are not c++
+372504 Hanging on exit_group
372600 process loops forever when fatal signals are arriving quickly
-
Release 3.12.0 (20 October 2016)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Modified: trunk/coregrind/m_syswrap/syswrap-linux.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-linux.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-linux.c Sat Nov 19 14:54:44 2016
@@ -3558,6 +3558,12 @@
PRE_REG_READ2(int, "rt_sigsuspend", vki_sigset_t *, mask, vki_size_t, size)
if (ARG1 != (Addr)NULL) {
PRE_MEM_READ( "rt_sigsuspend(mask)", ARG1, sizeof(vki_sigset_t) );
+ VG_(sigdelset)((vki_sigset_t*)ARG1, VG_SIGVGKILL);
+ /* We cannot mask VG_SIGVGKILL, as otherwise this thread would not
+ be killable by VG_(nuke_all_threads_except).
+ We thus silently ignore the user request to mask this signal.
+ Note that this is similar to what is done for e.g.
+ sigprocmask (see m_signals.c calculate_SKSS_from_SCSS). */
}
}
Modified: trunk/coregrind/pub_core_threadstate.h
==============================================================================
--- trunk/coregrind/pub_core_threadstate.h (original)
+++ trunk/coregrind/pub_core_threadstate.h Sat Nov 19 14:54:44 2016
@@ -354,7 +354,9 @@
different values is during the execution of a sigsuspend, where
tmp_sig_mask is the temporary mask which sigsuspend installs.
It is only consulted to compute the signal mask applied to a
- signal handler. */
+ signal handler.
+ PW Nov 2016 : it is not clear if and where this tmp_sig_mask
+ is set when an handler runs "inside" a sigsuspend. */
vki_sigset_t tmp_sig_mask;
/* A little signal queue for signals we can't get the kernel to
Modified: trunk/none/tests/Makefile.am
==============================================================================
--- trunk/none/tests/Makefile.am (original)
+++ trunk/none/tests/Makefile.am Sat Nov 19 14:54:44 2016
@@ -189,6 +189,7 @@
shortpush.stderr.exp shortpush.vgtest \
shorts.stderr.exp shorts.vgtest \
sigstackgrowth.stdout.exp sigstackgrowth.stderr.exp sigstackgrowth.vgtest \
+ sigsusp.stderr.exp sigsusp.vgtest \
stackgrowth.stdout.exp stackgrowth.stderr.exp stackgrowth.vgtest \
syscall-restart1.vgtest syscall-restart1.stdout.exp syscall-restart1.stderr.exp \
syscall-restart2.vgtest syscall-restart2.stdout.exp syscall-restart2.stderr.exp \
@@ -233,7 +234,7 @@
require-text-symbol \
res_search resolv \
rlimit_nofile selfrun sem semlimit sha1_test \
- shortpush shorts stackgrowth sigstackgrowth \
+ shortpush shorts stackgrowth sigstackgrowth sigsusp \
syscall-restart1 syscall-restart2 \
syslog \
system \
@@ -332,6 +333,7 @@
if VGCONF_OS_IS_SOLARIS
sha1_test_CFLAGS += -Du_int32_t=uint32_t
endif
+sigsusp_LDADD = -lpthread
thread_exits_LDADD = -lpthread
threaded_fork_LDADD = -lpthread
threadederrno_CFLAGS = $(AM_CFLAGS)
Added: trunk/none/tests/sigsusp.c
==============================================================================
--- trunk/none/tests/sigsusp.c (added)
+++ trunk/none/tests/sigsusp.c Sat Nov 19 14:54:44 2016
@@ -0,0 +1,24 @@
+#include <stdlib.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <signal.h>
+static void* t_fn(void* v)
+{
+ sigset_t mask;
+
+ sigfillset(&mask);
+ sigsuspend(&mask);
+ return NULL;
+}
+
+int main (int argc, char *argv[])
+{
+ pthread_t t1;
+
+ pthread_create(&t1, NULL, t_fn, NULL);
+
+ sleep(1); // Should be enough to have the thread in sigsuspend
+ // printf("dying\n");
+ exit(0);
+}
Added: trunk/none/tests/sigsusp.stderr.exp
==============================================================================
(empty)
Added: trunk/none/tests/sigsusp.vgtest
==============================================================================
--- trunk/none/tests/sigsusp.vgtest (added)
+++ trunk/none/tests/sigsusp.vgtest Sat Nov 19 14:54:44 2016
@@ -0,0 +1,2 @@
+prog: sigsusp
+vgopts: -q
|
Author: philippe
Date: Sat Nov 19 13:51:41 2016
New Revision: 16140
Log:
Fix Bug 372600 - process loops forever when fatal signals are arriving quickly
Added:
trunk/none/tests/pth_2sig.c
trunk/none/tests/pth_2sig.stderr.exp
trunk/none/tests/pth_2sig.vgtest
Modified:
trunk/NEWS
trunk/coregrind/m_signals.c
trunk/none/tests/Makefile.am
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Sat Nov 19 13:51:41 2016
@@ -80,7 +80,7 @@
371869 support '%' in symbol Z-encoding
371916 execution tree xtree concept
372120 c++ demangler demangles symbols which are not c++
-
+372600 process loops forever when fatal signals are arriving quickly
Release 3.12.0 (20 October 2016)
Modified: trunk/coregrind/m_signals.c
==============================================================================
--- trunk/coregrind/m_signals.c (original)
+++ trunk/coregrind/m_signals.c Sat Nov 19 13:51:41 2016
@@ -2430,8 +2430,14 @@
info->si_code = sanitize_si_code(info->si_code);
if (VG_(clo_trace_signals))
- VG_(dmsg)("async signal handler: signal=%d, tid=%u, si_code=%d\n",
- sigNo, tid, info->si_code);
+ VG_(dmsg)("async signal handler: signal=%d, tid=%u, si_code=%d, "
+ "exitreason %s\n",
+ sigNo, tid, info->si_code,
+ VG_(name_of_VgSchedReturnCode)(tst->exitreason));
+
+ /* */
+ if (tst->exitreason == VgSrc_FatalSig)
+ resume_scheduler(tid);
/* Update thread state properly. The signal can only have been
delivered whilst we were in
@@ -2479,8 +2485,16 @@
);
/* (2) */
- /* Set up the thread's state to deliver a signal */
- if (!is_sig_ign(info, tid))
+ /* Set up the thread's state to deliver a signal.
+ However, if exitreason is VgSrc_FatalSig, then thread tid was
+ taken out of a syscall by VG_(nuke_all_threads_except).
+ But after the emission of VKI_SIGKILL, another (fatal) async
+ signal might be sent. In such a case, we must not handle this
+ signal, as the thread is supposed to die first.
+ => resume the scheduler for such a thread, so that the scheduler
+ can let the thread die. */
+ if (tst->exitreason != VgSrc_FatalSig
+ && !is_sig_ign(info, tid))
deliver_signal(tid, info, uc);
/* It's crucial that (1) and (2) happen in the order (1) then (2)
@@ -2946,6 +2960,20 @@
ThreadState *tst = VG_(get_ThreadState)(tid);
vki_sigset_t saved_mask;
+ if (tst->exitreason == VgSrc_FatalSig) {
+ /* This task has been requested to die due to a fatal signal
+ received by the process. So, we cannot poll new signals,
+ as we are supposed to die asap. If we would poll and deliver
+ a new (maybe fatal) signal, this could cause a deadlock, as
+ this thread would believe it has to terminate the other threads
+ and wait for them to die, while we already have a thread doing
+ that. */
+ if (VG_(clo_trace_signals))
+ VG_(dmsg)("poll_signals: not polling as thread %u is exitreason %s\n",
+ tid, VG_(name_of_VgSchedReturnCode)(tst->exitreason));
+ return;
+ }
+
/* look for all the signals this thread isn't blocking */
/* pollset = ~tst->sig_mask */
VG_(sigcomplementset)( &pollset, &tst->sig_mask );
@@ -2961,15 +2989,18 @@
/* If there was nothing queued, ask the kernel for a pending signal */
if (sip == NULL && VG_(sigtimedwait_zero)(&pollset, &si) > 0) {
if (VG_(clo_trace_signals))
- VG_(dmsg)("poll_signals: got signal %d for thread %u\n",
- si.si_signo, tid);
+ VG_(dmsg)("poll_signals: got signal %d for thread %u exitreason %s\n",
+ si.si_signo, tid,
+ VG_(name_of_VgSchedReturnCode)(tst->exitreason));
sip = &si;
}
if (sip != NULL) {
/* OK, something to do; deliver it */
if (VG_(clo_trace_signals))
- VG_(dmsg)("Polling found signal %d for tid %u\n", sip->si_signo, tid);
+ VG_(dmsg)("Polling found signal %d for tid %u exitreason %s\n",
+ sip->si_signo, tid,
+ VG_(name_of_VgSchedReturnCode)(tst->exitreason));
if (!is_sig_ign(sip, tid))
deliver_signal(tid, sip, NULL);
else if (VG_(clo_trace_signals))
@@ -3073,7 +3104,8 @@
}
if (VG_(clo_trace_signals))
- VG_(dmsg)("Max kernel-supported signal is %d\n", VG_(max_signal));
+ VG_(dmsg)("Max kernel-supported signal is %d, VG_SIGVGKILL is %d\n",
+ VG_(max_signal), VG_SIGVGKILL);
/* Our private internal signals are treated as ignored */
scss.scss_per_sig[VG_SIGVGKILL].scss_handler = VKI_SIG_IGN;
Modified: trunk/none/tests/Makefile.am
==============================================================================
--- trunk/none/tests/Makefile.am (original)
+++ trunk/none/tests/Makefile.am Sat Nov 19 13:51:41 2016
@@ -168,6 +168,7 @@
pth_rwlock.stderr.exp pth_rwlock.vgtest \
pth_stackalign.stderr.exp \
pth_stackalign.stdout.exp pth_stackalign.vgtest \
+ pth_2sig.stderr.exp pth_2sig.vgtest \
pth_term_signal.stderr.exp pth_term_signal.vgtest \
rcrl.stderr.exp rcrl.stdout.exp rcrl.vgtest \
readline1.stderr.exp readline1.stdout.exp \
@@ -227,7 +228,7 @@
pselect_sigmask_null \
pth_atfork1 pth_blockedsig pth_cancel1 pth_cancel2 pth_cvsimple \
pth_empty pth_exit pth_exit2 pth_mutexspeed pth_once pth_rwlock \
- pth_stackalign pth_term_signal\
+ pth_stackalign pth_2sig pth_term_signal\
rcrl readline1 \
require-text-symbol \
res_search resolv \
@@ -318,6 +319,7 @@
pth_rwlock_CFLAGS += --std=c99
endif
pth_stackalign_LDADD = -lpthread
+pth_2sig_LDADD = -lpthread
pth_term_signal_LDADD = -lpthread
res_search_LDADD = -lresolv -lpthread
resolv_CFLAGS = $(AM_CFLAGS)
Added: trunk/none/tests/pth_2sig.c
==============================================================================
--- trunk/none/tests/pth_2sig.c (added)
+++ trunk/none/tests/pth_2sig.c Sat Nov 19 13:51:41 2016
@@ -0,0 +1,45 @@
+#include <stdio.h>
+#include <unistd.h>
+#include <signal.h>
+#include <pthread.h>
+#include <assert.h>
+#include <stdlib.h>
+
+#include <sys/wait.h>
+void *
+slavethread(void *arg)
+{
+ char c;
+ while (1)
+ (void)read(0, &c, 1);
+}
+
+int main(int argc, char **argv)
+{
+ pthread_t slave;
+ int i = 0;
+ int pid = getpid();
+
+ for (i = 0; i < 10; i++)
+ if (pthread_create(&slave, 0, &slavethread, 0))
+ {
+ perror("slave2");
+ exit(2);
+ }
+ switch (fork())
+ {
+ case 0: // child
+ sleep(2); // Should be enough to ensure (some) threads are created
+ for (i = 0; i < 20 && kill(pid, 2) == 0; i++)
+ ;
+ exit(0);
+ case -1:
+ perror("fork");
+ exit(4);
+ }
+
+ while (rand() >= 0)
+ i++;
+ fprintf(stderr, "strange, this program is supposed to be killed !!!!\n");
+ return 1;
+}
Added: trunk/none/tests/pth_2sig.stderr.exp
==============================================================================
(empty)
Added: trunk/none/tests/pth_2sig.vgtest
==============================================================================
--- trunk/none/tests/pth_2sig.vgtest (added)
+++ trunk/none/tests/pth_2sig.vgtest Sat Nov 19 13:51:41 2016
@@ -0,0 +1,2 @@
+prog: pth_2sig
+vgopts: -q
|
Author: philippe
Date: Sat Nov 19 13:24:13 2016
New Revision: 16139
Log:
Improve the outer/inner setup: have the outer reporting the inner guest stacktrace
Note: the outer now unconditionally report the inner guest stacktrace.
If that would be a problem, we might add a sim-hint no-inner-guest-stacktrace
to optionally disable such outer behaviour.
Modified:
trunk/NEWS
trunk/README_DEVELOPERS
trunk/coregrind/m_execontext.c
trunk/coregrind/m_libcassert.c
trunk/coregrind/m_scheduler/scheduler.c
trunk/coregrind/m_stacks.c
trunk/coregrind/m_threadstate.c
trunk/coregrind/pub_core_threadstate.h
trunk/include/valgrind.h
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Sat Nov 19 13:24:13 2016
@@ -58,6 +58,11 @@
* ==================== OTHER CHANGES ====================
+* For Valgrind developers: in an outer/inner setup, the outer Valgrind
+ will append the inner guest stacktrace to the inner host stacktrace.
+ This helps to investigate the errors reported by the outer, when they
+ are caused by the inner guest program (such as an inner regtest).
+
* ==================== FIXED BUGS ====================
The following bugs have been fixed or resolved. Note that "n-i-bz"
Modified: trunk/README_DEVELOPERS
==============================================================================
--- trunk/README_DEVELOPERS (original)
+++ trunk/README_DEVELOPERS Sat Nov 19 13:24:13 2016
@@ -233,6 +233,45 @@
The file tests/outer_inner.supp contains suppressions for
the irrelevant or benign errors found in the inner.
+An regression test running in the inner (e.g. memcheck/tests/badrw) will
+cause the inner to report an error, which is expected and checked
+as usual when running the regtests in an outer/inner setup.
+However, the outer will often also observe an error, e.g. a jump
+using uninitialised data, or a read/write outside the bounds of a heap
+block. When the outer reports such an error, it will output the
+inner host stacktrace. To this stacktrace, it will append the
+stacktrace of the inner guest program. For example, this is an error
+reported by the outer when the inner runs the badrw regtest:
+ ==8119== Invalid read of size 2
+ ==8119== at 0x7F2EFD7AF: ???
+ ==8119== by 0x7F2C82EAF: ???
+ ==8119== by 0x7F180867F: ???
+ ==8119== by 0x40051D: main (badrw.c:5)
+ ==8119== by 0x7F180867F: ???
+ ==8119== by 0x1BFF: ???
+ ==8119== by 0x3803B7F0: _______VVVVVVVV_appended_inner_guest_stack_VVVVVVVV_______ (m_execontext.c:332)
+ ==8119== by 0x40055C: main (badrw.c:22)
+ ==8119== Address 0x55cd03c is 4 bytes before a block of size 16 alloc'd
+ ==8119== at 0x2804E26D: vgPlain_arena_malloc (m_mallocfree.c:1914)
+ ==8119== by 0x2800BAB4: vgMemCheck_new_block (mc_malloc_wrappers.c:368)
+ ==8119== by 0x2800BC87: vgMemCheck_malloc (mc_malloc_wrappers.c:403)
+ ==8119== by 0x28097EAE: do_client_request (scheduler.c:1861)
+ ==8119== by 0x28097EAE: vgPlain_scheduler (scheduler.c:1425)
+ ==8119== by 0x280A7237: thread_wrapper (syswrap-linux.c:103)
+ ==8119== by 0x280A7237: run_a_thread_NORETURN (syswrap-linux.c:156)
+ ==8119== by 0x3803B7F0: _______VVVVVVVV_appended_inner_guest_stack_VVVVVVVV_______ (m_execontext.c:332)
+ ==8119== by 0x4C294C4: malloc (vg_replace_malloc.c:298)
+ ==8119== by 0x40051D: main (badrw.c:5)
+In the above, the first stacktrace starts with the inner host stacktrace,
+which in this case is some JITted code. Such code sometimes contains IPs
+that points in the inner guest code (0x40051D: main (badrw.c:5)).
+After the separator, we have the inner guest stacktrace.
+The second stacktrace gives the stacktrace where the heap block that was
+overrun was allocated. We see it was allocated by the inner valgrind
+in the client arena (first part of the stacktrace). The second part is
+the guest stacktrace that did the allocation.
+
+
(C) Performance tests in an outer/inner setup:
To run all the performance tests with an outer cachegrind, do :
Modified: trunk/coregrind/m_execontext.c
==============================================================================
--- trunk/coregrind/m_execontext.c (original)
+++ trunk/coregrind/m_execontext.c Sat Nov 19 13:24:13 2016
@@ -326,6 +326,12 @@
ec_htab_size_idx++;
}
+/* Used by the outer as a marker to separate the frames of the inner valgrind
+ from the frames of the inner guest frames. */
+static void _______VVVVVVVV_appended_inner_guest_stack_VVVVVVVV_______ (void)
+{
+}
+
/* Do the first part of getting a stack trace: actually unwind the
stack, and hand the results off to the duplicate-trace-finder
(_wrk2). */
@@ -350,6 +356,38 @@
NULL/*array to dump SP values in*/,
NULL/*array to dump FP values in*/,
first_ip_delta );
+ if (VG_(inner_threads) != NULL
+ && n_ips + 1 < VG_(clo_backtrace_size)) {
+ /* An inner V has informed us (the outer) of its thread array.
+ Append the inner guest stack trace, if we still have some
+ room in the ips array for the separator and (some) inner
+ guest IPs. */
+ UInt inner_tid;
+
+ for (inner_tid = 1; inner_tid < VG_N_THREADS; inner_tid++) {
+ if (VG_(threads)[tid].os_state.lwpid
+ == VG_(inner_threads)[inner_tid].os_state.lwpid) {
+ ThreadState* save_outer_vg_threads = VG_(threads);
+ UInt n_ips_inner_guest;
+
+ /* Append the separator + the inner guest stack trace. */
+ ips[n_ips] = (Addr)
+ _______VVVVVVVV_appended_inner_guest_stack_VVVVVVVV_______;
+ n_ips++;
+ VG_(threads) = VG_(inner_threads);
+ n_ips_inner_guest
+ = VG_(get_StackTrace)( inner_tid,
+ ips + n_ips,
+ VG_(clo_backtrace_size) - n_ips,
+ NULL/*array to dump SP values in*/,
+ NULL/*array to dump FP values in*/,
+ first_ip_delta );
+ n_ips += n_ips_inner_guest;
+ VG_(threads) = save_outer_vg_threads;
+ break;
+ }
+ }
+ }
}
return record_ExeContext_wrk2 ( ips, n_ips );
Modified: trunk/coregrind/m_libcassert.c
==============================================================================
--- trunk/coregrind/m_libcassert.c (original)
+++ trunk/coregrind/m_libcassert.c Sat Nov 19 13:24:13 2016
@@ -317,6 +317,40 @@
exit_wrk (status, False);
}
+static void print_thread_state (Bool stack_usage,
+ const HChar* prefix, ThreadId i)
+{
+ VgStack *stack
+ = (VgStack*)VG_(threads)[i].os_state.valgrind_stack_base;
+
+ VG_(printf)("\n%sThread %d: status = %s (lwpid %d)\n", prefix, i,
+ VG_(name_of_ThreadStatus)(VG_(threads)[i].status),
+ VG_(threads)[i].os_state.lwpid);
+ if (VG_(threads)[i].status != VgTs_Empty)
+ VG_(get_and_pp_StackTrace)( i, BACKTRACE_DEPTH );
+ if (stack_usage && VG_(threads)[i].client_stack_highest_byte != 0 ) {
+ Addr start, end;
+
+ start = end = 0;
+ VG_(stack_limits)(VG_(get_SP)(i), &start, &end);
+ if (start != end)
+ VG_(printf)("%sclient stack range: [%p %p] client SP: %p\n",
+ prefix,
+ (void*)start, (void*)end, (void*)VG_(get_SP)(i));
+ else
+ VG_(printf)("%sclient stack range: ??????? client SP: %p\n",
+ prefix,
+ (void*)VG_(get_SP)(i));
+ }
+ if (stack_usage && stack != 0)
+ VG_(printf)
+ ("%svalgrind stack top usage: %lu of %lu\n",
+ prefix,
+ VG_(clo_valgrind_stacksize)
+ - VG_(am_get_VgStack_unused_szB) (stack,
+ VG_(clo_valgrind_stacksize)),
+ (SizeT) VG_(clo_valgrind_stacksize));
+}
// Print the scheduler status.
static void show_sched_status_wrk ( Bool host_stacktrace,
@@ -374,29 +408,24 @@
has exited, then valgrind_stack_base points to the stack base. */
if (VG_(threads)[i].status == VgTs_Empty
&& (!exited_threads || stack == 0)) continue;
- VG_(printf)("\nThread %d: status = %s (lwpid %d)\n", i,
- VG_(name_of_ThreadStatus)(VG_(threads)[i].status),
- VG_(threads)[i].os_state.lwpid);
- if (VG_(threads)[i].status != VgTs_Empty)
- VG_(get_and_pp_StackTrace)( i, BACKTRACE_DEPTH );
- if (stack_usage && VG_(threads)[i].client_stack_highest_byte != 0 ) {
- Addr start, end;
-
- start = end = 0;
- VG_(stack_limits)(VG_(threads)[i].client_stack_highest_byte,
- &start, &end);
- if (start != end)
- VG_(printf)("client stack range: [%p %p] client SP: %p\n",
- (void*)start, (void*)end, (void*)VG_(get_SP)(i));
- else
- VG_(printf)("client stack range: ???????\n");
+ print_thread_state(stack_usage, "", i);
+ if (VG_(inner_threads) != NULL) {
+ /* An inner V has informed us (the outer) of its thread array.
+ Report the inner guest stack trace. */
+ UInt inner_tid;
+
+ for (inner_tid = 1; inner_tid < VG_N_THREADS; inner_tid++) {
+ if (VG_(threads)[i].os_state.lwpid
+ == VG_(inner_threads)[inner_tid].os_state.lwpid) {
+ ThreadState* save_outer_vg_threads = VG_(threads);
+
+ VG_(threads) = VG_(inner_threads);
+ print_thread_state(stack_usage, "INNER ", inner_tid);
+ VG_(threads) = save_outer_vg_threads;
+ break;
+ }
+ }
}
- if (stack_usage && stack != 0)
- VG_(printf)("valgrind stack top usage: %lu of %lu\n",
- VG_(clo_valgrind_stacksize)
- - VG_(am_get_VgStack_unused_szB)
- (stack, VG_(clo_valgrind_stacksize)),
- (SizeT) VG_(clo_valgrind_stacksize));
}
}
VG_(printf)("\n");
Modified: trunk/coregrind/m_scheduler/scheduler.c
==============================================================================
--- trunk/coregrind/m_scheduler/scheduler.c (original)
+++ trunk/coregrind/m_scheduler/scheduler.c Sat Nov 19 13:24:13 2016
@@ -2007,6 +2007,15 @@
SET_CLREQ_RETVAL( tid, 0 ); /* return value is meaningless */
break;
+ case VG_USERREQ__INNER_THREADS:
+ if (VG_(clo_verbosity) > 2)
+ VG_(printf)( "client request: INNER_THREADS,"
+ " addr %p\n",
+ (void*)arg[1] );
+ VG_(inner_threads) = (ThreadState*)arg[1];
+ SET_CLREQ_RETVAL( tid, 0 ); /* return value is meaningless */
+ break;
+
case VG_USERREQ__COUNT_ERRORS:
SET_CLREQ_RETVAL( tid, VG_(get_n_errs_found)() );
break;
Modified: trunk/coregrind/m_stacks.c
==============================================================================
--- trunk/coregrind/m_stacks.c (original)
+++ trunk/coregrind/m_stacks.c Sat Nov 19 13:24:13 2016
@@ -37,6 +37,10 @@
#include "pub_core_options.h"
#include "pub_core_stacks.h"
#include "pub_core_tooliface.h"
+#include "pub_core_inner.h"
+#if defined(ENABLE_INNER_CLIENT_REQUEST)
+#include "pub_core_clreq.h"
+#endif
// For expensive debugging
#define EDEBUG(fmt, args...) //VG_(debugLog)(2, "stacks", fmt, ## args)
@@ -91,6 +95,8 @@
Addr start; // Lowest stack byte, included.
Addr end; // Highest stack byte, included.
struct _Stack *next;
+ UWord outer_id; /* For an inner valgrind, stack id registered in outer
+ valgrind. */
} Stack;
static Stack *stacks;
@@ -205,7 +211,7 @@
VG_(debugLog)(2, "stacks", "register [start-end] [%p-%p] as stack %lu\n",
(void*)start, (void*)end, i->id);
-
+ INNER_REQUEST(i->outer_id = VALGRIND_STACK_REGISTER(start, end));
return i->id;
}
@@ -231,6 +237,7 @@
} else {
prev->next = i->next;
}
+ INNER_REQUEST(VALGRIND_STACK_DEREGISTER(i->outer_id));
VG_(free)(i);
return;
}
@@ -257,6 +264,7 @@
/* FIXME : swap start/end like VG_(register_stack) ??? */
i->start = start;
i->end = end;
+ INNER_REQUEST(VALGRIND_STACK_CHANGE(i->outer_id, start, end));
return;
}
i = i->next;
Modified: trunk/coregrind/m_threadstate.c
==============================================================================
--- trunk/coregrind/m_threadstate.c (original)
+++ trunk/coregrind/m_threadstate.c Sat Nov 19 13:24:13 2016
@@ -47,6 +47,8 @@
ThreadState *VG_(threads);
UInt VG_N_THREADS;
+ThreadState *VG_(inner_threads);
+
/*------------------------------------------------------------*/
/*--- Operations. ---*/
/*------------------------------------------------------------*/
@@ -68,6 +70,7 @@
sizeof(VG_(threads)[tid].os_state.exitcode),
""));
}
+ INNER_REQUEST(VALGRIND_INNER_THREADS(VG_(threads)));
}
const HChar* VG_(name_of_ThreadStatus) ( ThreadStatus status )
Modified: trunk/coregrind/pub_core_threadstate.h
==============================================================================
--- trunk/coregrind/pub_core_threadstate.h (original)
+++ trunk/coregrind/pub_core_threadstate.h Sat Nov 19 13:24:13 2016
@@ -409,11 +409,16 @@
/*--- The thread table. ---*/
/*------------------------------------------------------------*/
-/* A statically allocated array of threads. NOTE: [0] is
- never used, to simplify the simulation of initialisers for
- LinuxThreads. */
+/* An array of threads, dynamically allocated by VG_(init_Threads).
+ NOTE: [0] is never used, to simplify the simulation of initialisers
+ for LinuxThreads. */
extern ThreadState *VG_(threads);
+/* In an outer valgrind, VG_(inner_threads) stores the address of
+ the inner VG_(threads) array, as reported by the inner using
+ the client request INNER_THREADS. */
+extern ThreadState *VG_(inner_threads);
+
// The running thread. m_scheduler should be the only other module
// to write to this.
extern ThreadId VG_(running_tid);
Modified: trunk/include/valgrind.h
==============================================================================
--- trunk/include/valgrind.h (original)
+++ trunk/include/valgrind.h Sat Nov 19 13:24:13 2016
@@ -6642,8 +6642,9 @@
/* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !!
This enum comprises an ABI exported by Valgrind to programs
- which use client requests. DO NOT CHANGE THE ORDER OF THESE
- ENTRIES, NOR DELETE ANY -- add new ones at the end. */
+ which use client requests. DO NOT CHANGE THE NUMERIC VALUES OF THESE
+ ENTRIES, NOR DELETE ANY -- add new ones at the end of the most
+ relevant group. */
typedef
enum { VG_USERREQ__RUNNING_ON_VALGRIND = 0x1001,
VG_USERREQ__DISCARD_TRANSLATIONS = 0x1002,
@@ -6713,8 +6714,13 @@
Other values are not allowed. */
VG_USERREQ__CHANGE_ERR_DISABLEMENT = 0x1801,
+ /* Some requests used for Valgrind internal, such as
+ self-test or self-hosting. */
/* Initialise IR injection */
- VG_USERREQ__VEX_INIT_FOR_IRI = 0x1901
+ VG_USERREQ__VEX_INIT_FOR_IRI = 0x1901,
+ /* Used by Inner Valgrind to inform Outer Valgrind where to
+ find the list of inner guest threads */
+ VG_USERREQ__INNER_THREADS = 0x1902
} Vg_ClientRequest;
#if !defined(__GNUC__)
@@ -6740,6 +6746,10 @@
VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DISCARD_TRANSLATIONS, \
_qzz_addr, _qzz_len, 0, 0, 0)
+#define VALGRIND_INNER_THREADS(_qzz_addr) \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__INNER_THREADS, \
+ _qzz_addr, 0, 0, 0, 0)
+
/* These requests are for getting Valgrind itself to print something.
Possibly with a backtrace. This is a really ugly hack. The return value
|
|
From: <sv...@va...> - 2016-11-18 21:54:18
|
Author: philippe
Date: Fri Nov 18 21:54:09 2016
New Revision: 16138
Log:
Add typedef Alloc_Fn_t/Free_Fn_t in pub_tool_basics.h, use them everywhere
Modified:
trunk/coregrind/m_deduppoolalloc.c
trunk/coregrind/m_oset.c
trunk/coregrind/m_poolalloc.c
trunk/coregrind/m_rangemap.c
trunk/coregrind/m_xarray.c
trunk/coregrind/m_xtree.c
trunk/include/pub_tool_basics.h
trunk/include/pub_tool_deduppoolalloc.h
trunk/include/pub_tool_oset.h
trunk/include/pub_tool_poolalloc.h
trunk/include/pub_tool_rangemap.h
trunk/include/pub_tool_xarray.h
trunk/include/pub_tool_xtree.h
Modified: trunk/coregrind/m_deduppoolalloc.c
==============================================================================
--- trunk/coregrind/m_deduppoolalloc.c (original)
+++ trunk/coregrind/m_deduppoolalloc.c Fri Nov 18 21:54:09 2016
@@ -43,9 +43,9 @@
SizeT fixedSzb; /* If using VG_(allocFixedEltDedupPA), size of elements */
Bool strPA; /* True if this is a string dedup pool */
SizeT eltAlign;
- void* (*alloc_fn)(const HChar*, SizeT); /* pool allocator */
+ Alloc_Fn_t alloc_fn; /* pool allocator */
const HChar* cc; /* pool allocator's cost centre */
- void (*free_fn)(void*); /* pool allocator's deallocation function */
+ Free_Fn_t free_fn; /* pool allocator's deallocation function */
/* XArray of void* (pointers to pools). The pools themselves.
Each element is a pointer to a block of size at least PoolSzB bytes.
The last block might be smaller due to a call to shrink_block. */
@@ -84,9 +84,9 @@
DedupPoolAlloc* VG_(newDedupPA) ( SizeT poolSzB,
SizeT eltAlign,
- void* (*alloc_fn)(const HChar*, SizeT),
+ Alloc_Fn_t alloc_fn,
const HChar* cc,
- void (*free_fn)(void*) )
+ Free_Fn_t free_fn )
{
DedupPoolAlloc* ddpa;
vg_assert(poolSzB >= eltAlign);
Modified: trunk/coregrind/m_oset.c
==============================================================================
--- trunk/coregrind/m_oset.c (original)
+++ trunk/coregrind/m_oset.c Fri Nov 18 21:54:09 2016
@@ -112,9 +112,9 @@
struct _OSet {
SizeT keyOff; // key offset
OSetCmp_t cmp; // compare a key and an element, or NULL
- OSetAlloc_t alloc_fn; // allocator
+ Alloc_Fn_t alloc_fn; // allocator
const HChar* cc; // cost centre for allocator
- OSetFree_t free_fn; // deallocator
+ Free_Fn_t free_fn; // deallocator
PoolAlloc* node_pa; // (optional) pool allocator for nodes.
SizeT maxEltSize; // for node_pa, must be > 0. Otherwise unused.
UInt nElems; // number of elements in the tree
@@ -286,8 +286,8 @@
// The underscores avoid GCC complaints about overshadowing global names.
AvlTree* VG_(OSetGen_Create)(PtrdiffT keyOff, OSetCmp_t cmp,
- OSetAlloc_t alloc_fn, const HChar* cc,
- OSetFree_t free_fn)
+ Alloc_Fn_t alloc_fn, const HChar* cc,
+ Free_Fn_t free_fn)
{
AvlTree* t;
@@ -315,8 +315,8 @@
}
AvlTree* VG_(OSetGen_Create_With_Pool)(PtrdiffT keyOff, OSetCmp_t cmp,
- OSetAlloc_t alloc_fn, const HChar* cc,
- OSetFree_t free_fn,
+ Alloc_Fn_t alloc_fn, const HChar* cc,
+ Free_Fn_t free_fn,
SizeT poolSize,
SizeT maxEltSize)
{
@@ -361,8 +361,8 @@
return t;
}
-AvlTree* VG_(OSetWord_Create)(OSetAlloc_t alloc_fn, const HChar* cc,
- OSetFree_t free_fn)
+AvlTree* VG_(OSetWord_Create)(Alloc_Fn_t alloc_fn, const HChar* cc,
+ Free_Fn_t free_fn)
{
return VG_(OSetGen_Create)(/*keyOff*/0, /*cmp*/NULL, alloc_fn, cc, free_fn);
}
Modified: trunk/coregrind/m_poolalloc.c
==============================================================================
--- trunk/coregrind/m_poolalloc.c (original)
+++ trunk/coregrind/m_poolalloc.c Fri Nov 18 21:54:09 2016
@@ -36,9 +36,9 @@
UWord nrRef; /* nr reference to this pool allocator */
UWord elemSzB; /* element size */
UWord nPerPool; /* # elems per pool */
- void* (*alloc_fn)(const HChar*, SizeT); /* pool allocator */
- const HChar* cc; /* pool allocator's cost centre */
- void (*free_fn)(void*); /* pool allocator's free-er */
+ Alloc_Fn_t alloc_fn; /* pool allocator */
+ const HChar* cc; /* pool allocator's cost centre */
+ Free_Fn_t free_fn; /* pool allocator's free-er */
/* XArray of void* (pointers to pools). The pools themselves.
Each element is a pointer to a block of size (elemSzB *
nPerPool) bytes. */
@@ -50,9 +50,9 @@
PoolAlloc* VG_(newPA) ( UWord elemSzB,
UWord nPerPool,
- void* (*alloc_fn)(const HChar*, SizeT),
+ Alloc_Fn_t alloc_fn,
const HChar* cc,
- void (*free_fn)(void*) )
+ Free_Fn_t free_fn )
{
PoolAlloc* pa;
vg_assert(0 == (elemSzB % sizeof(UWord)));
Modified: trunk/coregrind/m_rangemap.c
==============================================================================
--- trunk/coregrind/m_rangemap.c (original)
+++ trunk/coregrind/m_rangemap.c Fri Nov 18 21:54:09 2016
@@ -48,9 +48,9 @@
struct _RangeMap {
- void* (*alloc_fn) ( const HChar*, SizeT ); /* alloc fn (nofail) */
+ Alloc_Fn_t alloc_fn; /* alloc fn (nofail) */
const HChar* cc; /* cost centre for alloc */
- void (*free_fn) ( void* ); /* free fn */
+ Free_Fn_t free_fn; /* free fn */
XArray* ranges;
};
@@ -62,9 +62,9 @@
static void show ( const RangeMap* rm );
-RangeMap* VG_(newRangeMap) ( void*(*alloc_fn)(const HChar*,SizeT),
+RangeMap* VG_(newRangeMap) ( Alloc_Fn_t alloc_fn,
const HChar* cc,
- void(*free_fn)(void*),
+ Free_Fn_t free_fn,
UWord initialVal )
{
/* check user-supplied info .. */
Modified: trunk/coregrind/m_xarray.c
==============================================================================
--- trunk/coregrind/m_xarray.c (original)
+++ trunk/coregrind/m_xarray.c Fri Nov 18 21:54:09 2016
@@ -38,9 +38,9 @@
/* See pub_tool_xarray.h for details of what this is all about. */
struct _XArray {
- void* (*alloc_fn) ( const HChar*, SizeT ); /* alloc fn (nofail) */
+ Alloc_Fn_t alloc_fn; /* alloc fn (nofail) */
const HChar* cc; /* cost centre for alloc */
- void (*free_fn) ( void* ); /* free fn */
+ Free_Fn_t free_fn; /* free fn */
Int (*cmpFn) ( const void*, const void* ); /* cmp fn (may be NULL) */
Word elemSzB; /* element size in bytes */
void* arr; /* pointer to elements */
@@ -50,9 +50,9 @@
};
-XArray* VG_(newXA) ( void*(*alloc_fn)(const HChar*,SizeT),
+XArray* VG_(newXA) ( Alloc_Fn_t alloc_fn,
const HChar* cc,
- void(*free_fn)(void*),
+ Free_Fn_t free_fn,
Word elemSzB )
{
XArray* xa;
Modified: trunk/coregrind/m_xtree.c
==============================================================================
--- trunk/coregrind/m_xtree.c (original)
+++ trunk/coregrind/m_xtree.c Fri Nov 18 21:54:09 2016
@@ -73,9 +73,9 @@
struct _XT_shared {
UWord nrRef; /* nr of XTrees referencing this shared memory. */
- void* (*alloc_fn)( const HChar*, SizeT ); /* alloc fn (nofail) */
+ Alloc_Fn_t alloc_fn; /* alloc fn (nofail) */
const HChar* cc; /* cost centre for alloc */
- void (*free_fn)( void* ); /* free fn */
+ Free_Fn_t free_fn; /* free fn */
/* The data associated to each ec is stored in 2 arrays:
an xec array, shared between an xt and all its snapshots.
@@ -102,7 +102,7 @@
(with the index ecu/4). */
#define NO_OFFSET 0xffffffff
-static XT_shared* new_XT_shared (void* (*alloc_fn)(const HChar*, SizeT),
+static XT_shared* new_XT_shared (Alloc_Fn_t alloc_fn,
const HChar* cc,
void (*free_fn)(void*))
{
@@ -208,9 +208,9 @@
struct _XTree {
- void* (*alloc_fn)( const HChar*, SizeT ); /* alloc fn (nofail) */
+ Alloc_Fn_t alloc_fn; /* alloc fn (nofail) */
const HChar* cc; /* cost centre for alloc */
- void (*free_fn)( void* ); /* free fn */
+ Free_Fn_t free_fn; /* free fn */
Word dataSzB; /* data size in bytes */
XT_init_data_t init_data_fn;
XT_add_data_t add_data_fn;
@@ -224,9 +224,9 @@
};
-XTree* VG_(XT_create) ( void*(*alloc_fn)(const HChar*, SizeT),
+XTree* VG_(XT_create) ( Alloc_Fn_t alloc_fn,
const HChar* cc,
- void(*free_fn) (void*),
+ Free_Fn_t free_fn,
Word dataSzB,
XT_init_data_t init_data_fn,
XT_add_data_t add_data_fn,
Modified: trunk/include/pub_tool_basics.h
==============================================================================
--- trunk/include/pub_tool_basics.h (original)
+++ trunk/include/pub_tool_basics.h Fri Nov 18 21:54:09 2016
@@ -129,6 +129,17 @@
/* ThreadIds are simply indices into the VG_(threads)[] array. */
typedef UInt ThreadId;
+/* Many data structures need to allocate and release memory.
+ The allocation/release functions must be provided by the caller.
+ The Alloc_Fn_t function must allocate a chunk of memory of size szB.
+ cc is the Cost Centre for this allocated memory. This constant string
+ is used to provide Valgrind's heap profiling, activated by
+ --profile-heap=no|yes.
+ The corresponding Free_Fn_t frees the memory chunk p. */
+
+typedef void* (*Alloc_Fn_t) ( const HChar* cc, SizeT szB );
+typedef void (*Free_Fn_t) ( void* p );
+
/* An abstraction of syscall return values.
Linux/MIPS32 and Linux/MIPS64:
When _isError == False,
Modified: trunk/include/pub_tool_deduppoolalloc.h
==============================================================================
--- trunk/include/pub_tool_deduppoolalloc.h (original)
+++ trunk/include/pub_tool_deduppoolalloc.h Fri Nov 18 21:54:09 2016
@@ -93,9 +93,9 @@
This function never returns NULL. */
extern DedupPoolAlloc* VG_(newDedupPA) ( SizeT poolSzB,
SizeT eltAlign,
- void* (*alloc)(const HChar*, SizeT),
+ Alloc_Fn_t alloc_fn,
const HChar* cc,
- void (*free_fn)(void*) );
+ Free_Fn_t free_fn );
/* Allocates or retrieve element from ddpa with eltSzB bytes to store elt.
This function never returns NULL.
Modified: trunk/include/pub_tool_oset.h
==============================================================================
--- trunk/include/pub_tool_oset.h (original)
+++ trunk/include/pub_tool_oset.h Fri Nov 18 21:54:09 2016
@@ -77,13 +77,8 @@
typedef struct _OSet OSet;
-// - Cmp: returns -1, 0 or 1 if key is <, == or > elem.
-// - Alloc: allocates a chunk of memory.
-// - Free: frees a chunk of memory allocated with Alloc.
-
+// - OSetCmp_t: returns -1, 0 or 1 if key is <, == or > elem.
typedef Word (*OSetCmp_t) ( const void* key, const void* elem );
-typedef void* (*OSetAlloc_t) ( const HChar* cc, SizeT szB );
-typedef void (*OSetFree_t) ( void* p );
/*--------------------------------------------------------------------*/
/*--- Creating and destroying OSets (UWord) ---*/
@@ -103,8 +98,8 @@
// to allow the destruction of any attached resources; if NULL it is not
// called.
-extern OSet* VG_(OSetWord_Create) ( OSetAlloc_t alloc_fn, const HChar* cc,
- OSetFree_t free_fn );
+extern OSet* VG_(OSetWord_Create) ( Alloc_Fn_t alloc_fn, const HChar* cc,
+ Free_Fn_t free_fn );
extern void VG_(OSetWord_Destroy) ( OSet* os );
/*--------------------------------------------------------------------*/
@@ -204,14 +199,14 @@
// lead to assertions in Valgrind's allocator.
extern OSet* VG_(OSetGen_Create) ( PtrdiffT keyOff, OSetCmp_t cmp,
- OSetAlloc_t alloc_fn, const HChar* cc,
- OSetFree_t free_fn);
+ Alloc_Fn_t alloc_fn, const HChar* cc,
+ Free_Fn_t free_fn);
extern OSet* VG_(OSetGen_Create_With_Pool) ( PtrdiffT keyOff, OSetCmp_t cmp,
- OSetAlloc_t alloc_fn,
+ Alloc_Fn_t alloc_fn,
const HChar* cc,
- OSetFree_t free_fn,
+ Free_Fn_t free_fn,
SizeT poolSize,
SizeT maxEltSize);
// Same as VG_(OSetGen_Create) but created OSet will use a pool allocator to
Modified: trunk/include/pub_tool_poolalloc.h
==============================================================================
--- trunk/include/pub_tool_poolalloc.h (original)
+++ trunk/include/pub_tool_poolalloc.h Fri Nov 18 21:54:09 2016
@@ -56,9 +56,9 @@
This function never returns NULL. */
extern PoolAlloc* VG_(newPA) ( UWord elemSzB,
UWord nPerPool,
- void* (*alloc)(const HChar*, SizeT),
+ Alloc_Fn_t alloc_fn,
const HChar* cc,
- void (*free_fn)(void*) );
+ Free_Fn_t free_fn );
/* Free all memory associated with a PoolAlloc. */
Modified: trunk/include/pub_tool_rangemap.h
==============================================================================
--- trunk/include/pub_tool_rangemap.h (original)
+++ trunk/include/pub_tool_rangemap.h Fri Nov 18 21:54:09 2016
@@ -47,9 +47,9 @@
succeeded.) The new array will contain a single range covering the
entire key space, which will be bound to the value |initialVal|.
This function never returns NULL. */
-RangeMap* VG_(newRangeMap) ( void*(*alloc_fn)(const HChar*,SizeT),
+RangeMap* VG_(newRangeMap) ( Alloc_Fn_t alloc_fn,
const HChar* cc,
- void(*free_fn)(void*),
+ Free_Fn_t free_fn,
UWord initialVal );
/* Free all memory associated with a RangeMap. */
Modified: trunk/include/pub_tool_xarray.h
==============================================================================
--- trunk/include/pub_tool_xarray.h (original)
+++ trunk/include/pub_tool_xarray.h Fri Nov 18 21:54:09 2016
@@ -54,9 +54,9 @@
for elements of the specified size. alloc_fn must not return NULL (that
is, if it returns it must have succeeded.)
This function never returns NULL. */
-extern XArray* VG_(newXA) ( void*(*alloc_fn)(const HChar*,SizeT),
+extern XArray* VG_(newXA) ( Alloc_Fn_t alloc_fn,
const HChar* cc,
- void(*free_fn)(void*),
+ Free_Fn_t free_fn,
Word elemSzB );
/* Free all memory associated with an XArray. */
Modified: trunk/include/pub_tool_xtree.h
==============================================================================
--- trunk/include/pub_tool_xtree.h (original)
+++ trunk/include/pub_tool_xtree.h Fri Nov 18 21:54:09 2016
@@ -96,9 +96,9 @@
alloc_fn must not return NULL (that is, if it returns it must have
succeeded.).
See respective typedef for *_fn arguments. */
-extern XTree* VG_(XT_create) ( void*(*alloc_fn)(const HChar*, SizeT),
+extern XTree* VG_(XT_create) ( Alloc_Fn_t alloc_fn,
const HChar* cc,
- void(*free_fn) (void*),
+ Free_Fn_t free_fn,
Word dataSzB,
XT_init_data_t init_data_fn,
XT_add_data_t add_data_fn,
|
|
From: Rich C. <rc...@wi...> - 2016-11-18 04:45:09
|
On Thu, 17 Nov 2016 22:29:43 -0600 Rich Coe <rc...@wi...> wrote: > I'm encountering this error: > vex x86->IR: unhandled instruction bytes: 0xCB 0x55 0x8B 0xEC > 0xCB is an intel x86 far return. > > Could valgrind be treating malloc memory as a non-code? (case 1 of the error) > This code is malloc'ing memory and executing code from it. Nevermind. I found the issue explained here: http://valgrind.10908.n7.nabble.com/How-can-ignore-lib-containing-Unrecognized-instruction-Illegal-opcode-td42321.html Thanks. -- Rich Coe rc...@wi... |
|
From: Rich C. <rc...@wi...> - 2016-11-18 04:29:50
|
I'm encountering this error: vex x86->IR: unhandled instruction bytes: 0xCB 0x55 0x8B 0xEC 0xCB is an intel x86 far return. Could valgrind be treating malloc memory as a non-code? (case 1 of the error) This code is malloc'ing memory and executing code from it. Thanks, Rich -- Rich Coe rc...@wi... |
|
From: Philippe W. <phi...@sk...> - 2016-11-17 22:09:28
|
On Tue, 2016-11-15 at 19:30 +0100, Petar Jovanovic wrote: > Hi Philippe, > > > * helgrind test seems to succeed (more?) systematically, but takes a > lot > > longer (around one minute, burning a lot of CPU, against about 10 > > seconds unpatched). > > This is a bit unusual. I have seen awfully long executions with the > current > trunk (i.e. without any patches) on my multicore x86 server ( > Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz). > > $ time perl tests/vg_regtest helgrind/tests/bar_bad.vgtest > bar_bad: valgrind -q ./bar_bad > > == 1 test, 0 stderr failures, 0 stdout failures, 0 stderrB failures, 0 > stdoutB failures, 0 post failures == > > > real 19m57.592s > user 20m5.572s > sys 0m1.680s I think these (sometimes) very long execution times are due to the default (unfair) way the valgrind scheduler works, which might cause starvation. Adding options --fair-sched=try for the 3 */tests/bar_bad*vgtest should ensure a reasonable bounded time. Philippe |
|
From: Philippe W. <phi...@sk...> - 2016-11-17 21:28:28
|
On Tue, 2016-11-15 at 19:30 +0100, Petar Jovanovic wrote: > Would the following one work for you? > > https://bugsfiles.kde.org/attachment.cgi?id=102247 > > bar_bad fails consistently on some systems and it would be good if we > could > find some solution for it. Yes, that would be really good. And your last patch looks to be on the good way. I have run: perl tests/vg_regtest --loop-till-fail helgrind/tests/bar_bad*vgtest drd/tests/bar_bad*vgtest and it has done now already 60 tests without failing or blocking. So, seems nice ... Philippe |
|
From: Philippe W. <phi...@sk...> - 2016-11-17 20:01:10
|
On Thu, 2016-11-17 at 11:25 -0800, Carl E. Love wrote:
> I have put debug statements into this code for both the inner and outer
> valgrind trees. The value returned by VG_MINIMAL_SETJMP() is 1 for the
> outer Valgrind and thus have_isa_2_07 is set to False. For the inner
> valgrind, the return value is 0 and we do not change have_isa_2_07.
>
> I have studied up a little on the setjump/longjump stuff. At this point,
> I don't know why they don't seem to work in the inner Valgrind. I was
> wondering if anyone had any insight it doesn't work on the inner?
I am guessing that VG_MINIMAL_SETJMP is in fact working.
I am guessing that the difference is:
* the outer checks that a capability is (or is not) supported by
trying an instruction.
If the instruction is not supported, a LONGJMP will happen.
On Power 7, that is what happens in the outer, as the outer runs
on the real (hw) cpu.
* When the inner runs, it runs on the CPU simulated by the outer.
Now, if the outer just executes this instruction without checking
the hw cap of the physical cpu (and runs the IR code retranslated
in other instructions), then the inner believes it is on a different
cpu than the hw cpu.
More generally, we might improve on the way to control the virtual
cpu provided by valgrind.
For example, we might imagine to have some command line flags
to specify what 'hw features' to simulate.
Of course, when translating to real instructions, only the really
available hw instructions can be generated (which means that it might
not be possible to accept all instructions in the virtual cpu).
Philippe
|
|
From: Carl E. L. <ce...@us...> - 2016-11-17 19:25:29
|
Julian, Valgrind developers:
Philippe found an issue on Power when self hosting Valgrind. The issue
shows up on Power 7 which does not support ISA 2.07.
The issue is we do a check to see if the run time check to see what the
hardware supports matches what the system says.
in short in initimg-linux.c, about line 736 we check if the auxv vector
has the ISA 2.07 flag set and compare that with the vex_archinfo->hwcaps
that was calculated by valgrind.
The a_val member of this entry is a bit map of hardware
capabilities. Some bit mask values include:
PPC_FEATURE2_ARCH_2_07 0x80000000
PPC_FEATURE2_HAS_HTM 0x40000000
PPC_FEATURE2_HAS_DSCR 0x20000000
PPC_FEATURE2_HAS_EBB 0x10000000
PPC_FEATURE2_HAS_ISEL 0x08000000
PPC_FEATURE2_HAS_TAR 0x04000000
PPC_FEATURE2_HAS_VCRYPTO 0x02000000
*/
auxv_2_07 = (auxv->u.a_val & 0x80000000ULL) == 0x80000000ULL;
hw_caps_2_07 = (vex_archinfo->hwcaps & VEX_HWCAPS_PPC64_ISA2_07)
== VEX_HWCAPS_PPC64_ISA2_07;
/* Verify the PPC_FEATURE2_ARCH_2_07 setting in HWCAP2
* matches the setting in VEX HWCAPS.
*/
The issue is on the inner valgrind vex_archinfo->hwcaps has the bit set
for VEX_HWCAPS_PPC64_ISA2_07.
The vex_archinfo->hwcaps value is set in coregrind/m_initimg/machine.cat
about line 1167
/* Check for ISA 2.07 support. */
have_isa_2_07 = True;
if (VG_MINIMAL_SETJMP(env_unsup_insn)) {
have_isa_2_07 = False;
} else {
__asm__ __volatile__(".long 0x7c000166"); /* mtvsrd XT,RA */
}
I have put debug statements into this code for both the inner and outer
valgrind trees. The value returned by VG_MINIMAL_SETJMP() is 1 for the
outer Valgrind and thus have_isa_2_07 is set to False. For the inner
valgrind, the return value is 0 and we do not change have_isa_2_07.
I have studied up a little on the setjump/longjump stuff. At this point,
I don't know why they don't seem to work in the inner Valgrind. I was
wondering if anyone had any insight it doesn't work on the inner?
Carl Love
On Sat, 2016-11-12 at 11:45 +0100, Philippe Waroquiers wrote:
> Hello Carl,
>
> I am busy investigating a strange behaviour (loss of performance)
> on ppc64 (callgrind tool), probably due to revision r16121.
>
> Doing that, I wanted to do valgrind self hosting
> (see README_DEVELOPERS for more info).
>
> When doing that, the inner valgrind asserts on the assert
> that I have commented below
> I can of course commit a fix that the below assert is not
> checked in an inner setup, but as I do not understand much
> of the below, it would be nice if you could investigate ?
> (no urgency of course, as the bypass is ok for now)
> Thanks
>
> Philippe
>
>
> Index: coregrind/m_initimg/initimg-linux.c
> ===================================================================
> --- coregrind/m_initimg/initimg-linux.c (revision 16120)
> +++ coregrind/m_initimg/initimg-linux.c (working copy)
> @@ -739,7 +739,7 @@
> /* Verify the PPC_FEATURE2_ARCH_2_07 setting in HWCAP2
> * matches the setting in VEX HWCAPS.
> */
> - vg_assert(auxv_2_07 == hw_caps_2_07);
> +// vg_assert(auxv_2_07 == hw_caps_2_07);
> }
>
> break;
>
>
|
|
From: Petar J. <mip...@gm...> - 2016-11-15 18:30:20
|
Hi Philippe, > * helgrind test seems to succeed (more?) systematically, but takes a lot > longer (around one minute, burning a lot of CPU, against about 10 > seconds unpatched). This is a bit unusual. I have seen awfully long executions with the current trunk (i.e. without any patches) on my multicore x86 server ( Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz). $ time perl tests/vg_regtest helgrind/tests/bar_bad.vgtest bar_bad: valgrind -q ./bar_bad == 1 test, 0 stderr failures, 0 stdout failures, 0 stderrB failures, 0 stdoutB failures, 0 post failures == real 19m57.592s user 20m5.572s sys 0m1.680s The previous patch was wrong, at least with the current DRD behaviour. Would the following one work for you? https://bugsfiles.kde.org/attachment.cgi?id=102247 bar_bad fails consistently on some systems and it would be good if we could find some solution for it. Regards, Petar |
|
From: <sv...@va...> - 2016-11-13 11:13:55
|
Author: philippe
Date: Sun Nov 13 11:13:48 2016
New Revision: 16137
Log:
Activate perf tests on arm64
Modified:
trunk/nightly/conf/gcc114-arm64.conf
Modified: trunk/nightly/conf/gcc114-arm64.conf
==============================================================================
--- trunk/nightly/conf/gcc114-arm64.conf (original)
+++ trunk/nightly/conf/gcc114-arm64.conf Sun Nov 13 11:13:48 2016
@@ -1,3 +1,3 @@
export ABT_DETAILS="`lsb_release -sicr | xargs echo` `uname -m`"
export ABT_JOBS=4
-#export ABT_PERF="--vg=../valgrind-new --vg=../valgrind-old"
+export ABT_PERF="--vg=../valgrind-new --vg=../valgrind-old"
|
|
From: <sv...@va...> - 2016-11-12 22:55:42
|
Author: philippe
Date: Sat Nov 12 22:55:35 2016
New Revision: 16136
Log:
Fix sym name cache: handles the difference between text and data, + match in symbol
* sym name cache to cache the 'isText' characteristic of the cached sym_name
* implement the match anywhere also in the cache
Not handling matchAnywhere has bad performance effect on callgrind, as almost many
IPs were considered as a fn entry, while they were not.
* use the same convention to name the findText argument
Modified:
trunk/coregrind/m_debuginfo/debuginfo.c
trunk/coregrind/m_debuginfo/priv_storage.h
trunk/coregrind/m_debuginfo/storage.c
Modified: trunk/coregrind/m_debuginfo/debuginfo.c
==============================================================================
--- trunk/coregrind/m_debuginfo/debuginfo.c (original)
+++ trunk/coregrind/m_debuginfo/debuginfo.c Sat Nov 12 22:55:35 2016
@@ -1646,7 +1646,6 @@
*/
static void search_all_symtabs ( Addr ptr, /*OUT*/DebugInfo** pdi,
/*OUT*/Word* symno,
- Bool match_anywhere_in_sym,
Bool findText )
{
Word sno;
@@ -1690,8 +1689,7 @@
if (!inRange) continue;
- sno = ML_(search_one_symtab) (
- di, ptr, match_anywhere_in_sym, findText );
+ sno = ML_(search_one_symtab) ( di, ptr, findText );
if (sno == -1) goto not_found;
*symno = sno;
*pdi = di;
@@ -1733,7 +1731,12 @@
#define N_SYM_NAME_CACHE 509
typedef
- struct { Addr sym_avma; const HChar* sym_name; PtrdiffT offset; }
+ struct {
+ Addr sym_avma;
+ const HChar* sym_name;
+ PtrdiffT offset : (sizeof(PtrdiffT)*8)-1;
+ Bool isText : 1;
+ }
Sym_Name_CacheEnt;
/* Sym_Name_CacheEnt associates a queried address to the sym name found.
By nature, if a sym name was found, it means the searched address
@@ -1783,12 +1786,13 @@
UWord hash = a % N_SYM_NAME_CACHE;
Sym_Name_CacheEnt* se = &sym_name_cache[hash];
- if (UNLIKELY(se->sym_avma != a)) {
+ if (UNLIKELY(se->sym_avma != a || se->isText != findText)) {
DebugInfo* di;
Word sno;
- search_all_symtabs ( a, &di, &sno, match_anywhere_in_sym, findText );
+ search_all_symtabs ( a, &di, &sno, findText );
se->sym_avma = a;
+ se->isText = findText;
if (di == NULL || a == 0)
se->sym_name = no_sym_name;
else {
@@ -1798,7 +1802,8 @@
}
}
- if (se->sym_name == no_sym_name) {
+ if (se->sym_name == no_sym_name
+ || (!match_anywhere_in_sym && se->offset != 0)) {
*buf = "";
return False;
}
@@ -1834,7 +1839,7 @@
VG_(strcpy)(bufwo, *buf);
VG_(sprintf)(bufwo + len, "%c%ld",
se->offset < 0 ? '-' : '+',
- se->offset < 0 ? -se->offset : se->offset);
+ (PtrdiffT) (se->offset < 0 ? -se->offset : se->offset));
*buf = bufwo;
}
@@ -1851,7 +1856,6 @@
Word sno;
search_all_symtabs ( guest_code_addr,
&si, &sno,
- True/*match_anywhere_in_fun*/,
True/*consider text symbols only*/ );
if (si == NULL)
return 0;
@@ -1873,7 +1877,7 @@
a, buf,
/*match_anywhere_in_fun*/True,
/*show offset?*/False,
- /*text syms only*/True,
+ /*text sym*/True,
/*offsetP*/NULL );
}
@@ -1888,7 +1892,7 @@
a, buf,
/*match_anywhere_in_fun*/True,
/*show offset?*/True,
- /*text syms only*/True,
+ /*text sym*/True,
/*offsetP*/NULL );
}
@@ -1907,7 +1911,7 @@
a, &tmp,
/*match_anywhere_in_fun*/False,
/*show offset?*/False,
- /*text syms only*/True,
+ /*text sym*/True,
/*offsetP*/NULL );
if (res)
*buf = tmp;
@@ -1926,7 +1930,7 @@
a, buf,
/*match_anywhere_in_fun*/True,
/*show offset?*/False,
- /*text syms only*/True,
+ /*text sym*/True,
/*offsetP*/NULL );
}
@@ -1945,7 +1949,7 @@
a, buf,
/*match_anywhere_in_fun*/True,
/*show offset?*/False,
- /*text syms only*/True,
+ /*text sym*/True,
/*offsetP*/NULL );
} else {
const DiInlLoc *next_inl = iipc && iipc->next_inltab >= 0
@@ -1970,7 +1974,7 @@
a, &fnname,
/*match_anywhere_in_sym*/True,
/*show offset?*/False,
- /*text syms only*/True,
+ /*text sym*/True,
offset );
}
@@ -2027,7 +2031,7 @@
data_addr, dname,
/*match_anywhere_in_sym*/True,
/*show offset?*/False,
- /*data syms only please*/False,
+ /*text sym*/False,
offset );
}
Modified: trunk/coregrind/m_debuginfo/priv_storage.h
==============================================================================
--- trunk/coregrind/m_debuginfo/priv_storage.h (original)
+++ trunk/coregrind/m_debuginfo/priv_storage.h Sat Nov 12 22:55:35 2016
@@ -1108,7 +1108,6 @@
/* Find a symbol-table index containing the specified pointer, or -1
if not found. Binary search. */
extern Word ML_(search_one_symtab) ( const DebugInfo* di, Addr ptr,
- Bool match_anywhere_in_sym,
Bool findText );
/* Find a location-table index containing the specified pointer, or -1
Modified: trunk/coregrind/m_debuginfo/storage.c
==============================================================================
--- trunk/coregrind/m_debuginfo/storage.c (original)
+++ trunk/coregrind/m_debuginfo/storage.c Sat Nov 12 22:55:35 2016
@@ -2360,11 +2360,10 @@
if not found. Binary search. */
Word ML_(search_one_symtab) ( const DebugInfo* di, Addr ptr,
- Bool match_anywhere_in_sym,
Bool findText )
{
Addr a_mid_lo, a_mid_hi;
- Word mid, size,
+ Word mid,
lo = 0,
hi = di->symtab_used-1;
while (True) {
@@ -2372,10 +2371,7 @@
if (lo > hi) return -1; /* not found */
mid = (lo + hi) / 2;
a_mid_lo = di->symtab[mid].avmas.main;
- size = ( match_anywhere_in_sym
- ? di->symtab[mid].size
- : 1);
- a_mid_hi = ((Addr)di->symtab[mid].avmas.main) + size - 1;
+ a_mid_hi = ((Addr)di->symtab[mid].avmas.main) + di->symtab[mid].size - 1;
if (ptr < a_mid_lo) { hi = mid-1; continue; }
if (ptr > a_mid_hi) { lo = mid+1; continue; }
|
|
From: <sv...@va...> - 2016-11-12 20:11:32
|
Author: philippe
Date: Sat Nov 12 20:11:25 2016
New Revision: 16135
Log:
When --show-below-main=no, search main from the outermost stackframe
* main is more likely to be an outermost frame rather than an innermost
frame. So, searching from the outermost frame will more quickly find it.
* Also, in case the stacktrace contains twice the main functionn, this
ensures we only removes the functions below the outermost main.
Having 2 mains in a stacktrace does not happen normally.
However, this prepares for some future commit that improves
the outer/inner setup: the outer will append the inner guest stack trace.
The inner stack trace sometimes already contains main.
Searching from outermost frame main allows to keep the interesting
part of the stacktrace.
Modified:
trunk/coregrind/m_stacktrace.c
Modified: trunk/coregrind/m_stacktrace.c
==============================================================================
--- trunk/coregrind/m_stacktrace.c (original)
+++ trunk/coregrind/m_stacktrace.c Sat Nov 12 20:11:25 2016
@@ -1797,28 +1797,25 @@
StackTrace ips, UInt n_ips
)
{
- Bool main_done = False;
- Int i = 0;
+ Int i;
vg_assert(n_ips > 0);
- do {
- Addr ip = ips[i];
-
- // Stop after the first appearance of "main" or one of the other names
- // (the appearance of which is a pretty good sign that we've gone past
- // main without seeing it, for whatever reason)
- if ( ! VG_(clo_show_below_main) ) {
- Vg_FnNameKind kind = VG_(get_fnname_kind_from_IP)(ip);
- if (Vg_FnNameMain == kind || Vg_FnNameBelowMain == kind) {
- main_done = True;
- }
+ if ( ! VG_(clo_show_below_main) ) {
+ // Search (from the outer frame onwards) the appearance of "main"
+ // or the last appearance of a below main function.
+ // Then decrease n_ips so as to not call action for the below main
+ for (i = n_ips - 1; i >= 0; i--) {
+ Vg_FnNameKind kind = VG_(get_fnname_kind_from_IP)(ips[i]);
+ if (Vg_FnNameMain == kind || Vg_FnNameBelowMain == kind)
+ n_ips = i + 1;
+ if (Vg_FnNameMain == kind)
+ break;
}
+ }
+ for (i = 0; i < n_ips; i++)
// Act on the ip
- action(i, ip, opaque);
-
- i++;
- } while (i < n_ips && !main_done);
+ action(i, ips[i], opaque);
}
|
|
From: <sv...@va...> - 2016-11-12 19:51:58
|
Author: mjw Date: Sat Nov 12 19:51:51 2016 New Revision: 16134 Log: Cleanup none/tests/nocwd.vgtest tmp dirs. The none/tests/nocwd creates a really deep temporary directory structure that is also inaccessible after the test. This causes issues with some build wrappers like koji which fail to cleanup such deep subdirectories. So explicitly cleanup the directory after the test. https://bugzilla.redhat.com/show_bug.cgi?id=1390282 Modified: trunk/none/tests/nocwd.vgtest Modified: trunk/none/tests/nocwd.vgtest ============================================================================== --- trunk/none/tests/nocwd.vgtest (original) +++ trunk/none/tests/nocwd.vgtest Sat Nov 12 19:51:51 2016 @@ -1,2 +1,3 @@ prog: nocwd vgopts: -q --trace-children=yes +cleanup: chmod u+rwx /tmp/wd_test_*; rm -rf /tmp/wd_test_* |