Subject: Re: malloc and printf() Qs.
To: Cherry G. Mathew <email@example.com>
From: David Brownlee <abs@NetBSD.org>
Date: 04/15/2007 22:39:15
On Sun, 15 Apr 2007, Cherry G. Mathew wrote:
> 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
David/absolute -- www.NetBSD.org: No hype required --