Skip to contentSkip to conversation

shared session and latest release

Xenomai Stéphane Ancelot 2 participants 5 messages Mar 16, 2018 – Mar 19, 2018

lore
Share & tools
lore
#0 lore raw

Hi,

I upgraded my applications to latest release (next branch) .

I do not manage to run the shared session , using session-label to run the program as user (fixed in a tunable config)

my session name is numalliance/automat (automat corresponds to my group user id 1000)

however , if I launch the program as root , it works.

I checked /dev/rtdm files, they all have rw access for user/ group / other

What else to check for ?

Regards,

S.Ancelot

#1 lore raw

Le 16/03/2018 à 12:19, Stéphane Ancelot a écrit :

Quoted 5 lines

Hi,

I upgraded my applications to latest release (next branch) .

I do not manage to run the shared session , using session-label to run the program as user (fixed in a tunable config)

it fails as follow :

   0"000.413| WARNING: [main] failed to initialize main shared heap
   0"000.480| WARNING: [main] setup call copperplate failed
   0"000.508| BUG in __xenomai_init(): [main] initialization failed, EACCES
Quoted 19 lines

my session name is numalliance/automat (automat corresponds to my group user id 1000)

however , if I launch the program as root , it works.

I checked /dev/rtdm files, they all have rw access for user/ group / other

What else to check for ?

Regards,

S.Ancelot

_______________________________________________
Xenomai mailing list
[email protected]
https://xenomai.org/mailman/listinfo/xenomai

#2 lore raw
In reply to Stéphane Ancelot
Quoted 3 lines · Stéphane Ancelot

Hi,

I upgraded my applications to latest release (next branch) .

The next branch is by definition NOT released, this is a development tree.

Quoted 9 lines

I do not manage to run the shared session , using session-label to run the program as user (fixed in a tunable config)

my session name is numalliance/automat (automat corresponds to my group user id 1000)

however , if I launch the program as root , it works.

Quoted 8 lines

I checked /dev/rtdm files, they all have rw access for user/ group / other

What else to check for ?

it fails as follow :

   0"000.413| WARNING: [main] failed to initialize main shared heap
   0"000.480| WARNING: [main] setup call copperplate failed
   0"000.508| BUG in __xenomai_init(): [main] initialization failed,

EACCES

Quoted 1 line

{rpm@cobalt} git grep -B2 "failed to initialize main shared heap"
lib/copperplate/init.c- ret = heapobj_pkg_init_shared();
lib/copperplate/init.c- if (ret) {
lib/copperplate/init.c: warning("failed to initialize main shared heap");

You do know which error is spat out (EACCES), and you know which code is involved. You should be able to fire a debugger, and find out what is going on with the inits.

This would be a step in the right direction for turning the -next branch into a release at some point.

Signature · 1 line
Philippe.
#3 lore raw

Le 16/03/2018 à 19:59, Philippe Gerum a écrit :

Quoted 28 lines · Stéphane Ancelot
Quoted 3 lines

Hi,

I upgraded my applications to latest release (next branch) .

The next branch is by definition NOT released, this is a development tree.

Quoted 8 lines

I do not manage to run the shared session , using session-label to run the program as user (fixed in a tunable config)

my session name is numalliance/automat (automat corresponds to my group user id 1000)

however , if I launch the program as root , it works.

Quoted 8 lines

I checked /dev/rtdm files, they all have rw access for user/ group / other

What else to check for ?

it fails as follow :

    0"000.413| WARNING: [main] failed to initialize main shared heap
    0"000.480| WARNING: [main] setup call copperplate failed
    0"000.508| BUG in __xenomai_init(): [main] initialization failed,

EACCES
{rpm@cobalt} git grep -B2 "failed to initialize main shared heap"
lib/copperplate/init.c- ret = heapobj_pkg_init_shared();
lib/copperplate/init.c- if (ret) {
lib/copperplate/init.c: warning("failed to initialize main shared heap");

Quoted 7 lines

You do know which error is spat out (EACCES), and you know which code is involved. You should be able to fire a debugger, and find out what is going on with the inits.

This would be a step in the right direction for turning the -next branch into a release at some point.

Ok, the problem was comming from our code, at creation of heap that had not used the same session_label....and thus a different gid..

However, the reason we tried next branch is from a  deeper problem that is also in stable branch. We reached a  case where the heap has been broken after linking an heap area . this is not easy to reproduce since this occured only when we added a new memory area. changing order of creation hides the problem.....

any new process that want next link to the heap, segfaults . /lib64/libc.so.6(+0x34950) [0x7f0a6c28d950] /usr/xenomai-3.0-git/lib/libcobalt.so.2(hash_search_probe+0xb3) [0x7f0a6f34d1a3] /usr/xenomai-3.0-git/lib/libcopperplate.so.0(syncluster_findobj+0x84) [0x7f0a6f562904] /usr/xenomai-3.0-git/lib/libalchemy.so.0(alchemy_bind_object+0xa2) [0x7f0a6f773b12]

We will try to track when code is corrupted. if you have some hints, please advice. Regards
S.Ancelot

#4 lore raw

Hi,

We finally found a memory access out of bounds in our code .

the latest branch next works with pshared mode regarding memory heaps.

Regards,
S.Ancelot

Le 19/03/2018 à 10:13, Stéphane Ancelot a écrit :

Quoted 60 lines

Le 16/03/2018 à 19:59, Philippe Gerum a écrit :

Quoted 28 lines · Stéphane Ancelot
Quoted 3 lines

Hi,

I upgraded my applications to latest release (next branch) .

The next branch is by definition NOT released, this is a development tree.

Quoted 8 lines

I do not manage to run the shared session , using session-label to run the program as user (fixed in a tunable config)

my session name is numalliance/automat (automat corresponds to my group user id 1000)

however , if I launch the program as root , it works.

Quoted 8 lines

I checked /dev/rtdm files, they all have rw access for user/ group / other

What else to check for ?

it fails as follow :

    0"000.413| WARNING: [main] failed to initialize main shared heap
    0"000.480| WARNING: [main] setup call copperplate failed
    0"000.508| BUG in __xenomai_init(): [main] initialization failed,

EACCES
{rpm@cobalt} git grep -B2 "failed to initialize main shared heap" lib/copperplate/init.c-    ret = heapobj_pkg_init_shared(); lib/copperplate/init.c-    if (ret) {
lib/copperplate/init.c:        warning("failed to initialize main shared heap");

Quoted 7 lines

You do know which error is spat out (EACCES), and you know which code is involved. You should be able to fire a debugger, and find out what is going on with the inits.

This would be a step in the right direction for turning the -next branch into a release at some point.

Ok, the problem was comming from our code, at creation of heap that had not used the same session_label....and thus a different gid..

However, the reason we tried next branch is from a  deeper problem that is also in stable branch. We reached a  case where the heap has been broken after linking an heap area . this is not easy to reproduce since this occured only when we added a new memory area. changing order of creation hides the problem.....

any new process that want next link to the heap, segfaults . /lib64/libc.so.6(+0x34950) [0x7f0a6c28d950] /usr/xenomai-3.0-git/lib/libcobalt.so.2(hash_search_probe+0xb3) [0x7f0a6f34d1a3] /usr/xenomai-3.0-git/lib/libcopperplate.so.0(syncluster_findobj+0x84) [0x7f0a6f562904] /usr/xenomai-3.0-git/lib/libalchemy.so.0(alchemy_bind_object+0xa2) [0x7f0a6f773b12]

We will try to track when code is corrupted. if you have some hints, please advice. Regards
S.Ancelot

_______________________________________________
Xenomai mailing list
[email protected]
https://xenomai.org/mailman/listinfo/xenomai