Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Jan 1996 14:41:36 -0600 (CST)
From:      Lars Fredriksen <fredriks@mcs.com>
To:        current@freebsd.org
Subject:   malloc bug in current?
Message-ID:  <199601042041.OAA29400@fredriks.pr.mcs.net>

next in thread | raw e-mail | index | archive | help
Hi,
	Pax kept blowing up on me in free() so I started looking at tit a bit.
It looks like there is a slight bug in malloc.c. 

-------------------------------------------------------------------------------
*** malloc.c.orig	Thu Jan  4 08:45:03 1996
--- malloc.c	Thu Jan  4 08:45:06 1996
***************
*** 957,963 ****
  
      /* Count how many pages and mark them free at the same time */
      page_dir[index] = MALLOC_FREE;
!     for (i = 1; page_dir[index+i] == MALLOC_FOLLOW; i++)
  	page_dir[index + i] = MALLOC_FREE;
  
      l = i << malloc_pageshift;
--- 957,963 ----
  
      /* Count how many pages and mark them free at the same time */
      page_dir[index] = MALLOC_FREE;
!     for (i = 1; (index < last_index) && (page_dir[index+i] == MALLOC_FOLLOW); i++)
  	page_dir[index + i] = MALLOC_FREE;
  
      l = i << malloc_pageshift;
-------------------------------------------------------------------------------

The problem was( I think) that index+i went past last_index which caused a 
SIGSEGV. With the above fix my backups now works again. :-)

Lars



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199601042041.OAA29400>