mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Garfycx <garfycx@garfycx.net>
To: linux-kernel@vger.kernel.org
Subject: problems with memory allocation
Date: 16 Nov 2001 20:28:08 +0100	[thread overview]
Message-ID: <1005938890.23493.2.camel@-f> (raw)

Help!

I have some trouble with seg faults when allocating memory, and am too
confused by that to find the right culprit...

I created a linked list (with a FOR loop and same conditions for each
element) and got a seg fault at 10th element. May happen, but now
happens since days and always at the same 10th element. I tried around a
bit to find out what could be the problem and stranded with an
experiment:

I wrote a loop from 0 to 100 and allocated memory with calloc to a char
pointer each loop (at same place in code to keep it comparable):

for (i = 0; i <= 100; i++){
	char pointer = (cast) calloc(1,bytes);
	printf("hier (means 'here' in german)\n");
}

I got seg faults till up to 100 bytes per allocation at always the same
overall allocated memory size (bytes * loops) (malloc, instead, works
fine but using the faulty memory leads to seg fault too). When
allocating 1000 bytes each loop I got no error. To me this means that
there are some small faulty rests in memory that were overjumped when
allocating more memory at once. But because I can overfill my memory
with applications without any seg fault, and the error is always
strictly the same (even after boot and with different amount of products
running), I can't believe that it is my hardware. At least, other
products don't step into this problem. May it be the vm?

I use glibc 2.2.4 and gcc 2.95.3 on linux 2.4.13. I tried to compile
2.4.14 but got an installation error:

ld -m elf_i386 -T /usr/src/linux/arch/i386/vmlinux.lds -e stext
arch/i386/kernel/head.o arch/i386/kernel/init_task.o init/main.o
init/version.o \
	--start-group \
	arch/i386/kernel/kernel.o arch/i386/mm/mm.o kernel/kernel.o mm/mm.o
fs/fs.o ipc/ipc.o \
	 drivers/parport/driver.o drivers/char/char.o drivers/block/block.o
drivers/misc/misc.o drivers/net/net.o drivers/media/media.o
drivers/char/agp/agp.o drivers/char/drm/drm.o drivers/atm/atm.o
drivers/ide/idedriver.o drivers/scsi/scsidrv.o drivers/cdrom/driver.o
drivers/sound/sounddrivers.o drivers/pci/driver.o drivers/video/video.o
drivers/input/inputdrv.o drivers/message/i2o/i2o.o drivers/i2c/i2c.o \
	net/network.o \
	/usr/src/linux/arch/i386/lib/lib.a /usr/src/linux/lib/lib.a
/usr/src/linux/arch/i386/lib/lib.a \
	--end-group \
	-o vmlinux
drivers/block/block.o: In function `lo_send':
drivers/block/block.o(.text+0xa853): undefined reference to
`deactivate_page'
drivers/block/block.o(.text+0xa895): undefined reference to
`deactivate_page'
make: *** [vmlinux] Error 1


The patch nr.5 for 2.4.15pre gives another compilation error:

setup.c: In function `c_start':
setup.c:2791: subscripted value is neither array nor pointer
setup.c:2792: warning: control reaches end of non-void function
make[1]: *** [setup.o] Error 1
make[1]: Leaving directory `/usr/src/linux/arch/i386/kernel'
make: *** [_dir_arch/i386/kernel] Error 2






                 reply	other threads:[~2001-11-16 19:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1005938890.23493.2.camel@-f \
    --to=garfycx@garfycx.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®