All of lore.kernel.org
 help / color / mirror / Atom feed
* AW: [Xenomai-help] resubmission : memset of heap crashes Xenomai-Task
@ 2006-09-06 12:08 Roderik_Wildenburg
  2006-09-06 12:30 ` Gilles Chanteperdrix
  2006-09-06 12:39 ` Gilles Chanteperdrix
  0 siblings, 2 replies; 10+ messages in thread
From: Roderik_Wildenburg @ 2006-09-06 12:08 UTC (permalink / raw)
  To: gilles.chanteperdrix; +Cc: xenomai

Dear Gilles,

I admit, the mechanism for allocating all memory of the target is not very sophisticated. The idea was, that MAXHEAPBLOCKS*MEMORYCHUNKSIZE is much much more, than memory available (at least with my target (128MB) this is true). I should have mentioned this in the source code, sorry. If your target has more then (MAXHEAPBLOCKS*MEMORYCHUNKSIZE=320MB(approcimate)) memory, you should increase MAXHEAPBLOCKS.

If this condition is fulfiled, I think, there should be no illegal memory access. Do you agree ?

Roderik
 

> -----Ursprüngliche Nachricht-----
> Von: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org
> Gesendet: Dienstag, 5. September 2006 17:18
> An: Wildenburg, Roderik RAEK3 MRA
> Cc: xenomai@xenomai.org
> Betreff: Re: [Xenomai-help] resubmission : memset of heap 
> crashes Xenomai-Task
> 
> Roderik_Wildenburg@domain.hid wrote:
>  > Some times ago (2006.07.06) I had the problem described below. 
>  > As far as I can see, there is no solution for this till now. 
>  > I think, it is worth a second go, as I believe, a 
> industrial strength application can´t accept this behavior.
>  > Therefore I would like to ask the Xenomai-PPC gurus (as 
> far as I can see, it could only be reproduced on PPC (not 
> Qemu)) again, to judge, whether this is a serios problem or 
> just something I have to live with.
>  >
>  > Thank you in advance
>  > Roderik
>  >
>  >
>  > Xenomai Version : 2.2-rc2
>  > Skin : native
>  > Kernel : 2.4.25
>  > Arch.: PPC
>  >
>  > I try to allocate as much memory as possible with the functions :
>  > rt_heap_create and
>  > rt_heap_alloc.
>  > (see source attached)
>  >
>  > When I try to use the allocated memory with memset, the 
> Xenomai-task crashes with a "Segmentation fault".
> 
> You are doing:
> 
> RT_HEAP bigheap[MAXHEAPBLOCKS];
>    
> 
>    for(i=0;i<MAXHEAPBLOCKS;i++)
>    {
>        /* some treatment */
>    }
> 
>    /* access bigheap[i] */
> 
> After the for loop, i is MAXHEAPBLOCKS, so, you are accessing 
> the bigheap array beyond its end, probably overriding the 
> bigbuf array.
> 
> -- 
> 
> 
> 					    Gilles Chanteperdrix.
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread
* AW: [Xenomai-help] resubmission : memset of heap crashes Xenomai-Task
@ 2006-09-06 12:56 Roderik_Wildenburg
  0 siblings, 0 replies; 10+ messages in thread
From: Roderik_Wildenburg @ 2006-09-06 12:56 UTC (permalink / raw)
  To: danielsch, xenomai

> Daniel Schnell [mailto:danielsch@domain.hid] wrote :

> Hi,
> 
> I have tried your program on my mpc5200 (Kernel 2.4.25, 
> Xenomai 2.2.1, 256 MB RAM). Besides it doesn't do much and 
> also the heap allocation seems not to work, I had no crashes.
> 

Thank you for testing Daniel !
The idea was, to test Xenomai with very low memory available (especially network performance tests). Therefore I implemented a algorithm (I admit, not a very sophisticated one), which allocates nearly all memory available. To make sure, that memory is not available for Xenomai, the kernel or other applications,I touche the allocated memory (memset). So, the program realy does not do very much, beside allocating and touching as much memory as possible. Unfortunatelly this crashes the programm (segmentation fault) without doing any "illegal".
What do you mean with "the heap allocation seems not to work" ? Is this a Xenomai  or a program malfunction ?
Perhaps your test didn´t crash as this allocation does not work ?
With my target it takes a while (approx 1min.) till the programm crashes. Did you wait a while ?
Perhaps the problem is already solved in 2.2.1.

Thank you for your support
Roderik



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-09-06 14:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-06 12:08 AW: [Xenomai-help] resubmission : memset of heap crashes Xenomai-Task Roderik_Wildenburg
2006-09-06 12:30 ` Gilles Chanteperdrix
2006-09-06 12:39 ` Gilles Chanteperdrix
2006-09-06 12:59   ` Wolfgang Grandegger
2006-09-06 13:04     ` Gilles Chanteperdrix
2006-09-06 13:08       ` Gilles Chanteperdrix
2006-09-06 13:12     ` Gilles Chanteperdrix
2006-09-06 13:32     ` Jan Kiszka
2006-09-06 14:50     ` Gilles Chanteperdrix
  -- strict thread matches above, loose matches on Subject: below --
2006-09-06 12:56 Roderik_Wildenburg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.