Bug 117899 - Valgrind crashes on calloc's
Summary: Valgrind crashes on calloc's
Status: RESOLVED NOT A BUG
Alias: None
Product: valgrind
Classification: Developer tools
Component: memcheck (show other bugs)
Version: unspecified
Platform: Unlisted Binaries FreeBSD
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-07 22:47 UTC by Michael C. Shultz
Modified: 2005-12-08 19:30 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael C. Shultz 2005-12-07 22:47:54 UTC
First, valgrind --version only brings up the help page,  
which clearly states --version is the right command to use but fails to list 
the version.  In FreeBSD the  
version is installed as valgrind-352_5, hope  
that helps.  
  
valgrind seems to be crashing on start up over a routine that is  
called several times over these lines, specifically it seems to be  
the line with calloc:  
  
/* bufferSize will be random sizes */  
bufferSize	= MGrFileSize( contentsFileName );  
buffer		= calloc( bufferSize, 1 );  
free( buffer );  
  
Here is the valgrind reposrt:  
  
==18803== Memcheck, a memory error detector for x86-linux.  
==18803== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward.  
==18803== Using valgrind-2.1.0, a program supervision framework for x86-linux.  
==18803== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward.  
==18803== Valgrind library directory: /usr/local/lib/valgrind  
==18803== Command line  
==18803==    portmanager  
==18803==    -u  
==18803==    -l  
==18803==    -p  
==18803==    -ui  
==18803== Startup, with flags:  
==18803==    --tool=memcheck  
==18803==    -v  
==18803==    --gen-suppressions=yes  
==18803== Reading syms from /usr/local/bin/portmanager (0x8048000)  
==18803== Reading syms from /usr/local/bin/portmanager (0x8049000)  
==18803== Reading syms from /libexec/ld-elf.so.1 (0x3C000000)  
==18803==    object doesn't have a symbol table  
==18803==    object doesn't have any debug info  
==18803== Reading syms from /libexec/ld-elf.so.1 (0xB0000000)  
==18803==    object doesn't have a symbol table  
==18803==    object doesn't have any debug info  
==18803== Reading syms from /lib/libc.so.5 (0xB002F000)  
==18803==    object doesn't have a symbol table  
==18803==    object doesn't have any debug info  
==18803== Reading syms from /usr/local/lib/valgrind/vgskin_memcheck.so 
(0xB011D000)  
==18803==    object doesn't have a symbol table  
==18803==    object doesn't have any debug info  
==18803== Reading syms from /usr/local/lib/valgrind/stage2 (0xB8000000)  
==18803==    object doesn't have a symbol table  
==18803==    object doesn't have any debug info  
==18803== Reading suppressions file: /usr/local/lib/valgrind/default.supp  
==18803== Estimated CPU clock rate is 1704 MHz  
==18803== REDIRECT soname:libc.so.6(__GI___errno_location) to 
soname:libpthread.so.0(__errno_location)  
==18803== REDIRECT soname:libc.so.6(__errno_location) to soname:libpthread.so.0
(__errno_location)  
==18803== REDIRECT soname:libc.so.6(__GI___h_errno_location) to 
soname:libpthread.so.0(__h_errno_location)  
==18803== REDIRECT soname:libc.so.6(__h_errno_location) to 
soname:libpthread.so.0(__h_errno_location)  
==18803== REDIRECT soname:libc.so.6(__GI___res_state) to soname:libpthread.so.0
(__res_state)  
==18803== REDIRECT soname:libc.so.6(__res_state) to soname:libpthread.so.0
(__res_state)  
==18803== REDIRECT soname:libc.so.6(stpcpy) to *vgpreload_memcheck.so*(stpcpy)  
==18803== REDIRECT soname:libc.so.6(strnlen) to 
*vgpreload_memcheck.so*(strnlen)  
==18803== REDIRECT soname:ld-linux.so.2(stpcpy) to 
*vgpreload_memcheck.so*(stpcpy)  
==18803== REDIRECT soname:ld-linux.so.2(strchr) to 
*vgpreload_memcheck.so*(strchr)  
==18803==  
==18803== Reading syms from /usr/local/lib/valgrind/vg_inject.so (0x3C031000)  
==18803==    object doesn't have a symbol table  
==18803==    object doesn't have any debug info  
==18803== Reading syms from /usr/local/lib/valgrind/vgpreload_memcheck.so 
(0x3C034000)  
==18803==    object doesn't have a symbol table  
==18803==    object doesn't have any debug info  
==18803== Reading syms from /usr/local/lib/libMG.so.2 (0x3C03A000)  
==18803== Reading syms from /usr/local/lib/libMGPM.so.1 (0x3C041000)  
==18803== Reading syms from /lib/libc.so.5 (0x3C059000)  
==18803==    object doesn't have a symbol table  
==18803==    object doesn't have any debug info  
  
valgrind: vg_malloc2.c:1008 (vgPlain_arena_malloc): Assertion `new_sb != 
((void*)0)' failed.  
==18803==    at 0xB802BE83: (within /usr/local/lib/valgrind/stage2)  
==18803==    by 0xB802BE82: (within /usr/local/lib/valgrind/stage2)  
==18803==    by 0xB802BEC1: vgPlain_core_assert_fail 
(in /usr/local/lib/valgrind/stage2)  
==18803==    by 0xB80280F1: vgPlain_arena_malloc 
(in /usr/local/lib/valgrind/stage2)  
  
sched status:  
  
Thread 1: status = Runnable, associated_mx = 0x0, associated_cv = 0x0  
==18803==    at 0x3C03695B: calloc 
(in /usr/local/lib/valgrind/vgpreload_memcheck.so)  
==18803==    by 0x3C047F4C: rCreateInstalledDbVerifyContentsFile 
(MGPMrCreateInstalledDb.c:384)  
==18803==    by 0x3C048483: MGPMrCreateInstalledDb 
(MGPMrCreateInstalledDb.c:115)  
==18803==    by 0x3C04B9ED: MGPMrReadConfigure (MGPMrReadConfigure.c:94)  
  
  
Note: see also the FAQ.txt in the source distribution.  
It contains workarounds to several common problems.  
  
If that doesn't help, please report this bug to: valgrind.kde.org  
  
In the bug report, send all the above text, the valgrind  
version, and what Linux distro you are using.  Thanks.  
  
I'm happy to provide any other information you may need, just ask. 
  
Mike<ringworm01@gmail.com>
Comment 1 Nicholas Nethercote 2005-12-08 18:09:01 UTC
Version 2.1.0 is 2 years old.  These problems have almost certainly been fixed (I remember fixing a calloc problem a while back, you can search through the bug database for it).

I understand you're using the FreeBSD port which is based on 2.1.0, but we can't help you with that.  Please tell the authors of the port if you want this fixed.
Comment 2 Michael C. Shultz 2005-12-08 19:30:06 UTC
On Thursday 08 December 2005 09:09, Nicholas Nethercote wrote:
[bugs.kde.org quoted mail]

Will, do, forwarding this reply to him.

-Mike