Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Aug 1998 22:20:56 -0700 (PDT)
From:      Thomas Dean <tomdean@ix.netcom.com>
To:        current@FreeBSD.ORG
Subject:   Calloc or VM Problem
Message-ID:  <199808180520.WAA00323@ix.netcom.com>

next in thread | raw e-mail | index | archive | help
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 <snipped>
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<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8,APIC>
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: <Intel 82434NX (Neptune) PCI cache memory controller>rev0x11on pci0.0.0


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199808180520.WAA00323>