* [Xenomai-core] [BUG] commit #1833 breaks rt_queue_create
@ 2006-11-15 21:13 Jan Kiszka
2006-11-15 21:23 ` Jan Kiszka
2006-11-15 22:17 ` Philippe Gerum
0 siblings, 2 replies; 3+ messages in thread
From: Jan Kiszka @ 2006-11-15 21:13 UTC (permalink / raw)
To: xenomai-core
[-- Attachment #1.1: Type: text/plain, Size: 455 bytes --]
As xnheap_size() changed, a sanity check in xnheap_mmap fails now, at
least for SVN head, maybe also 2.2.x.
I would suggest the following patch to fix this, though I'm not 100%
sure its correct in all cases (do we ever come across a heap of multiple
extents in xnheap_mmap?).
Jan
PS: I'll spent a beer (or two...) for the one who starts writing a
testsuite for the native skin - in user-space, please, to catch also
issues like this one.
[-- Attachment #1.2: fix-mapped-heap-size.patch --]
[-- Type: application/octet-stream, Size: 744 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Xenomai-core] [BUG] commit #1833 breaks rt_queue_create
2006-11-15 21:13 [Xenomai-core] [BUG] commit #1833 breaks rt_queue_create Jan Kiszka
@ 2006-11-15 21:23 ` Jan Kiszka
2006-11-15 22:17 ` Philippe Gerum
1 sibling, 0 replies; 3+ messages in thread
From: Jan Kiszka @ 2006-11-15 21:23 UTC (permalink / raw)
To: xenomai-core
[-- Attachment #1: Type: text/plain, Size: 313 bytes --]
Jan Kiszka wrote:
> As xnheap_size() changed, a sanity check in xnheap_mmap fails now, at
> least for SVN head, maybe also 2.2.x.
>
> I would suggest the following patch to fix this,
Wasn't someone recently writing in the wiki, one should post plain-text
patches here...?
Hope this one is less octet-streamed.
[-- Attachment #2: fix-mapped-heap-size.patch --]
[-- Type: text/plain, Size: 736 bytes --]
Index: ksrc/nucleus/heap.c
===================================================================
--- ksrc/nucleus/heap.c (Revision 1835)
+++ ksrc/nucleus/heap.c (Arbeitskopie)
@@ -952,7 +952,7 @@ static int xnheap_mmap(struct file *file
size = vma->vm_end - vma->vm_start;
heap = (xnheap_t *)file->private_data;
- if (size != heap->extentsize)
+ if (size != xnheap_size(heap))
return -ENXIO; /* Doesn't match the heap size. */
vma->vm_ops = &xnheap_vmops;
@@ -1135,7 +1135,7 @@ int xnheap_destroy_mapped(xnheap_t *heap
xnlock_put_irqrestore(&nklock, s);
__unreserve_and_free_heap(heap->archdep.heapbase,
- heap->extentsize, heap->archdep.kmflags);
+ xnheap_size(heap), heap->archdep.kmflags);
return 0;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Xenomai-core] [BUG] commit #1833 breaks rt_queue_create
2006-11-15 21:13 [Xenomai-core] [BUG] commit #1833 breaks rt_queue_create Jan Kiszka
2006-11-15 21:23 ` Jan Kiszka
@ 2006-11-15 22:17 ` Philippe Gerum
1 sibling, 0 replies; 3+ messages in thread
From: Philippe Gerum @ 2006-11-15 22:17 UTC (permalink / raw)
To: Jan Kiszka; +Cc: xenomai-core
On Wed, 2006-11-15 at 22:13 +0100, Jan Kiszka wrote:
> As xnheap_size() changed, a sanity check in xnheap_mmap fails now, at
> least for SVN head, maybe also 2.2.x.
>
> I would suggest the following patch to fix this, though I'm not 100%
> sure its correct in all cases
It's correct. xnheap_size() is sent back to user-space when creating the
queue, which forwards this in turn to the mmap handler.
> (do we ever come across a heap of multiple
> extents in xnheap_mmap?).
Yes we do, particularly for ppc which needs this for the system heap.
However, we should not allow mmaping multi-extent heaps. Merged fixes
and added sanity check to prevent the latter issue. Thanks.
>
> Jan
>
>
> PS: I'll spent a beer (or two...) for the one who starts writing a
> testsuite for the native skin - in user-space, please, to catch also
> issues like this one.
> _______________________________________________
> Xenomai-core mailing list
> Xenomai-core@domain.hid
> https://mail.gna.org/listinfo/xenomai-core
--
Philippe.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-11-15 22:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-15 21:13 [Xenomai-core] [BUG] commit #1833 breaks rt_queue_create Jan Kiszka
2006-11-15 21:23 ` Jan Kiszka
2006-11-15 22:17 ` Philippe Gerum
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.