From owner-freebsd-current Mon Aug 17 22:21:35 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA01300 for freebsd-current-outgoing; Mon, 17 Aug 1998 22:21:35 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from ix.netcom.com (sil-wa4-33.ix.netcom.com [207.93.136.97]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA01293 for ; Mon, 17 Aug 1998 22:21:31 -0700 (PDT) (envelope-from tomdean@ix.netcom.com) Received: (from tomdean@localhost) by ix.netcom.com (8.9.1/8.8.8) id WAA00323; Mon, 17 Aug 1998 22:20:56 -0700 (PDT) (envelope-from tomdean) Date: Mon, 17 Aug 1998 22:20:56 -0700 (PDT) Message-Id: <199808180520.WAA00323@ix.netcom.com> From: Thomas Dean To: current@FreeBSD.ORG Subject: Calloc or VM Problem Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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