From owner-freebsd-current Mon Aug 17 22:36:53 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA02531 for freebsd-current-outgoing; Mon, 17 Aug 1998 22:36:53 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from dingo.cdrom.com ([203.8.14.118]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA02515 for ; Mon, 17 Aug 1998 22:36:50 -0700 (PDT) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (localhost.hilink.com.au [127.0.0.1] (may be forged)) by dingo.cdrom.com (8.8.8/8.8.8) with ESMTP id WAA12072; Mon, 17 Aug 1998 22:33:53 GMT (envelope-from mike@dingo.cdrom.com) Message-Id: <199808172233.WAA12072@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Thomas Dean cc: current@FreeBSD.ORG Subject: Re: Calloc or VM Problem In-reply-to: Your message of "Mon, 17 Aug 1998 22:20:56 MST." <199808180520.WAA00323@ix.netcom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 17 Aug 1998 22:33:53 +0000 From: Mike Smith Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Sounds like you've accidentally freed the list header at some point. > I noted some previous problems with calloc, and, thought they were > fixed. However, I seem to have a problem with calloc or vm. > > It appears that calloc is stomping on a structure. I collected some > numbers on calloc operations. After poking with gdb for a long time, > I found that some of the structure entries were changing around the > calloc statement. It always changed the same section of the > structure. I added some fixed value checks just to catch this > problem. The "frame changed" message was always the line after the > calloc. I changed calloc to malloc and the problem is the same. > > The process allocated a total of 1813088 bytes in 3713 operations. > > ========================================================================== > Here is the code fragment about the problem: (I xxxx'ed some names) > > listPtr = xxxxHeader->xxxxEntry; > > while(listPtr->entry != NULL) { > listPtr = listPtr->next; > } > > if (xxxxHeader->xxxxx.len != 653) { > print("frame changed to %d at line %d\n", > xxxxHeader->xxxxx.len, __LINE__); > } > > listPtr->entry= (Entry_t *) calloc((numEntries+1),sizeof(Entry_t)); > > if (xxxxHeader->xxxxx.len != 653) { > print("frame changed to %d at line %d\n", > xxxxHeader->xxxxx.len, __LINE__); > } > > ========================================================================== > # uname -a > FreeBSD celebris 3.0-CURRENT FreeBSD 3.0-CURRENT #1: Sat Aug 8 06:36:42 PDT1998 > > ========================================================================== > # dmesg > Copyright (c) 1982, 1986, 1989, 1991, 1993 > The Regents of the University of California. All rights reserved. > FreeBSD 3.0-CURRENT #1: Sat Aug 8 06:36:42 PDT 1998 > root@celebris:/usr/src/sys/compile/CELEBRIS-SMP > Timecounter "i8254" frequency 1193182 Hz cost 2540 ns > CPU: Pentium/P54C (586-class CPU) > Origin = "GenuineIntel" Id = 0x525 Stepping=5 > Features=0x3bf > real memory = 100663296 (98304K bytes) > avail memory = 95268864 (93036K bytes) > FreeBSD/SMP: Multiprocessor motherboard > cpu0 (BSP): apic id: 0, version: 0x00030010, at 0xfee00000 > cpu1 (AP): apic id: 1, version: 0x00030010, at 0xfee00000 > io0 (APIC): apic id: 2, version: 0x000f0011, at 0xfec00000 > Probing for devices on PCI bus 0: > chip0: rev0x11on pci0.0.0 > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-current" in the body of the message > -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message