* Segmentation error 6 in rt_heap_create() without --enable-pshared
@ 2018-11-05 11:06 Petr Červenka
2018-11-05 11:10 ` Jan Kiszka
2018-11-05 13:31 ` Petr Červenka
0 siblings, 2 replies; 10+ messages in thread
From: Petr Červenka @ 2018-11-05 11:06 UTC (permalink / raw)
To: Xenomai
Hello.
I'm continuing to test newest Xenomai (git clone).
If I configure Xenomai without --enable-pshared, I will always get an segmentation error 6 in rt_heap_create() call. It doesn't matter, if I use NULL as heap name or not.
With --enable-pshared everything works fine.
Petr
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Segmentation error 6 in rt_heap_create() without --enable-pshared
2018-11-05 11:06 Segmentation error 6 in rt_heap_create() without --enable-pshared Petr Červenka
@ 2018-11-05 11:10 ` Jan Kiszka
2018-11-05 13:31 ` Petr Červenka
1 sibling, 0 replies; 10+ messages in thread
From: Jan Kiszka @ 2018-11-05 11:10 UTC (permalink / raw)
To: Petr Červenka, Xenomai
On 05.11.18 12:06, Petr Červenka via Xenomai wrote:
> Hello.
> I'm continuing to test newest Xenomai (git clone).
> If I configure Xenomai without --enable-pshared, I will always get an segmentation error 6 in rt_heap_create() call. It doesn't matter, if I use NULL as heap name or not.
> With --enable-pshared everything works fine.
stable or master (or both)?
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Segmentation error 6 in rt_heap_create() without --enable-pshared
2018-11-05 11:06 Segmentation error 6 in rt_heap_create() without --enable-pshared Petr Červenka
2018-11-05 11:10 ` Jan Kiszka
@ 2018-11-05 13:31 ` Petr Červenka
2018-11-05 13:49 ` Jan Kiszka
` (2 more replies)
1 sibling, 3 replies; 10+ messages in thread
From: Petr Červenka @ 2018-11-05 13:31 UTC (permalink / raw)
To: Jan Kiszka, Xenomai
>
> stable or master (or both)?
>
> Jan
>
master
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Segmentation error 6 in rt_heap_create() without --enable-pshared
2018-11-05 13:31 ` Petr Červenka
@ 2018-11-05 13:49 ` Jan Kiszka
2018-11-05 14:08 ` Petr Červenka
2018-11-05 15:48 ` Petr Červenka
2 siblings, 0 replies; 10+ messages in thread
From: Jan Kiszka @ 2018-11-05 13:49 UTC (permalink / raw)
To: Petr Červenka, Xenomai
On 05.11.18 14:31, Petr Červenka wrote:
>>
>> stable or master (or both)?
> >
> > Jan
> >
>
> master
>
Only? Sorry for insisting, but it may help to reduce the search space, and it's
also important as I'd like to release a new stable version - without known issues.
Thanks,
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Segmentation error 6 in rt_heap_create() without --enable-pshared
2018-11-05 13:31 ` Petr Červenka
2018-11-05 13:49 ` Jan Kiszka
@ 2018-11-05 14:08 ` Petr Červenka
2018-11-05 15:48 ` Petr Červenka
2 siblings, 0 replies; 10+ messages in thread
From: Petr Červenka @ 2018-11-05 14:08 UTC (permalink / raw)
To: Jan Kiszka, Xenomai
> Only? Sorry for insisting, but it may help to reduce the search space, and it's
> also important as I'd like to release a new stable version - without known issues.
>
> Thanks,
> Jan
Sorry. I tried only master branch and there was the error.
I will try also the stable/v3.0.x branch, but it will take me some time.
Petr
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Segmentation error 6 in rt_heap_create() without --enable-pshared
2018-11-05 13:31 ` Petr Červenka
2018-11-05 13:49 ` Jan Kiszka
2018-11-05 14:08 ` Petr Červenka
@ 2018-11-05 15:48 ` Petr Červenka
2018-11-06 18:04 ` Jan Kiszka
2 siblings, 1 reply; 10+ messages in thread
From: Petr Červenka @ 2018-11-05 15:48 UTC (permalink / raw)
To: Jan Kiszka, Xenomai
> Only? Sorry for insisting, but it may help to reduce the search space, and it's
> also important as I'd like to release a new stable version - without known issues.
>
> Thanks,
> Jan
>
I can confirm now, that the problem happens only with the master branch.
Petr
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Segmentation error 6 in rt_heap_create() without --enable-pshared
2018-11-05 15:48 ` Petr Červenka
@ 2018-11-06 18:04 ` Jan Kiszka
0 siblings, 0 replies; 10+ messages in thread
From: Jan Kiszka @ 2018-11-06 18:04 UTC (permalink / raw)
To: Xenomai, Philippe Gerum; +Cc: Petr Červenka
On 05.11.18 16:48, Petr Červenka wrote:
>> Only? Sorry for insisting, but it may help to reduce the search space, and it's
>> also important as I'd like to release a new stable version - without known issues.
> >
>> Thanks,
>> Jan
> >
>
> I can confirm now, that the problem happens only with the master branch.
> Petr
>
Thanks. Philippe, any idea?
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Segmentation error 6 in rt_heap_create() without --enable-pshared
2018-11-08 9:17 ` Philippe Gerum
@ 2018-11-08 15:03 ` Henning Schild
0 siblings, 0 replies; 10+ messages in thread
From: Henning Schild @ 2018-11-08 15:03 UTC (permalink / raw)
To: Philippe Gerum; +Cc: Xenomai
Am Thu, 8 Nov 2018 10:17:44 +0100
schrieb Philippe Gerum <rpm@xenomai.org>:
> On 11/7/18 4:09 PM, Henning Schild wrote:
> > Am Wed, 7 Nov 2018 14:31:10 +0100
> > schrieb Philippe Gerum <rpm@xenomai.org>:
> >
> >> On 11/7/18 2:00 PM, Henning Schild via Xenomai wrote:
> >>> Readding list ...
> >>>
> >>
> >> Does this help?
> >>
> >> diff --git a/lib/copperplate/heapobj-heapmem.c
> >> b/lib/copperplate/heapobj-heapmem.c index 5c0ce9b2d..124fe564a
> >> 100644 --- a/lib/copperplate/heapobj-heapmem.c
> >> +++ b/lib/copperplate/heapobj-heapmem.c
> >> @@ -33,8 +33,8 @@ int __heapobj_init_private(struct heapobj *hobj,
> >> const char *name, int ret;
> >>
> >> if (mem == NULL) {
> >> - _mem = __STD(malloc(size));
> >> - if (_mem == NULL)
> >> + mem = __STD(malloc(size));
> >> + if (mem == NULL)
> >> return -ENOMEM;
> >> }
> >>
> >> @@ -43,16 +43,16 @@ int __heapobj_init_private(struct heapobj
> >> *hobj, const char *name, else
> >> snprintf(hobj->name, sizeof(hobj->name), "%p",
> >> hobj);
> >> - ret = heapmem_init(hobj->pool, _mem, size);
> >> + hobj->pool = mem;
> >> + hobj->size = size;
> >> +
> >> + ret = heapmem_init(hobj->pool, mem, size);
> >
> > ret = -EINVAL
>
> Part of the solution in this patch (on top of the previous one), but
> more changes are needed for a complete fix:
Ok, that helps. Can you prepare a patch?
Henning
> diff --git a/lib/copperplate/heapobj-heapmem.c
> b/lib/copperplate/heapobj-heapmem.c index 124fe564a..3961bd054 100644
> --- a/lib/copperplate/heapobj-heapmem.c
> +++ b/lib/copperplate/heapobj-heapmem.c
> @@ -33,6 +33,7 @@ int __heapobj_init_private(struct heapobj *hobj,
> const char *name, int ret;
>
> if (mem == NULL) {
> + size = HEAPMEM_ARENA_SIZE(size); /* Count meta-data
> in. */ mem = __STD(malloc(size));
> if (mem == NULL)
> return -ENOMEM;
> @@ -60,7 +61,7 @@ int heapobj_init_array_private(struct heapobj
> *hobj, const char *name, size_t size, int elems)
> {
> return __bt(__heapobj_init_private(hobj, name,
> - HEAPMEM_ARENA_SIZE(size * elems), NULL));
> + size * elems, NULL));
> }
>
> int heapobj_pkg_init_private(void)
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Segmentation error 6 in rt_heap_create() without --enable-pshared
2018-11-07 15:09 ` Henning Schild
@ 2018-11-08 9:17 ` Philippe Gerum
2018-11-08 15:03 ` Henning Schild
0 siblings, 1 reply; 10+ messages in thread
From: Philippe Gerum @ 2018-11-08 9:17 UTC (permalink / raw)
To: Henning Schild; +Cc: Xenomai
On 11/7/18 4:09 PM, Henning Schild wrote:
> Am Wed, 7 Nov 2018 14:31:10 +0100
> schrieb Philippe Gerum <rpm@xenomai.org>:
>
>> On 11/7/18 2:00 PM, Henning Schild via Xenomai wrote:
>>> Readding list ...
>>>
>>
>> Does this help?
>>
>> diff --git a/lib/copperplate/heapobj-heapmem.c
>> b/lib/copperplate/heapobj-heapmem.c index 5c0ce9b2d..124fe564a 100644
>> --- a/lib/copperplate/heapobj-heapmem.c
>> +++ b/lib/copperplate/heapobj-heapmem.c
>> @@ -33,8 +33,8 @@ int __heapobj_init_private(struct heapobj *hobj,
>> const char *name, int ret;
>>
>> if (mem == NULL) {
>> - _mem = __STD(malloc(size));
>> - if (_mem == NULL)
>> + mem = __STD(malloc(size));
>> + if (mem == NULL)
>> return -ENOMEM;
>> }
>>
>> @@ -43,16 +43,16 @@ int __heapobj_init_private(struct heapobj *hobj,
>> const char *name, else
>> snprintf(hobj->name, sizeof(hobj->name), "%p", hobj);
>>
>> - ret = heapmem_init(hobj->pool, _mem, size);
>> + hobj->pool = mem;
>> + hobj->size = size;
>> +
>> + ret = heapmem_init(hobj->pool, mem, size);
>
> ret = -EINVAL
Part of the solution in this patch (on top of the previous one), but more changes are needed for a complete fix:
diff --git a/lib/copperplate/heapobj-heapmem.c b/lib/copperplate/heapobj-heapmem.c
index 124fe564a..3961bd054 100644
--- a/lib/copperplate/heapobj-heapmem.c
+++ b/lib/copperplate/heapobj-heapmem.c
@@ -33,6 +33,7 @@ int __heapobj_init_private(struct heapobj *hobj, const char *name,
int ret;
if (mem == NULL) {
+ size = HEAPMEM_ARENA_SIZE(size); /* Count meta-data in. */
mem = __STD(malloc(size));
if (mem == NULL)
return -ENOMEM;
@@ -60,7 +61,7 @@ int heapobj_init_array_private(struct heapobj *hobj, const char *name,
size_t size, int elems)
{
return __bt(__heapobj_init_private(hobj, name,
- HEAPMEM_ARENA_SIZE(size * elems), NULL));
+ size * elems, NULL));
}
int heapobj_pkg_init_private(void)
--
Philippe.
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: Segmentation error 6 in rt_heap_create() without --enable-pshared
2018-11-07 13:31 ` Philippe Gerum
@ 2018-11-07 15:09 ` Henning Schild
2018-11-08 9:17 ` Philippe Gerum
0 siblings, 1 reply; 10+ messages in thread
From: Henning Schild @ 2018-11-07 15:09 UTC (permalink / raw)
To: Philippe Gerum; +Cc: Xenomai
Am Wed, 7 Nov 2018 14:31:10 +0100
schrieb Philippe Gerum <rpm@xenomai.org>:
> On 11/7/18 2:00 PM, Henning Schild via Xenomai wrote:
> > Readding list ...
> >
>
> Does this help?
>
> diff --git a/lib/copperplate/heapobj-heapmem.c
> b/lib/copperplate/heapobj-heapmem.c index 5c0ce9b2d..124fe564a 100644
> --- a/lib/copperplate/heapobj-heapmem.c
> +++ b/lib/copperplate/heapobj-heapmem.c
> @@ -33,8 +33,8 @@ int __heapobj_init_private(struct heapobj *hobj,
> const char *name, int ret;
>
> if (mem == NULL) {
> - _mem = __STD(malloc(size));
> - if (_mem == NULL)
> + mem = __STD(malloc(size));
> + if (mem == NULL)
> return -ENOMEM;
> }
>
> @@ -43,16 +43,16 @@ int __heapobj_init_private(struct heapobj *hobj,
> const char *name, else
> snprintf(hobj->name, sizeof(hobj->name), "%p", hobj);
>
> - ret = heapmem_init(hobj->pool, _mem, size);
> + hobj->pool = mem;
> + hobj->size = size;
> +
> + ret = heapmem_init(hobj->pool, mem, size);
ret = -EINVAL
Henning
> if (ret) {
> - if (mem == NULL)
> - __STD(free(_mem));
> + if (_mem == NULL)
> + __STD(free(mem));
> return ret;
> }
>
> - hobj->pool = _mem;
> - hobj->size = size;
> -
> return 0;
> }
>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2018-11-08 15:03 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-05 11:06 Segmentation error 6 in rt_heap_create() without --enable-pshared Petr Červenka
2018-11-05 11:10 ` Jan Kiszka
2018-11-05 13:31 ` Petr Červenka
2018-11-05 13:49 ` Jan Kiszka
2018-11-05 14:08 ` Petr Červenka
2018-11-05 15:48 ` Petr Červenka
2018-11-06 18:04 ` Jan Kiszka
2018-11-07 13:00 Fw: " Henning Schild
2018-11-07 13:31 ` Philippe Gerum
2018-11-07 15:09 ` Henning Schild
2018-11-08 9:17 ` Philippe Gerum
2018-11-08 15:03 ` Henning Schild
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.