History log of /external/valgrind/coregrind/m_execontext.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ed39800a83baf5bffbe391f3974eb2af0f415f80 21-Jun-2017 Elliott Hughes <enh@google.com> Upgrade to valgrind 3.13.0 (15 June 2017).

Release 3.13.0 (15 June 2017)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

3.13.0 is a feature release with many improvements and the usual collection of
bug fixes.

This release supports X86/Linux, AMD64/Linux, ARM32/Linux, ARM64/Linux,
PPC32/Linux, PPC64BE/Linux, PPC64LE/Linux, S390X/Linux, MIPS32/Linux,
MIPS64/Linux, ARM/Android, ARM64/Android, MIPS32/Android, X86/Android,
X86/Solaris, AMD64/Solaris and AMD64/MacOSX 10.12.

* ==================== CORE CHANGES ===================

* The translation cache size has been increased to keep up with the demands of
large applications. The maximum number of sectors has increased from 24 to
48. The default number of sectors has increased from 16 to 32 on all
targets except Android, where the increase is from 6 to 12.

* The amount of memory that Valgrind can use has been increased from 64GB to
128GB. In particular this means your application can allocate up to about
60GB when running on Memcheck.

* Valgrind's default load address has been changed from 0x3800'0000 to
0x5800'0000, so as to make it possible to load larger executables. This
should make it possible to load executables of size at least 1200MB.

* A massive spaceleak caused by reading compressed debuginfo files has been
fixed. Valgrind should now be entirely usable with gcc-7.0 "-gz" created
debuginfo.

* The C++ demangler has been updated.

* Support for demangling Rust symbols has been added.

* A new representation of stack traces, the "XTree", has been added. An XTree
is a tree of stacktraces with data associated with the stacktraces. This is
used by various tools (Memcheck, Helgrind, Massif) to report on the heap
consumption of your program. Reporting is controlled by the new options
--xtree-memory=none|allocs|full and --xtree-memory-file=<file>.

A report 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.

Memcheck can also produce XTree leak reports using the Callgrind file
format. For more details, see the user manual.

* ================== PLATFORM CHANGES =================

* ppc64: support for ISA 3.0B and various fixes for existing 3.0 support

* amd64: fixes for JIT failure problems on long AVX2 code blocks

* amd64 and x86: support for CET prefixes has been added

* arm32: a few missing ARMv8 instructions have been implemented

* arm64, mips64, mips32: an alternative implementation of Load-Linked and
Store-Conditional instructions has been added. This is to deal with
processor implementations that implement the LL/SC specifications strictly
and as a result cause Valgrind to hang in certain situations. The
alternative implementation is automatically enabled at startup, as required.
You can use the option --sim-hints=fallback-llsc to force-enable it if you
want.

* Support for OSX 10.12 has been improved.

* On Linux, clone handling has been improved to honour CLONE_VFORK that
involves a child stack. Note however that CLONE_VFORK | CLONE_VM is handled
like CLONE_VFORK (by removing CLONE_VM), so applications that depend on
CLONE_VM exact semantics will (still) not work.

* The TileGX/Linux port has been removed because it appears to be both unused
and unsupported.

* ==================== TOOL CHANGES ====================

* Memcheck:

- Memcheck should give fewer false positives when running optimised
Clang/LLVM generated code.

- Support for --xtree-memory and 'xtmemory [<filename>]>'.

- New command line options --xtree-leak=no|yes and --xtree-leak-file=<file>
to produce the end of execution leak report in a xtree callgrind format
file.

- New option 'xtleak' in the memcheck leak_check monitor command, to produce
the leak report in an xtree file.

* Massif:

- Support for --xtree-memory and 'xtmemory [<filename>]>'.

- For some workloads (typically, for big applications), Massif memory
consumption and CPU consumption has decreased significantly.

* Helgrind:

- Support for --xtree-memory and 'xtmemory [<filename>]>'.

- addition of client request VALGRIND_HG_GNAT_DEPENDENT_MASTER_JOIN, useful
for Ada gnat compiled applications.

* ==================== 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). See README_DEVELOPERS for
more info.

* To allow fast detection of callgrind files by desktop environments and file
managers, the format was extended to have an optional first line that
uniquely identifies the format ("# callgrind format"). Callgrind creates
this line now, as does the new xtree functionality.

* File name template arguments (such as --log-file, --xtree-memory-file, ...)
have a new %n format letter that is replaced by a sequence number.

* "--version -v" now shows the SVN revision numbers from which Valgrind was
built.

* ==================== FIXED BUGS ====================

The following bugs have been fixed or resolved. Note that "n-i-bz"
stands for "not in bugzilla" -- that is, a bug that was reported to us
but never got a bugzilla entry. We encourage you to file bugs in
bugzilla (https://bugs.kde.org/enter_bug.cgi?product=valgrind) rather
than mailing the developers (or mailing lists) directly -- bugs that
are not entered into bugzilla tend to get forgotten about or ignored.

To see details of a given bug, visit
https://bugs.kde.org/show_bug.cgi?id=XXXXXX
where XXXXXX is the bug number as listed below.

162848 --log-file output isn't split when a program forks
340777 Illegal instruction on mips (ar71xx)
341481 MIPS64: Iop_CmpNE32 triggers false warning on MIPS64 platforms
342040 Valgrind mishandles clone with CLONE_VFORK | CLONE_VM that clones
to a different stack.
344139 x86 stack-seg overrides, needed by the Wine people
344524 store conditional of guest applications always fail - observed on
Octeon3(MIPS)
348616 Wine/valgrind: noted but unhandled ioctl 0x5390 [..] (DVD_READ_STRUCT)
352395 Please provide SVN revision info in --version -v
352767 Wine/valgrind: noted but unhandled ioctl 0x5307 [..] (CDROMSTOP)
356374 Assertion 'DRD_(g_threadinfo)[tid].pt_threadid !=
INVALID_POSIX_THREADID' failed
358213 helgrind/drd bar_bad testcase hangs or crashes with new glibc pthread
barrier implementation
358697 valgrind.h: Some code remains even when defining NVALGRIND
359202 Add musl libc configure/compile
360415 amd64 instructions ADCX and ADOX are not implemented in VEX
== 372828 (vex amd64->IR: 0x66 0xF 0x3A 0x62 0x4A 0x10)
360429 unhandled ioctl 0x530d with no size/direction hints (CDROMREADMODE1)
362223 assertion failed when .valgrindrc is a directory instead of a file
367543 bt/btc/btr/bts x86/x86_64 instructions are poorly-handled wrt flags
367942 Segfault vgPlain_do_sys_sigaction (m_signals.c:1138)
368507 can't malloc chunks larger than about 34GB
368529 Android arm target link error, missing atexit and pthread_atfork
368863 WARNING: unhandled arm64-linux syscall: 100 (get_robust_list)
368865 WARNING: unhandled arm64-linux syscall: 272 (kcmp)
368868 disInstr(arm64): unhandled instruction 0xD53BE000 = cntfrq_el0 (ARMv8)
368917 WARNING: unhandled arm64-linux syscall: 218 (request_key)
368918 WARNING: unhandled arm64-linux syscall: 127 (sched_rr_get_interval)
368922 WARNING: unhandled arm64-linux syscall: 161 (sethostname)
368924 WARNING: unhandled arm64-linux syscall: 84 (sync_file_range)
368925 WARNING: unhandled arm64-linux syscall: 130 (tkill)
368926 WARNING: unhandled arm64-linux syscall: 97 (unshare)
369459 valgrind on arm64 violates the ARMv8 spec (ldxr/stxr)
370028 Reduce the number of compiler warnings on MIPS platforms
370635 arm64 missing syscall getcpu
371225 Fix order of timer_{gettime,getoverrun,settime} syscalls on arm64
371227 Clean AArch64 syscall table
371412 Rename wrap_sys_shmat to sys_shmat like other wrappers
371471 Valgrind complains about non legit memory leaks on placement new (C++)
371491 handleAddrOverrides() is [incorrect] when ASO prefix is used
371503 disInstr(arm64): unhandled instruction 0xF89F0000
371869 support '%' in symbol Z-encoding
371916 execution tree xtree concept
372120 c++ demangler demangles symbols which are not c++
372185 Support of valgrind on ARMv8 with 32 bit executable
372188 vex amd64->IR: 0x66 0xF 0x3A 0x62 0x4A 0x10 0x10 0x48 (PCMPxSTRx $0x10)
372195 Power PC, xxsel instruction is not always recognized.
372504 Hanging on exit_group
372600 process loops forever when fatal signals are arriving quickly
372794 LibVEX (arm32 front end): 'Assertion szBlg2 <= 3' failed
373046 Stacks registered by core are never deregistered
373069 memcheck/tests/leak_cpp_interior fails with GCC 5.1+
373086 Implement additional Xen hypercalls
373192 Calling posix_spawn in glibc 2.24 completely broken
373488 Support for fanotify API on ARM64 architecture
== 368864 WARNING: unhandled arm64-linux syscall: 262 (fanotify_init)
373555 Rename BBPTR to GSPTR as it denotes guest state pointer only
373938 const IRExpr arguments for matchIRExpr()
374719 some spelling fixes
374963 increase valgrind's load address to prevent mmap failure
375514 valgrind_get_tls_addr() does not work in case of static TLS
375772 +1 error in get_elf_symbol_info() when computing value of 'hi' address
for ML_(find_rx_mapping)()
375806 Test helgrind/tests/tc22_exit_w_lock fails with glibc 2.24
375839 Temporary storage exhausted, with long sequence of vfmadd231ps insns
== 377159 "vex: the `impossible' happened" still present
== 375150 Assertion 'tres.status == VexTransOK' failed
== 378068 valgrind crashes on AVX2 function in FFmpeg
376142 Segfaults on MIPS Cavium Octeon boards
376279 disInstr(arm64): unhandled instruction 0xD50320FF
376455 Solaris: unhandled syscall lgrpsys(180)
376518 Solaris: unhandled fast trap getlgrp(6)
376611 ppc64 and arm64 don't know about prlimit64 syscall
376729 PPC64, remove R2 from the clobber list
== 371668
376956 syswrap of SNDDRV and DRM_IOCTL_VERSION causing some addresses
to be wrongly marked as addressable
377066 Some Valgrind unit tests fail to compile on Ubuntu 16.10 with
PIE enabled by default
377376 memcheck/tests/linux/getregset fails with glibc2.24
377427 PPC64, lxv instruction failing on odd destination register
377478 PPC64: ISA 3.0 setup fixes
377698 Missing memory check for futex() uaddr arg for FUTEX_WAKE
and FUTEX_WAKE_BITSET, check only 4 args for FUTEX_WAKE_BITSET,
and 2 args for FUTEX_TRYLOCK_PI
377717 Fix massive space leak when reading compressed debuginfo sections
377891 Update Xen 4.6 domctl wrappers
377930 fcntl syscall wrapper is missing flock structure check
378524 libvexmultiarch_test regression on s390x and ppc64
378535 Valgrind reports INTERNAL ERROR in execve syscall wrapper
378673 Update libiberty demangler
378931 Add ISA 3.0B additional isnstructions, add OV32, CA32 setting support
379039 syscall wrapper for prctl(PR_SET_NAME) must not check more than 16 bytes
379094 Valgrind reports INTERNAL ERROR in rt_sigsuspend syscall wrapper
379371 UNKNOWN task message [id 3444, to mach_task_self(), reply 0x603]
(task_register_dyld_image_infos)
379372 UNKNOWN task message [id 3447, to mach_task_self(), reply 0x603]
(task_register_dyld_shared_cache_image_info)
379390 unhandled syscall: mach:70 (host_create_mach_voucher_trap)
379473 MIPS: add support for rdhwr cycle counter register
379504 remove TileGX/Linux port
379525 Support more x86 nop opcodes
379838 disAMode(x86): not an addr!
379703 PC ISA 3.0 fixes: stxvx, stxv, xscmpexpdp instructions
379890 arm: unhandled instruction: 0xEBAD 0x1B05 (sub.w fp, sp, r5, lsl #4)
379895 clock_gettime does not execute POST syscall wrapper
379925 PPC64, mtffs does not set the FPCC and C bits in the FPSCR correctly
379966 WARNING: unhandled amd64-linux syscall: 313 (finit_module)
380200 xtree generated callgrind files refer to files without directory name
380202 Assertion failure for cache line size (cls == 64) on aarch64.
380397 s390x: __GI_strcspn() replacement needed
n-i-bz Fix pub_tool_basics.h build issue with g++ 4.4.7.

(3.13.0.RC1: 2 June 2017, vex r3386, valgrind r16434)
(3.13.0.RC2: 9 June 2017, vex r3389, valgrind r16443)
(3.13.0: 14 June 2017, vex r3396, valgrind r16446)

Bug: N/A
Test: manual
Change-Id: Id4498a49f462c3689cbcb35c15f96a8c7e3cea17
/external/valgrind/coregrind/m_execontext.c
b3a1e4bffbdbbf38304f216af405009868f43628 21-Aug-2015 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update copyright dates, to include 2015. No functional change.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15577 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
75712710b9c49eedcf4f9caa7d7e17494ac3acf8 30-Apr-2015 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Remove a few embarassing comments.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15169 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
24f33d792e877ceedd68d6f74f40bba34fd72ce5 26-Mar-2015 philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9> Improve --stats=yes:
* give the avg nr of IPs per execontext
* use the newly introduced %f in m_transtab.c ratio
and in the avg nr of execontext per list



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15041 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
518850bf0da07ed3e2244e307268ae0fd80e93a8 23-Oct-2014 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Constify coregrind.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14656 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
e2800c958044937e72eefa371c10ae47ac40e089 15-Sep-2014 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> coregrind files shall use vg_assert not tl_assert.
Tool files shall use tl_assert not vg_assert.
Fix code accordingly.
Adapted check_headers_and_includes to make sure the code
stays clean in that respect.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14542 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
da56900c91fcfc4a0acd6dea8e882a56661e9364 25-Jun-2014 philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9> 2 execontexts in an hash table chain are not necessarily the same size.
So, ensure that when size differs, we do not start to compare them,
as this could otherwise cause a read buffer overrun



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14097 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
0f157ddb404bcde7815a1c5bf2d7e41c114f3d73 18-Oct-2013 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update copyright dates (20XY-2012 ==> 20XY-2013)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13658 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
a2968ccb86332489ac050bc194da7e3066770bc5 20-Sep-2013 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> In an attempt to fix the accounting for dynamic memory allocation
it turned out that coregrind freely allocates memory on the tool
arena (which it should not, conceptually) and tools rely on coregrind
doing so (by VG_(free)'ing memory allocated by coregrind).
Entangling this mess is risky and provides little benefit except
architectural cleanliness.
Thinking more about it... It isn't really all that interesting how
much memory is allocated by tool code in and by itself. What is
interesting is the total memory impact a tool has, e.g. as compared
to running "none".
So in this patch the number of memory arenas is consolidated by
subsuming VG_AR_TOOL/ERRORS/EXECCTXT into VG_AR_CORE.
VG_(malloc) and friends have been modified to operate on VG_AR_CORE.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13575 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
6e4b71339ecdf4accc77e86a892718516a531b0f 18-Jan-2013 philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9> Implement a more efficient allocation of small blocks which are never freed.
This generalises the "perm_malloc" function which was in ms_main.c
The new VG_(perm_malloc) is used in ms_main.c
and for execontext : when there are a lot of execontext, this
can save significant memory.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13238 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
63ea01e66b620d3b9afa88d1f014b98f5a92197f 13-Jan-2013 philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9> Comment only changes



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13227 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
8617b5b8f16570c9003379464d60e8572a801a8c 12-Jan-2013 philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9> Implement --keep-stacktraces=alloc|free|alloc-and-free|alloc-then-free|none

The option --keep-stacktraces controls which stack trace(s) to keep for
malloc'd and/or free'd blocks. This can be used to obtain more information
for 'use after free' errors or to decrease Valgrind memory and/or cpu usage
by recording less information for heap blocks.

This fixes 312913 Dangling pointers error should also report the alloc
stack trace.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13223 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
550c826ddf34fc504f2aab84d7b45a43841acbf8 12-Jan-2013 philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9> output the nr of IP in the stacktrace header produced by v.info exectxt



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13222 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
f3a6e930e9ad3214a39eb3c8ff6c53a97acac4d7 10-Jan-2013 philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9> Addition of GDB server monitor command 'v.info execontext' that shows
information about the stack traces recorded by Valgrind.
This can be used to analyse one possible cause of Valgrind high
memory usage for some programs.

At work, a big set of regression tests crashed out of memory under Valgrind.

Two main causes for out of memory were identified:
1. big memory usage for stacktrace (exe contexts) recording by Valgrind
2. big number of partially initialised bytes.

This patch adds a gdbsrv monitor command that output (very) detailed
information about all the recorded exe context.

This has been used to analyse the problem 1. above,
showing the following identified causes for a (too) big nr of execontexts:

A. When the JIT handles an unknown SP update, even when --track-origins=no,
an execontext is (uselessly) created and recorded
to track the (never used) origin of some uninitialised stack memory.
This creates a whole bunch of 'one IP' execontexts.

B. same problem in handling some system calls (at least the brk system
calls always records an origin, even when --track-origins=yes).

C. The Valgrind unwinder cannot properly unwind some stack traces.
It unwinds a few frames, then go bezerk and stops at a "random" IP.
This then causes the same "logical" stacktrace to be truncated
and records thousands of times with this "differentiating" last IP.


For problem cause 2 above ( a lot of partially initialised bytes),
the idea is to similarly add another gdbsrv commands that will output
statistics about which stack traces are causing a lot of uninitialised bytes.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13220 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
03f8d3fc25f5a45c5826259d1b33b7f310117279 05-Aug-2012 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update copyright dates to include 2012.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12843 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
78b83aee97f9001f4f52cbf246efe3d57118a466 26-Jul-2012 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Apply first_ip_delta also when only one frame is requested
for the back-trace.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12786 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
bb4f5da48eea59c58febd68617b6886db162a3d1 23-Jul-2012 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Pass first_ip_delta to VG_(record_depth_1_ExeContext) as the function
cannot figure it out by itself.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12775 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
7711f9e73d82763ee4e4cb8296d63be9ea70a719 29-Jun-2012 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Increase allowed size of a back-trace to 500 frames.
This limit is large enough for all practical purposes. It exists
only to sanity check the value specified with --num-callers.
Be frugal in record_ExeContext_wrk and only allocate on the stack
as many frames as needed.
Testcase included.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12685 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
ec062e8d96a361af9905b5447027819dfbfee01a 23-Oct-2011 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update all copyright dates, from 20xy-2010 to 20xy-2011.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12206 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
6c591e15c1d6402a2a755310f005f795b68e7e38 11-Apr-2011 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Create new module m_libcsetjmp, which wraps up uses of
__builtin_setjmp and __builtin_longjmp so that they can be selectively
replaced, on a platform by platform basis. Does not change any
functionality. Related to #259977.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11687 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
9eecbbb9a9cbbd30b903c09a9e04d8efc20bda33 03-May-2010 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update copyright dates to 2010.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11121 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
738856f99eea33d86ce91dcb1d6cd5b151e307ca 15-Jul-2009 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Merge coregrind/ changes from branches/MESSAGING_TIDYUP r10464.

This commit tidies up and rationalises what could be called the
"messaging" system -- that part of V to do with presenting output to
the user. In particular it brings significant improvements to XML
output.

Changes are:

* XML and normal text output now have separate file descriptors,
which solves longstanding problems for XML consumers caused by
the XML output getting polluted by unexpected non-XML output.

* This also means that we no longer have to hardwire all manner
of output settings (verbosity, etc) when XML is requested.

* The XML output format has been revised, cleaned up, and made
more suitable for use by error detecting tools in general
(various Memcheck-specific features have been removed). XML
output is enabled for Ptrcheck and Helgrind, and Memcheck is
updated to the new format.

* One side effect is that the behaviour of VG_(message) has been
made to be consistent with printf: it no longer automatically
adds a newline at the end of the output. This means multiple
calls to it can be used to build up a single line message; or a
single call can write a multi-line message. The ==pid==
preamble is automatically inserted at each newline.

* VG_(message)(Vg_UserMsg, ..args..) now has the abbreviated form
VG_(UMSG)(..args..); ditto VG_(DMSG) for Vg_DebugMsg and
VG_(EMSG) for Vg_DebugExtraMsg. A couple of other useful
printf derivatives have been added to pub_tool_libcprint.h,
most particularly VG_(vcbprintf).

* There's a small change in the core-tool interface to do with
error handling: VG_(needs_tool_errors) has a new method
void (*before_pp_Error)(Error* err) which, if non-NULL, is
called just before void (*pp_Error)(Error* err). This is to
give tools the chance to look at errors before any part of them
is printed, so they can print any XML preamble they like.

* coregrind/m_errormgr.c has been overhauled and cleaned up, and
is a bit simpler and more commented. In particular pp_Error
and VG_(maybe_record_error) are significantly changed.

The diff is huge, but mostly very boring. Most of the changes
are of the form

- VG_(message)(Vg_UserMsg, "this is a message %d", n);
+ VG_(message)(Vg_UserMsg, "this is a message %d\n", n);

Unfortunately as a result of this, it touches a large number
of source files.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10465 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
3a4b58f812bb0dd4cdb20b2869629845a683191d 08-May-2009 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Fix up some stack trace inconsistencies:

- When printing suppressions, never print more entries than there are in the
stack. This avoids bogus suppressions in some cases! (I haven't seen
them on Linux, but I have seen them on Darwin.)

- When getting a stack trace, stop if we get an IP of zero or one; that
means we've hit the end of the stack. And don't include that entry in the
stack trace, because it's a guaranteed "???" if it's ever printed which is
useless.

- In VG_(apply_StackTrace), we can now rely entirely on the n_ip parameter
rather than looking for 0 or -1, because that check is done when the stack
trace is first obtained. In other words, stack traces all use an n_ip
parameter to record their size, whereas previously they used an odd
mixture of n_ip and null-termination.

- Rename 'n_ips' variables as 'max_n_ips' where appropriate; those left as
'n_ips' truly describe how many IPs there are in the stack trace.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9793 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
b7a4e2ea4e1adfda6bf2d7e3c448f663c5d173a9 01-May-2009 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Renamed various things for clarity. Added some comments. And fixed the
dubious find-minimum-loss-record loop in print_results(), which was using an
inconsistent mixture of szB and szB+indirect_szB.

Two test results changed, just different sort orders for same-sized loss
records.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9704 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
9f207460d70d38c46c9e81996a3dcdf90961c6db 10-Mar-2009 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Updated copyright years.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9344 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
f98e1c03ce4bea1fb092cdea5571c41f29f6df9b 25-Oct-2008 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Merge Helgrind from branches/YARD into the trunk. Also includes some
minor changes to make stack unwinding on amd64-linux approximately
twice as fast as it was before.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8707 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
9c606bd8634cd6b67bb41fa645b5c639668cfa2d 18-Sep-2008 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Merge all remaining changes from branches/PTRCHECK. These are some
relatively minor extensions to m_debuginfo, a major overhaul of
m_debuginfo/readdwarf3.c to get its space usage under control, and
changes throughout the system to enable heap-use profiling.

The majority of the merged changes were committed into
branches/PTRCHECK as the following revs: 8591 8595 8598 8599 8601 and
8161.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8621 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
a8ffda6dfcbaec28d8b109b1fda290c0f14d869a 18-Jul-2008 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Format string fixes for ppc{32,64}-aix5.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8444 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
a0b6b2cf9abc7b0d87be1215a245eaccc0452af9 07-Jul-2008 bart <bart@a5019735-40e9-0310-863c-91ae7b9d1cf9> Merged FORMATCHECK branch (r8368) to trunk.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8369 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
7cf4e6b6aed533af53339f36099ed244dc4a5b7f 01-May-2008 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Merge branches/OTRACK_BY_INSTRUMENTATION into the trunk. This adds
support to Memcheck for tracking the origin of uninitialised values,
if you use the --track-origins=yes flag.

This currently causes some Memcheck regression tests to fail, because
they now print an extra line of advisory text in their output. This
will be fixed.

The core-tool interface is slightly changed. The version number for
the interface needs to be incremented.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7982 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
b8b79addf04dd5d0b558916e26df0b1927cbd758 03-Mar-2008 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Merge in the DATASYMS branch.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7540 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
4d474d086188fd1f29fa97dbd84d8ea2e589a9b8 11-Feb-2008 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update copyright dates ("200X-2007" --> "200X-2008").


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7398 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
3059d27cb39d904fefde0c49ff753d71788cd2fd 21-Dec-2007 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Add a new method VG_(record_depth_1_ExeContext), a trivial derivative
of VG_(record_ExeContext), which just records the first stack frame
but does not attempt to unwind the (guest) stack. This is useful in
situations where we suspect unwinding the stack might cause a
segfault.

Use this in m_signals, when getting a backtrace following a guest
segfault.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7304 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
39f3423cd68c385be301e6b44848b4c6276da7b5 10-Nov-2007 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Merge (from branches/THRCHECK) the following amd64-linux stack unwind
kludges^H^H^H^H^H^H^Henhancements:

r6802: For VG_(record_ExeContext) et al, add a new parameter
(first_ip_delta) which is added to the initial IP value before the
stack is unwound. A safe value to pass is zero, which causes the
existing behaviour to be unchanged. This is a kludge needed to work
around the incomplete amd64 stack unwind info in glibc-2.5's clone()
routine.

r7059: Add a last-ditch heuristic-hack to the amd64-linux stack
unwinder, which is used when all other methods fail. Seems like GDB
has something similar.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7118 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
9877e9b983797707c37bbf01bba491e894073617 23-Aug-2007 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Dynamically expand the ExeContext hash table, rather than using a
fixed size. Partial commit of a patch from Christoph Bartoschek.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6776 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
d35bf74f2344808078c932eba9311b838a4a739d 23-Aug-2007 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Make the ExeContext hash table a whole lot bigger.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6774 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
9ebd6e0c607fa30301b1325874eb8de871c21cc5 08-Jan-2007 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update copyright dates.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6488 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
bb2e09fd1ffb65b0a389d59026733381d814f482 24-Oct-2006 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Make the hashing in VG_(record_ExeContext) 64-bit clean and more
robust. Also incrementally rearrange the hash chains during searches.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6341 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
e4b0bf07b0ee0a18eacc5aba91686ab5fc1d327b 06-Jun-2006 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update copyright dates.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5954 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
c0ec8e926d9676ec4c696899b9a8a467438149e6 25-Dec-2005 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Merge in r5435 from COMPVBITS. Also added a note to
docs/internals/performance.txt about it.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5438 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
bcd75fcb80c13b9828a4c33b0d7acf1499e14135 19-Dec-2005 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Remove all remaining profiling gunk.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5388 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
0fd92f4126a029b2c73fd217b337121c38070066 06-Oct-2005 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Changed some overflow-prone counters from UInt to ULong.

Changed some printf specifiers accordingly, plus some more that were
incorrect.

Also put commas in various output numbers, eg. the leak check stats.
This makes them much easier to read when they get big. One
exception is in XML number-only fields such as <leakedbytes>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4874 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
34483bcaeda3136ec238bcfd7f9e691cf8a6d0dc 28-Sep-2005 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Increase some sizes to deal better with the new multigigabyte world:

- on 64-bit platforms, double the size of the supported address
space to 32G.

- Increase the size of the ExeContext table 6 times. Some very
large apps have been observed to have been doing a lot of
searching in the old 4999 entry table. This table may be
OSetified in the fullness of time.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4808 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
ef52b9da0417979c2be3e9800526dc0a63c553ec 28-Jun-2005 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Comment wibble


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4038 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
d0d7c1fc4e59b97115620fdae795f1128bda2d31 21-Jun-2005 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Don't #include pub_core_stacktrace.h in pub_core_execontext.h. So
a few places have to #include pub_core_stacktrace.h themselves, but
that's ok because explicit is better.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3976 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
24a6efb2f94eb0cb5d53174d580e1dc00893a6d6 20-Jun-2005 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Remove some unnecessary #includes, comment some others.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3966 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
c7561b931e249acf3768ead77638545b0ccaa8f1 19-Jun-2005 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Final commit for the initial modularisation pass:

- Broke part of m_scheduler off into a new module m_threadstate. It
contains ThreadState, VG_(threads)[] and some basic operations on the
thread table. All simple stuff, the complex stuff stays in m_scheduler.
This avoids lots of circular dependencies between m_scheduler and other
modules.

- Managed to finally remove core.h and tool.h, double hurrah!

- Introduced pub_tool_basics.h and pub_core_basics.h, one of which is
include by every single C file.

- Lots of little cleanups and changes related to the above.

- I even did a small amount of documentation updating.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3944 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
af1d7dfc9412c09d24ea10118f3fd1082f92e49d 11-Jun-2005 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Having moved VG_(arena_strdup)() out of core.h, core.h no longer
needs to #include pub_core_mallocfree.h. As a result, we need
to #include it explicitly everywhere else.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3881 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
132bfccd21960e462352175f8553a5bdce8a210c 04-Jun-2005 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Modularised assertions and panics in m_libcassert.

As part of this, killed the VG_STRINGIFY macro, which was used to expand
out names like "VG_(foo)" and "vgPlain_foo" in assertion failure
messages. This is good since we actually want the "VG_(foo)" form used
in these messages.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3842 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
36a20fa5f779a0a6fb7b4a90dcaa6376481f1faa 03-Jun-2005 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Modularise printing functions in m_libcprint.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3840 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
31513b4ab8477029517f07f0dcf1b441cb818548 01-Jun-2005 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Modularised the profiling stuff as m_profile.c. It's much more
sensible now -- no vg_dummy_profile.c, no silly #including of
vg_profile.c from tools.

Unfortunately, it still doesn't work, due to bad interactions
with signal handling that I don't understand.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3833 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
2024234c590f408994b373abfb00bc2cd2a90c48 17-May-2005 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Added module m_options for holding all the command-line option stuff.
Perhaps parts of process_cmd_line_option() should go in here, but I've
not done that for now.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3751 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c
267100d2a8495dd214d4f55351c469c23a18391d 24-Apr-2005 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Rename the first three modules as per naming scheme.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3555 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/coregrind/m_execontext.c