valgrind errors (invalid read) on signtool -v

RESOLVED DUPLICATE of bug 485145

Status

RESOLVED DUPLICATE of bug 485145
9 years ago
9 years ago

People

(Reporter: wolfiR, Unassigned)

Tracking

3.12.3
All
Linux

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

9 years ago
I had erratic behaviour with some of the tests in the testsuite where "signtool -v" crashed (dumped core) for JAR and XPI.
Looking at the core files showed a probably broken stacktrace:

#0  0xb7be39d6 in raise () from /lib/libc.so.6
#1  0xb7be52d8 in abort () from /lib/libc.so.6
#2  0xb7c1fa25 in ?? () from /lib/libc.so.6
#3  0xb7c259c5 in ?? () from /lib/libc.so.6
#4  0xb7c2727b in free () from /lib/libc.so.6
#5  0xb7d45ab7 in PR_Free () from /usr/lib/libnspr4.so
#6  0xb7d89f41 in PORT_Free_Util (ptr=0x0) at secport.c:152
#7  0x0805b146 in jar_extract_mf (jar=0x8091f90, format=<value optimized out>, 
    fp=0x8092048, ext=0x806a210 "sf") at jarfile.c:737
#8  0x0805b5b2 in jar_extract_manifests (fp=<value optimized out>, 
    format=<value optimized out>, jar=<value optimized out>) at jarfile.c:611
#9  JAR_pass_archive (jar=0x8091f90, format=jarArchZip, 
    filename=0x80795c8 "nojs.jar", url=0x806c5f1 "some-url") at jarfile.c:134
#10 0x08057c32 in VerifyJar (filename=0x80795c8 "nojs.jar") at verify.c:74
#11 0x0804e7fe in main (argc=9, argv=0xbfa54424) at signtool.c:1007

#6  0xb7d89f41 in PORT_Free_Util (ptr=0x0) at secport.c:152
is apparently wrong and caused by earlier corruption.

So I ran the test in valgrind with the following result:

signtool -v nojs.jar -d ../alicedir -p nss -k objsigner
==22799== Memcheck, a memory error detector.
==22799== Copyright (C) 2002-2008, and GNU GPL'd, by Julian Seward et al.
==22799== Using LibVEX rev 1884, a library for dynamic binary translation.
==22799== Copyright (C) 2004-2008, and GNU GPL'd, by OpenWorks LLP.
==22799== Using valgrind-3.4.1, a dynamic binary instrumentation framework.
==22799== Copyright (C) 2000-2008, and GNU GPL'd, by Julian Seward et al.
==22799== For more details, rerun with: -v
==22799== 
==22799== Invalid read of size 4
==22799==    at 0x4016F97: (within /lib/ld-2.9.so)
==22799==  Address 0x43af9b0 is 96 bytes inside a block of size 98 alloc'd
==22799==    at 0x402807E: malloc (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==22799==    by 0x4205D47: PR_Malloc (in /usr/lib/libnspr4.so)
==22799==    by 0x41DE167: PORT_Alloc_Util (secport.c:113)
==22799==    by 0x40D87D3: loader_LoadLibInReferenceDir (genload.c:118)
==22799==    by 0x40D8884: loader_LoadLibrary (genload.c:159)
==22799==    by 0x40D8A43: softoken_LoadDSO (pk11load.c:249)
==22799==    by 0x420C282: PR_CallOnce (in /usr/lib/libnspr4.so)
==22799==    by 0x40D928F: SECMOD_LoadPKCS11Module (pk11load.c:279)
==22799==    by 0x40ECB9A: SECMOD_LoadModule (pk11pars.c:323)
==22799==    by 0x40B8DE1: nss_Init (nssinit.c:536)
==22799==    by 0x40B94D8: NSS_Init (nssinit.c:588)
==22799==    by 0x80564EF: InitCrypto (util.c:931)
==22799== 
==22799== Invalid read of size 1
==22799==    at 0x805B852: jar_eat_line (jarver.c:907)
==22799==    by 0x805BD45: jar_digest_section (jarver.c:954)
==22799==    by 0x805CE55: jar_parse_any (jarver.c:531)
==22799==    by 0x805D31C: jar_parse_mf (jarver.c:275)
==22799==    by 0x805D963: JAR_parse_manifest (jarver.c:171)
==22799==    by 0x805B138: jar_extract_mf (jarfile.c:734)
==22799==    by 0x805B570: JAR_pass_archive (jarfile.c:607)
==22799==    by 0x8057C31: VerifyJar (verify.c:74)
==22799==    by 0x804E7FD: main (signtool.c:1007)
==22799==  Address 0x43dc24c is 0 bytes after a block of size 380 alloc'd
==22799==    at 0x4026132: calloc (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==22799==    by 0x4205FB9: PR_Calloc (in /usr/lib/libnspr4.so)
==22799==    by 0x41DDF7F: PORT_ZAlloc_Util (secport.c:140)
==22799==    by 0x805B1D7: jar_extract_mf (jarfile.c:485)
==22799==    by 0x805B570: JAR_pass_archive (jarfile.c:607)
==22799==    by 0x8057C31: VerifyJar (verify.c:74)
==22799==    by 0x804E7FD: main (signtool.c:1007)
==22799== 
==22799== Invalid read of size 1
==22799==    at 0x805BD46: jar_digest_section (jarver.c:955)
==22799==    by 0x805CE55: jar_parse_any (jarver.c:531)
==22799==    by 0x805D31C: jar_parse_mf (jarver.c:275)
==22799==    by 0x805D963: JAR_parse_manifest (jarver.c:171)
==22799==    by 0x805B138: jar_extract_mf (jarfile.c:734)
==22799==    by 0x805B570: JAR_pass_archive (jarfile.c:607)
==22799==    by 0x8057C31: VerifyJar (verify.c:74)
==22799==    by 0x804E7FD: main (signtool.c:1007)
==22799==  Address 0x43dc24c is 0 bytes after a block of size 380 alloc'd
==22799==    at 0x4026132: calloc (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==22799==    by 0x4205FB9: PR_Calloc (in /usr/lib/libnspr4.so)
==22799==    by 0x41DDF7F: PORT_ZAlloc_Util (secport.c:140)
==22799==    by 0x805B1D7: jar_extract_mf (jarfile.c:485)
==22799==    by 0x805B570: JAR_pass_archive (jarfile.c:607)
==22799==    by 0x8057C31: VerifyJar (verify.c:74)
==22799==    by 0x804E7FD: main (signtool.c:1007)
==22799== 
==22799== Invalid read of size 1
==22799==    at 0x805B872: jar_eat_line (jarver.c:907)
==22799==    by 0x805C98F: jar_parse_any (jarver.c:540)
==22799==    by 0x805D31C: jar_parse_mf (jarver.c:275)
==22799==    by 0x805D963: JAR_parse_manifest (jarver.c:171)
==22799==    by 0x805B138: jar_extract_mf (jarfile.c:734)
==22799==    by 0x805B570: JAR_pass_archive (jarfile.c:607)
==22799==    by 0x8057C31: VerifyJar (verify.c:74)
==22799==    by 0x804E7FD: main (signtool.c:1007)
==22799==  Address 0x43dc24c is 0 bytes after a block of size 380 alloc'd
==22799==    at 0x4026132: calloc (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==22799==    by 0x4205FB9: PR_Calloc (in /usr/lib/libnspr4.so)
==22799==    by 0x41DDF7F: PORT_ZAlloc_Util (secport.c:140)
==22799==    by 0x805B1D7: jar_extract_mf (jarfile.c:485)
==22799==    by 0x805B570: JAR_pass_archive (jarfile.c:607)
==22799==    by 0x8057C31: VerifyJar (verify.c:74)
==22799==    by 0x804E7FD: main (signtool.c:1007)
==22799== 
==22799== Invalid read of size 1
==22799==    at 0x805B890: jar_eat_line (jarver.c:918)
==22799==    by 0x805C98F: jar_parse_any (jarver.c:540)
==22799==    by 0x805D31C: jar_parse_mf (jarver.c:275)
==22799==    by 0x805D963: JAR_parse_manifest (jarver.c:171)
==22799==    by 0x805B138: jar_extract_mf (jarfile.c:734)
==22799==    by 0x805B570: JAR_pass_archive (jarfile.c:607)
==22799==    by 0x8057C31: VerifyJar (verify.c:74)
==22799==    by 0x804E7FD: main (signtool.c:1007)
==22799==  Address 0x43dc24c is 0 bytes after a block of size 380 alloc'd
==22799==    at 0x4026132: calloc (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==22799==    by 0x4205FB9: PR_Calloc (in /usr/lib/libnspr4.so)
==22799==    by 0x41DDF7F: PORT_ZAlloc_Util (secport.c:140)
==22799==    by 0x805B1D7: jar_extract_mf (jarfile.c:485)
==22799==    by 0x805B570: JAR_pass_archive (jarfile.c:607)
==22799==    by 0x8057C31: VerifyJar (verify.c:74)
==22799==    by 0x804E7FD: main (signtool.c:1007)
==22799== 
==22799== Invalid read of size 1
==22799==    at 0x805B8B8: jar_eat_line (jarver.c:928)
==22799==    by 0x805C98F: jar_parse_any (jarver.c:540)
==22799==    by 0x805D31C: jar_parse_mf (jarver.c:275)
==22799==    by 0x805D963: JAR_parse_manifest (jarver.c:171)
==22799==    by 0x805B138: jar_extract_mf (jarfile.c:734)
==22799==    by 0x805B570: JAR_pass_archive (jarfile.c:607)
==22799==    by 0x8057C31: VerifyJar (verify.c:74)
==22799==    by 0x804E7FD: main (signtool.c:1007)
==22799==  Address 0x43dc24c is 0 bytes after a block of size 380 alloc'd
==22799==    at 0x4026132: calloc (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==22799==    by 0x4205FB9: PR_Calloc (in /usr/lib/libnspr4.so)
==22799==    by 0x41DDF7F: PORT_ZAlloc_Util (secport.c:140)
==22799==    by 0x805B1D7: jar_extract_mf (jarfile.c:485)
==22799==    by 0x805B570: JAR_pass_archive (jarfile.c:607)
==22799==    by 0x8057C31: VerifyJar (verify.c:74)
==22799==    by 0x804E7FD: main (signtool.c:1007)
==22799== 
==22799== Invalid read of size 1
==22799==    at 0x805C996: jar_parse_any (jarver.c:541)
==22799==    by 0x805D31C: jar_parse_mf (jarver.c:275)
==22799==    by 0x805D963: JAR_parse_manifest (jarver.c:171)
==22799==    by 0x805B138: jar_extract_mf (jarfile.c:734)
==22799==    by 0x805B570: JAR_pass_archive (jarfile.c:607)
==22799==    by 0x8057C31: VerifyJar (verify.c:74)
==22799==    by 0x804E7FD: main (signtool.c:1007)
==22799==  Address 0x43dc24c is 0 bytes after a block of size 380 alloc'd
==22799==    at 0x4026132: calloc (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==22799==    by 0x4205FB9: PR_Calloc (in /usr/lib/libnspr4.so)
==22799==    by 0x41DDF7F: PORT_ZAlloc_Util (secport.c:140)
==22799==    by 0x805B1D7: jar_extract_mf (jarfile.c:485)
==22799==    by 0x805B570: JAR_pass_archive (jarfile.c:607)
==22799==    by 0x8057C31: VerifyJar (verify.c:74)
==22799==    by 0x804E7FD: main (signtool.c:1007)
==22799== 
==22799== Invalid read of size 1
==22799==    at 0x805B872: jar_eat_line (jarver.c:907)
==22799==    by 0x805C98F: jar_parse_any (jarver.c:540)
==22799==    by 0x805D4F8: jar_parse_sf (jarver.c:338)
==22799==    by 0x805D93B: JAR_parse_manifest (jarver.c:175)
==22799==    by 0x805B138: jar_extract_mf (jarfile.c:734)
==22799==    by 0x805B5B1: JAR_pass_archive (jarfile.c:611)
==22799==    by 0x8057C31: VerifyJar (verify.c:74)
==22799==    by 0x804E7FD: main (signtool.c:1007)
==22799==  Address 0x43e0858 is 0 bytes after a block of size 488 alloc'd
==22799==    at 0x4026132: calloc (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==22799==    by 0x4205FB9: PR_Calloc (in /usr/lib/libnspr4.so)
==22799==    by 0x41DDF7F: PORT_ZAlloc_Util (secport.c:140)
==22799==    by 0x805B1D7: jar_extract_mf (jarfile.c:485)
==22799==    by 0x805B5B1: JAR_pass_archive (jarfile.c:611)
==22799==    by 0x8057C31: VerifyJar (verify.c:74)
==22799==    by 0x804E7FD: main (signtool.c:1007)
==22799== 
==22799== Invalid read of size 1
==22799==    at 0x805B890: jar_eat_line (jarver.c:918)
==22799==    by 0x805C98F: jar_parse_any (jarver.c:540)
==22799==    by 0x805D4F8: jar_parse_sf (jarver.c:338)
==22799==    by 0x805D93B: JAR_parse_manifest (jarver.c:175)
==22799==    by 0x805B138: jar_extract_mf (jarfile.c:734)
==22799==    by 0x805B5B1: JAR_pass_archive (jarfile.c:611)
==22799==    by 0x8057C31: VerifyJar (verify.c:74)
==22799==    by 0x804E7FD: main (signtool.c:1007)
==22799==  Address 0x43e0858 is 0 bytes after a block of size 488 alloc'd
==22799==    at 0x4026132: calloc (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==22799==    by 0x4205FB9: PR_Calloc (in /usr/lib/libnspr4.so)
==22799==    by 0x41DDF7F: PORT_ZAlloc_Util (secport.c:140)
==22799==    by 0x805B1D7: jar_extract_mf (jarfile.c:485)
==22799==    by 0x805B5B1: JAR_pass_archive (jarfile.c:611)
==22799==    by 0x8057C31: VerifyJar (verify.c:74)
==22799==    by 0x804E7FD: main (signtool.c:1007)
==22799== 
==22799== Invalid read of size 1
==22799==    at 0x805B8B8: jar_eat_line (jarver.c:928)
==22799==    by 0x805C98F: jar_parse_any (jarver.c:540)
==22799==    by 0x805D4F8: jar_parse_sf (jarver.c:338)
==22799==    by 0x805D93B: JAR_parse_manifest (jarver.c:175)
==22799==    by 0x805B138: jar_extract_mf (jarfile.c:734)
==22799==    by 0x805B5B1: JAR_pass_archive (jarfile.c:611)
==22799==    by 0x8057C31: VerifyJar (verify.c:74)
==22799==    by 0x804E7FD: main (signtool.c:1007)
==22799==  Address 0x43e0858 is 0 bytes after a block of size 488 alloc'd
==22799==    at 0x4026132: calloc (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==22799==    by 0x4205FB9: PR_Calloc (in /usr/lib/libnspr4.so)
==22799==    by 0x41DDF7F: PORT_ZAlloc_Util (secport.c:140)
==22799==    by 0x805B1D7: jar_extract_mf (jarfile.c:485)
==22799==    by 0x805B5B1: JAR_pass_archive (jarfile.c:611)
==22799==    by 0x8057C31: VerifyJar (verify.c:74)
==22799==    by 0x804E7FD: main (signtool.c:1007)
==22799== 
==22799== Invalid read of size 1
==22799==    at 0x805C996: jar_parse_any (jarver.c:541)
==22799==    by 0x805D4F8: jar_parse_sf (jarver.c:338)
==22799==    by 0x805D93B: JAR_parse_manifest (jarver.c:175)
==22799==    by 0x805B138: jar_extract_mf (jarfile.c:734)
==22799==    by 0x805B5B1: JAR_pass_archive (jarfile.c:611)
==22799==    by 0x8057C31: VerifyJar (verify.c:74)
==22799==    by 0x804E7FD: main (signtool.c:1007)
==22799==  Address 0x43e0858 is 0 bytes after a block of size 488 alloc'd
==22799==    at 0x4026132: calloc (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==22799==    by 0x4205FB9: PR_Calloc (in /usr/lib/libnspr4.so)
==22799==    by 0x41DDF7F: PORT_ZAlloc_Util (secport.c:140)
==22799==    by 0x805B1D7: jar_extract_mf (jarfile.c:485)
==22799==    by 0x805B5B1: JAR_pass_archive (jarfile.c:611)
==22799==    by 0x8057C31: VerifyJar (verify.c:74)
==22799==    by 0x804E7FD: main (signtool.c:1007)
The many sins of jar_eat_lite are well known.
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 485145
You need to log in before you can comment on or make changes to this bug.