All of lore.kernel.org
 help / color / mirror / Atom feed
* AW: [Xenomai-help] memset of heap crashes Xenomai-Task
@ 2006-07-11  6:25 Roderik_Wildenburg
  2006-07-11  8:09 ` Wolfgang Grandegger
  0 siblings, 1 reply; 6+ messages in thread
From: Roderik_Wildenburg @ 2006-07-11  6:25 UTC (permalink / raw)
  To: gilles.chanteperdrix; +Cc: xenomai


> 
> memset should work with Xenomai heaps, I suspect your problem 
> is rather that the memory is not really allocated until you 
> memset it, which fails when no memory is available. In this 
> case, calling memset on memory allocated with malloc should 
> segfault the same way when the system memory is exhausted. 
> IIRC, this behaviour is documented in mlockall manual page.
> 

Mr. Denk told me about this strange (for RTOSs) behaviour of the 
Linux kernel. Therefore I used the Xenomai heap mechanism, expecting
allocated memory is allocated at once not some time later 
(why do I allocate memory otherwise : to be shure memory is available).
Does Xenomai use the Linux allocation mechanism ??


> Be careful with sysconf(_SC_AVPHYS_PAGES), it may include the 
> swap size, but when mlocking memory, your application can not 
> use swap pages, so, you should substract the size of swap, if any.
> Also, what is the value of /proc/sys/vm/overcommit_memory on 
> your system ?
> 

Our System does not have a swap device\space.
/proc/sys/vm/overcommit_memory = 0
(whatever this means)


Thank you for your help
Roderik


^ permalink raw reply	[flat|nested] 6+ messages in thread
* AW: [Xenomai-help] memset of heap crashes Xenomai-Task
@ 2006-07-11  6:09 Roderik_Wildenburg
  2006-07-11  6:22 ` Jan Kiszka
  0 siblings, 1 reply; 6+ messages in thread
From: Roderik_Wildenburg @ 2006-07-11  6:09 UTC (permalink / raw)
  To: jan.kiszka; +Cc: xenomai

> 
> First of all, I'm not sure if that 8K of stack is enough on 
> PPC with 2.4, on x86 over 2.6 it isn't. The native skin picks 
> PTHREAD_STACK_MIN*4 for you by default. Is this too much? 
> Unless dealing with dozens of
> *simple* threads, reducing this makes no sense to me.

?? Greping for PTHREAD_STACK_MIN xenomai/posix/pthread.h tells me, 
it is 1024. 1024*4=4096. This is less than 8192 ;-)
Is there a differnce between x86 and PPC.
(I simply did not realize that there is a default value for 
the stacksize. Therfore I choose my own value, which was based on my 
vxWorks experince)


> 
> Then there was this bug:
> 
> @@ -168,13 +169,13 @@
>  void root_thread_exit(void)
>  {
>     int i;
> -   RT_HEAP_INFO *hpinfo;
> +   RT_HEAP_INFO hpinfo;
> 
>     printf("UDP->root_thread_exit\n");
> 
>     for(i=0;i<MAXHEAPBLOCKS;i++)
>     {
> -      if( !rt_heap_inquire(&bigheap[i],hpinfo) )
> +      if( !rt_heap_inquire(&bigheap[i],&hpinfo) )
>           rt_heap_delete(&bigheap[i]);
>     }

Thank you ! 4 eyes see more than 2.
(but this is probably not the reason for the segmentation fault, as 
this routine is called for exit only !?)
But even after correcting this error, I get segmentation faults (not
with 
the first start but with the second or third)


> 
> Now I get some other strange effects (e.g. kernel oopses after OOM
> oopses) that need a closer look under qemu later.

Thanks a lot.

Roderik


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

end of thread, other threads:[~2006-07-11  8:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-11  6:25 AW: [Xenomai-help] memset of heap crashes Xenomai-Task Roderik_Wildenburg
2006-07-11  8:09 ` Wolfgang Grandegger
2006-07-11  8:22   ` Jan Kiszka
2006-07-11  8:42     ` Wolfgang Grandegger
  -- strict thread matches above, loose matches on Subject: below --
2006-07-11  6:09 Roderik_Wildenburg
2006-07-11  6:22 ` Jan Kiszka

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.