Bug#810295: WARNING: Serious error when reading debug info

2016-07-14 Thread Martin Schwenke
On Sun, 19 Jun 2016 17:50:14 + Max Dmitrichenko
 wrote:
> Package: valgrind
> Version: 1:3.11.0-1
> Followup-For: Bug #810295
> 
> Please find a debdiff in attachment. Backported from the upstream.

Thanks, this seems to work for me!

Is anyone able to build and upload?

Thanks...

peace & happiness,
martin



Bug#810295: WARNING: Serious error when reading debug info

2016-06-19 Thread Max Dmitrichenko
Package: valgrind
Version: 1:3.11.0-1
Followup-For: Bug #810295

Please find a debdiff in attachment. Backported from the upstream.

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect

Versions of packages valgrind depends on:
ii  libc6  2.22-11
ii  libc6-dbg  2.22-11

Versions of packages valgrind recommends:
ii  gdb   7.10-1.1
ii  valgrind-dbg  1:3.11.0-1

Versions of packages valgrind suggests:
pn  alleyoop  
pn  kcachegrind   
pn  valgrind-mpi  
pn  valkyrie  

-- no debconf information
diff -Nru valgrind-3.11.0/debian/changelog valgrind-3.11.0/debian/changelog
--- valgrind-3.11.0/debian/changelog	2015-09-25 11:41:20.0 +
+++ valgrind-3.11.0/debian/changelog	2016-06-19 00:01:35.0 +
@@ -1,3 +1,10 @@
+valgrind (1:3.11.0-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add 15_compressed.patch - support compressed debug info (closes: #810295)
+
+ -- Max Dmitrichenko   Sat, 18 Jun 2016 23:32:04 +
+
 valgrind (1:3.11.0-1) unstable; urgency=medium
 
   * New upstream release (Closes: #800013)
diff -Nru valgrind-3.11.0/debian/patches/15_compressed.patch valgrind-3.11.0/debian/patches/15_compressed.patch
--- valgrind-3.11.0/debian/patches/15_compressed.patch	1970-01-01 00:00:00.0 +
+++ valgrind-3.11.0/debian/patches/15_compressed.patch	2016-06-19 00:19:52.0 +
@@ -0,0 +1,1990 @@
+--- a/NEWS
 b/NEWS
+@@ -36,6 +36,10 @@
+ * Intel AVX2 support is more complete (64 bit targets only).  On AVX2
+   capable hosts, the simulated CPUID will now indicate AVX2 support.
+ 
++* Valgrind is able to read compressed debuginfo sections in two formats:
++  - zlib ELF gABI format with SHF_COMPRESSED flag (gcc option -gz=zlib)
++  - zlib GNU format with .zdebug sections (gcc option -gz=zlib-gnu)
++
+ *  TOOL CHANGES 
+ 
+ * Memcheck:
+@@ -197,6 +201,7 @@
+ 269360  s390x: Fix addressing mode selection for compare-and-swap
+ 302630  Memcheck: Assertion failed: 'sizeof(UWord) == sizeof(UInt)'
+ == 326797
++303877  valgrind doesn't support compressed debuginfo sections
+ 312989  ioctl handling needs to do POST handling on generic ioctls and [..]
+ 319274  Fix unhandled syscall: unix:410 (sigsuspend_nocancel) on OS X
+ 324181  mmap does not handle MAP_32BIT (handle it now, rather than fail it)
+--- a/configure.ac
 b/configure.ac
+@@ -1202,6 +1202,11 @@
+ ])
+ 
+ 
++# Check for ELF32/64_CHDR
++ 
++AC_CHECK_TYPES([Elf32_Chdr, Elf64_Chdr], [], [], [[#include ]])
++
++
+ # Check for PTHREAD_RWLOCK_T
+ 
+ AC_MSG_CHECKING([for pthread_rwlock_t])
+@@ -2076,6 +2081,45 @@
+ CFLAGS=$safe_CFLAGS
+ 
+ 
++# does this compiler support -g -gz=zlib ?
++
++AC_MSG_CHECKING([if gcc accepts -g -gz=zlib])
++
++safe_CFLAGS=$CFLAGS
++CFLAGS="-g -gz=zlib"
++
++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
++  return 0;
++]])], [
++ac_have_gz_zlib=yes
++AC_MSG_RESULT([yes])
++], [
++ac_have_gz_zlib=no
++AC_MSG_RESULT([no])
++])
++AM_CONDITIONAL(GZ_ZLIB, test x$ac_have_gz_zlib = xyes)
++CFLAGS=$safe_CFLAGS
++
++
++# does this compiler support -g -gz=zlib-gnu ?
++
++AC_MSG_CHECKING([if gcc accepts -g -gz=zlib-gnu])
++
++safe_CFLAGS=$CFLAGS
++CFLAGS="-g -gz=zlib-gnu"
++
++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
++  return 0;
++]])], [
++ac_have_gz_zlib_gnu=yes
++AC_MSG_RESULT([yes])
++], [
++ac_have_gz_zlib_gnu=no
++AC_MSG_RESULT([no])
++])
++AM_CONDITIONAL(GZ_ZLIB_GNU, test x$ac_have_gz_zlib_gnu = xyes)
++CFLAGS=$safe_CFLAGS
++
+ # does this compiler support nested functions ?
+ 
+ AC_MSG_CHECKING([if gcc accepts nested functions])
+@@ -3386,6 +3430,9 @@
+ ])
+ AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR, test x$solaris_reserve_sysstat_zone_addr = xyes)
+ 
++AC_CHECK_TYPES([Elf32_Chdr, Elf64_Chdr], [], [], [[#include ]])
++
++
+ else
+ AM_CONDITIONAL(SOLARIS_SUN_STUDIO_AS, false)
+ AM_CONDITIONAL(SOLARIS_XPG_SYMBOLS_PRESENT, false)
+--- a/coregrind/Makefile.am
 b/coregrind/Makefile.am
+@@ -348,6 +348,7 @@
+ 	m_debuginfo/readmacho.c \
+ 	m_debuginfo/readpdb.c \
+ 	m_debuginfo/storage.c \
++	m_debuginfo/tinfl.c \
+ 	m_debuginfo/tytypes.c \
+ 	m_demangle/cp-demangle.c \
+ 	m_demangle/cplus-dem.c \
+--- a/coregrind/m_debuginfo/image.c
 b/coregrind/m_debuginfo/image.c
+@@ -45,6 +45,8 @@
+ #include "priv_image.h"/* self */
+ 
+ #include "minilzo.h"
++#define TINFL_HEADER_FILE_ONLY
++#include "tinfl.c"
+ 
+ /* These values (1024 entries of 8192 bytes each) gives a cache
+size of 8MB. */
+@@ -53,15 +55,29 @@
+ 
+ #define CACHE_ENTRY_SIZE  (1 << CACHE_ENTRY_SIZE_BITS)
+ 
++#define COMMPRESSED_SLICE_ARRAY_GROW_SIZE 64
++
+ /* An entry in the cache. */
+ typedef
+struct {
+-  DiOffT off; // file offset for data[0]
+-  SizeT  used; // 1 .. sizeof(