Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S265289AbUF3JgO (ORCPT ); Wed, 30 Jun 2004 05:36:14 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S266598AbUF3JgN (ORCPT ); Wed, 30 Jun 2004 05:36:13 -0400 Received: from anchor-post-32.mail.demon.net ([194.217.242.90]:55564 "EHLO anchor-post-32.mail.demon.net") by vger.kernel.org with ESMTP id S265289AbUF3JgN (ORCPT ); Wed, 30 Jun 2004 05:36:13 -0400 From: jan@talentex.demon.co.uk To: linux-kernel@vger.kernel.org Subject: malloc overlap? Date: Wed, 30 Jun 2004 10:36:12 +0100 User-Agent: Demon-WebMail/2.0 MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1040 Lines: 14 This question is probably misplaced - sorry about that, but one has to start somewhere, and I think it isn't too far out. Here goes: I am developing a program that mallocs a struct, which contains a pointer to another struct, which gets malloced. Then I realloc the first buffer to be one element larger and assign something to an element in the second element - and this action overwrites part of the second level struct. After much tracing I am now sure that the buffers somehow have come to overlap. Is this a known error? I imagine that if the kernel had this kind of problem, it wouldn't run far, but surely memory allocation is handled in the kernel? I hope somebody can point me in the right direction - and thank you for helping! I am not on the list, so please reply directly. /jan - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/