>Prav tako strukture. Moje pojasnilo samemu sebi zakaj je zadeva delala, ko
>se imel strukturo dolgo 16 bytov je to, da je pri toliko daljsi strukturi
>potrebno rezervirati vec rama in se naslov elementa in strukture nista
>nikdar pokrila in ni prislo do dvojnega free()ja.

Ce je to res, da se to dogaja ce free-jas vekrat isti naslov, potem je to
verjetno problem kernela, libc-ja ali pa samga gcc-ja. Vse poskusi
posodobiti, potem pa se enkrat poskusi. Se prej pa poglej na gcc faq oz.
bugs listah. Sigurno nisi edini s tem problemom, tam pa pise kako se
izogniti temu problemu. Drugace pa, kaj ce bi povecas velikost strukture za
kaksen dummy bajt. Tako bi bili strukturi razlicno veliki in naj ne bi
prislo do napake.

Matej

oglej si se tole:

FROM: Eva Schroeter
DATE: 11/28/1994 21:30:22
SUBJECT:  linux/gcc malloc problem
 I have problems with a program that makes frequent malloc/calloc calls,
it produces corrupt data and segmentation faults. I am using linux 1.1.31
and gcc 2.5.8.

Someone told me that gcc under linux has the following problem: The memory
management can`t handle the address links between allocated blocks of memory
if after frequent calls of malloc/calloc a new memory page is accessed.
The suggested work around is to add a constant value to the sizeof call like
in malloc(sizeof(type)+20).

I tried this suggestion. The behaviour of my program improved but I still
have problems with corrupted data and segmentation faults. (The program I am
talking about was originally written to run under XENIX and is well tested.)

Who knows about this problem with malloc/calloc? Can I please have any
available background information/solutions?

Eva Schroeter

>From <EMAIL: PROTECTED>  Tue Nov 29 03:01:36 1994

na naslovu: http://www.geocrawler.com/archives/3/356/1994/11/0/1961786/





Reply via email to