Subject: Re: malloc and printf() Qs.
To: Cherry G. Mathew <>
From: David Brownlee <>
List: tech-userlevel
Date: 04/15/2007 22:39:15
On Sun, 15 Apr 2007, Cherry G. Mathew wrote:

> Hi,
> So I recently moved a buggy userland program that was running fine on
> -current to Linux, which proceeded to SIGSEGV. I traced it down to
> overflowing sprintfs() into (consecutive) malloc()ed buffers. I'm a
> bit shocked that it didn't tell me about it on NetBSD. Is this by
> design ?

 	Such warning are a tradeoff against performance. Different
 	malloc libraries are likely to crash based on differing
 	incorrect usage. On NetBSD setting MALLOC_OPTIONS (see
 	malloc(3)) can help pickup some issues, but linking against
 	something like devel/dmalloc while developing is a much
 	better plan

 		David/absolute       -- No hype required --