From 4247ea70e0ea51e1ab2bfcc7f0a6d2e26ce5de6a Mon Sep 17 00:00:00 2001 From: Dejan Jevtic Date: Mon, 16 Dec 2013 13:57:18 +0000 Subject: [PATCH] mips32/64: Add extra suppression for mips32/64. After the thread is detached not all thread memory is freed. This memory (dtv-dynamic thread vector) can be used by the main thread. There are two types of run-time handling of TLS. Difference is in the position of memory. It can be either before the thread pointer or after the thread pointer. Taken form the document http://www.akkadia.org/drepper/tls.pdf: "Variant I for the thread-local storage data structures were developed as part of the IA-64 ABI. Being brand-new, compatibility was no issue. The thread register for thread t is denoted by tpt. It points to a Thread Control Block (TCB) which contains at offset zero a pointer to the dynamic thread vector dtvt for the thread. Variant II has a similar structure. The only difference is that the thread pointer points to a Thread Control Block of unspecified size and content. Somewhere the TCB contains a pointer to the dynamic thread vector but it is not specified where. This is under control of the run-time environment and the pointer must not be assumed to be directly accessible; compilers are not allowed to emit code which directly access the dtvt." Because of this we have two types of error when the program ends: possibly lost, and definitely lost. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13761 --- memcheck/tests/Makefile.am | 2 ++ memcheck/tests/reach_thread_register.stderr.exp-mips32 | 6 ++++++ memcheck/tests/reach_thread_register.stderr.exp-mips64 | 6 ++++++ 3 files changed, 14 insertions(+) create mode 100644 memcheck/tests/reach_thread_register.stderr.exp-mips32 create mode 100644 memcheck/tests/reach_thread_register.stderr.exp-mips64 diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am index 610cee00d..abb636050 100644 --- a/memcheck/tests/Makefile.am +++ b/memcheck/tests/Makefile.am @@ -198,6 +198,8 @@ EXTRA_DIST = \ pointer-trace.stderr.exp \ post-syscall.stderr.exp post-syscall.vgtest \ reach_thread_register.stderr.exp reach_thread_register.vgtest \ + reach_thread_register.stderr.exp-mips32 \ + reach_thread_register.stderr.exp-mips64 \ realloc1.stderr.exp realloc1.vgtest \ realloc2.stderr.exp realloc2.vgtest \ realloc3.stderr.exp realloc3.vgtest \ diff --git a/memcheck/tests/reach_thread_register.stderr.exp-mips32 b/memcheck/tests/reach_thread_register.stderr.exp-mips32 new file mode 100644 index 000000000..3af0fe456 --- /dev/null +++ b/memcheck/tests/reach_thread_register.stderr.exp-mips32 @@ -0,0 +1,6 @@ +Abandoning the helper. +136 bytes in 1 blocks are definitely lost in loss record ... of ... + at 0x........: calloc (vg_replace_malloc.c:...) + ... + by 0x........: main (reach_thread_register.c:47) + diff --git a/memcheck/tests/reach_thread_register.stderr.exp-mips64 b/memcheck/tests/reach_thread_register.stderr.exp-mips64 new file mode 100644 index 000000000..560a57ca5 --- /dev/null +++ b/memcheck/tests/reach_thread_register.stderr.exp-mips64 @@ -0,0 +1,6 @@ +Abandoning the helper. +272 bytes in 1 blocks are definitely lost in loss record ... of ... + at 0x........: calloc (vg_replace_malloc.c:...) + ... + by 0x........: main (reach_thread_register.c:47) +