From: Leopold Palomo-Avellaneda <leo@alaxarxa.net>
To: xenomai <xenomai@xenomai.org>
Subject: [Xenomai] Regarding Xenomai and RTNET
Date: Fri, 30 Sep 2016 14:15:39 +0200 [thread overview]
Message-ID: <4215540.eSPgLzVGbT@soho> (raw)
Hi,
I'm fighting with some code to run with Xenomai 3. One of the projects is soem
[1].
The original library uses POSIX to open a raw socket to send Ethercat
messages. Our fork, uses rtnet and some Xenomai functionalities to accomplish
it. It has been working with 2.6.x without any problems.
OTOH, also we have done another fork fril [2] that, using the POSIX
compatibility and rtnet use a rt_ethX device to communicate with a robot. We
have used it without any problem too with 2.6.x
Now, we try to migrate all of this code to Xenomai-3 but we are having crashes
all the time.
With fril, a pure POSIX code, using the compatibility mode, we have a crash,
showing:
BUG: unable to handle kernel paging request at 00007f47ea0ef878
IP: [<ffffffffa0231580>] rt_udp_ioctl+0x50/0x74 [rtudp]
PGD 458887067 PUD 4590a1067 PMD 45921f067 PTE 8000000438863867
Oops: 0001 [#1] PREEMPT SMP
Modules linked in: rt_igb rt_loopback rtcfg rtudp rtipv4 rtmac rtpacket rtnet
e100 mii ctr ccm binfmt_misc nfsd
CPU: 4 PID: 6773 Comm: LWRJointPositio Not tainted 4.1.18-xenomai-3.0.3 #1
Hardware name: Gigabyte Technology Co., Ltd. To be filled by O.E.M./Q170M-D3H-
CF, BIOS F1 10/13/2015
task: ffff880459a26010 ti: ffff880459a38000 task.ti: ffff880459a38000
RIP: 0010:[<ffffffffa0231580>] [<ffffffffa0231580>] rt_udp_ioctl+0x50/0x74 [rtudp]
RSP: 0018:ffff880459a3be08 EFLAGS: 00010246
RAX: 00007f47ea0ef870 RBX: ffff880458d59400 RCX: ffff880458d59440
RDX: 0000000000000000 RSI: 0000000040100022 RDI: ffff880458d59400
RBP: 0000000000000003 R08: ffff880460297420 R09: 000000000000004e
R10: 00000000000000dc R11: ffff880459a3bdc0 R12: ffff880459a26010
R13: ffffc90001f05008 R14: 0000000040100022 R15: ffffffff81b85ec0
FS: 00007f47ea0f0700(0000) GS:ffff880460200000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 00007f47ea0ef878 CR3: 000000045890c000 CR4: 00000000003406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
I-pipe domain Linux
Stack:
ffffffffa0231535 ffffffff8116fb70 ffff880459a265c0 00007f47ea0ef870
ffff8804599975d0 0000000000000010 ffff880459a3beb8 ffff880459a3be48
0000000000000002 ffff880459a26010 00007f47ea0ef870 ffff880459a26010
Call Trace:
[<ffffffffa0231535>] ? rt_udp_ioctl+0x5/0x74 [rtudp]
[<ffffffff8116fb70>] ? rtdm_fd_ioctl+0x100/0x270
[<ffffffff81174b40>] ? CoBaLt_fcntl+0x20/0x20
[<ffffffff81174b40>] ? CoBaLt_fcntl+0x20/0x20
[<ffffffff81174b50>] ? CoBaLt_ioctl+0x10/0x20
[<ffffffff81174b45>] ? CoBaLt_ioctl+0x5/0x20
[<ffffffff8118450a>] ? ipipe_syscall_hook+0x11a/0x360
[<ffffffff81108da7>] ? __ipipe_notify_syscall+0xe7/0x1d0
[<ffffffff81107185>] ? __ipipe_restore_root_nosync+0x5/0x30
[<ffffffff8158fb34>] ? pipeline_syscall+0x9/0x16
Code: 23 00 10 40 75 15 8b 50 08 48 8b 30 48 89 cf 48 83 c4 08 e9 a3 fd ff ff
0f 1f 00 48 89 c2 48 83 c4 08 e9 5
RIP [<ffffffffa0231580>] rt_udp_ioctl+0x50/0x74 [rtudp]
RSP <ffff880459a3be08>
CR2: 00007f47ea0ef878
---[ end trace 085d23e71de3ae4b ]---
with soem, not using compatibility, just native (alchemy) code:
BUG: unable to handle kernel paging request at 00007ffd028e0190
IP: [<ffffffff81319ca8>] strncmp+0x8/0x50
PGD 458468067 PUD 459b58067 PMD 4592ac067 PTE 8000000451078867
Oops: 0001 [#2] PREEMPT SMP
Modules linked in: rt_igb rt_loopback rtcfg rtudp rtipv4 rtmac rtpacket rtnet
e100 mii ctr ccm binfmt_misc nfsd
CPU: 0 PID: 7752 Comm: slaveinfo_rt Tainted: G D 4.1.18-
xenomai-3.0.3 #1
Hardware name: Gigabyte Technology Co., Ltd. To be filled by O.E.M./Q170M-D3H-
CF, BIOS F1 10/13/2015
task: ffff8804581bcc90 ti: ffff88045b434000 task.ti: ffff88045b434000
RIP: 0010:[<ffffffff81319ca8>] [<ffffffff81319ca8>] strncmp+0x8/0x50
RSP: 0018:ffff88045b437da0 EFLAGS: 00010202
RAX: ffffc90001f02008 RBX: ffffffffa01a4740 RCX: 0000000000000072
RDX: 0000000000000010 RSI: 00007ffd028e0190 RDI: ffff88045b457404
RBP: ffff88045b457400 R08: ffff88045fe97420 R09: 000000000000004d
R10: 00000000000000dc R11: ffff88045b437dc0 R12: 00007ffd028e0190
R13: 00007ffd028e0190 R14: 0000000040180021 R15: ffffffff81b85ec0
FS: 00007f6dbcbf0740(0000) GS:ffff88045fe00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 00007ffd028e0190 CR3: 0000000458df7000 CR4: 00000000003406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
I-pipe domain Linux
Stack:
ffffffffa019d151 0000000000052f08 0000000000000000 00007ffd028e0190
ffffffffa019d621 ffff880459184a00 0000000040180021 ffff8804581bcc90
ffffffffa01a07de ffff880459184a00 0000000000000003 ffff8804581bcc90
Call Trace:
[<ffffffffa019d151>] ? __rtdev_get_by_name+0x31/0x60 [rtnet]
[<ffffffffa019d621>] ? rtdev_get_by_name+0x51/0xd0 [rtnet]
[<ffffffffa01a07de>] ? rt_socket_if_ioctl+0x2e/0x2f0 [rtnet]
[<ffffffff8116fb70>] ? rtdm_fd_ioctl+0x100/0x270
[<ffffffff81174b40>] ? CoBaLt_fcntl+0x20/0x20
[<ffffffff81174b40>] ? CoBaLt_fcntl+0x20/0x20
[<ffffffff81174b50>] ? CoBaLt_ioctl+0x10/0x20
[<ffffffff81174b45>] ? CoBaLt_ioctl+0x5/0x20
[<ffffffff8118450a>] ? ipipe_syscall_hook+0x11a/0x360
[<ffffffff81108da7>] ? __ipipe_notify_syscall+0xe7/0x1d0
[<ffffffff811feb25>] ? fput+0x5/0x90
[<ffffffff81107185>] ? __ipipe_restore_root_nosync+0x5/0x30
[<ffffffff8158fb34>] ? pipeline_syscall+0x9/0x16
Code: 46 ff 75 0f 84 c0 75 eb 31 c0 c3 0f 1f 84 00 00 00 00 00 19 c0 83 c8 01
c3 66 2e 0f 1f 84 00 00 00 00 00 4
RIP [<ffffffff81319ca8>] strncmp+0x8/0x50
RSP <ffff88045b437da0>
CR2: 00007ffd028e0190
---[ end trace 085d23e71de3ae4c ]---
If both the program crashes "unable to handle kernel paging request".
Also, I have found that using the --compat parameter in xeno-config, the values
obtained (--posix --compat --cflags) makes that the applications doesn't
compile:
/home/leopold.palomo/fril/fril.git/src/FastResearchInterfaceLibrary/Console.cpp:50:
/usr/xenomai/include/trank/posix/pthread.h: In function ‘int
pthread_set_mode_np(int, int, int*)’:
/usr/xenomai/include/trank/posix/pthread.h:55:52: error: ‘pthread_setmode_np’
was not declared in this scope
return pthread_setmode_np(clrmask, setmask, mask_r);
I guess that there's a missing includes hidden here.
So, any idea to find a solution?
Do you have some example that works with xenomai-3 and rtnet?
Best regards,
Leopold
[1] https://github.com/iocroblab/soem
[2] https://github.com/iocroblab/fril
--
--
Linux User 152692 GPG: 05F4A7A949A2D9AA
Catalonia
-------------------------------------
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://xenomai.org/pipermail/xenomai/attachments/20160930/0b67fb4e/attachment.sig>
next reply other threads:[~2016-09-30 12:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-30 12:15 Leopold Palomo-Avellaneda [this message]
2016-09-30 14:06 ` [Xenomai] Regarding Xenomai and RTNET Philippe Gerum
2016-10-03 7:20 ` Leopold Palomo-Avellaneda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4215540.eSPgLzVGbT@soho \
--to=leo@alaxarxa.net \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.