All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Huy Cong Vu <huy-cong.vu@wandercraft.eu>
Subject: Re: [Xenomai] Differents switch mode from differents Xenomai skin
Date: Fri, 19 Dec 2014 11:31:33 +0100	[thread overview]
Message-ID: <20141219103133.GY2012@hermes.click-hack.org> (raw)
In-Reply-To: <1886500835.102755.1418982478388.JavaMail.zimbra@wandercraft.eu>

On Fri, Dec 19, 2014 at 10:47:58AM +0100, Huy Cong Vu wrote:
> ----- Mail original -----
> > De: "Gilles Chanteperdrix" <gilles.chanteperdrix@xenomai.org>
> > À: "Huy Cong Vu" <huy-cong.vu@wandercraft.eu>
> > Cc: xenomai@xenomai.org
> > Envoyé: Jeudi 18 Décembre 2014 18:43:47
> > Objet: Re: [Xenomai] Differents switch mode from differents Xenomai skin
> 
> > On Thu, Dec 18, 2014 at 05:41:26PM +0100, Huy Cong Vu wrote:
> >> > Unknown reason is suspicious, if you have used the sigdebug example,
> >> > you should not that there is now an additional reason for receiving
> >> > SIGXCPU.
> >> > 
> >> 
> >> You are right, the error I got is error 7, i.e
> >> SIGDEBUG_RESCNT_IMBALANCE, knowing that I don't use a mutex in my
> >> app, so maybe it's still an unknown issue?
> > 
> > That is impossible, you can not get this error if you do not use
> > mutexes. Maybe the library you use uses mutexes .
> > 
> 
> You are right, I'm able to spot some mutexes in my library,
> however, the call which cause the mode switch is not included in
> mutex zone. I tried to disable all mutexes but the error still
> occurs.

As I said, the SIGDEBUG_RESCNT_IMBALANCE should only happen when
using a mutex. The relax upon send should be unrelated though.

> 
> >> 
> >> >> ./testcase_posix[0x401570]
> >> >> /lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0)[0x7f40ddb7acb0]
> >> >> /usr/xenomai/lib/librtdm.so.1(rt_dev_sendmsg+0x16)[0x7f40dd5598f6]
> >> >> 
> >> >> These 2 programs use the same functions call, compiled with same
> >> >> flags (rtdm, native & posix mixed):
> >> > 
> >> > Most likely, rt_dev_sendmsg is passed a non real-time socket. You
> >> > can use either native or posix services to create and handle
> >> > sockets, but you can not mix the call. It meansa socket created with
> >> > rt_dev_socket (the native service) should be passed to
> >> > rt_dev_sendmsg, whereas socket created with the posix service
> >> > (socket) can only be passed to posix services (sendmsg). Is not it
> >> > what is happening here?
> >> > 
> >> 
> >> So, does that means that my test in posix skin should not calls
> >> rt_dev_sendmsg?
> > 
> > No. Once again, that means that you should not use rt_dev_sendmsg
> > with a socket obtained with the "socket" service, but as long as you
> > obtain the socket with rt_dev_socket, you can use rt_devn_sendmsg.
> > 
> 
> I changed the call to posix wrap function, error now occur at
> __wrap_send, I made a dig in posix/rtdm.c itself and it seems that
> mode switch come from this line:
> 
> 		ret = set_errno(XENOMAI_SKINCALL3(__pse51_rtdm_muxid,
> 						  __rtdm_sendmsg,
> 						  fd - __pse51_rtdm_fd_start,
> 						  &msg, flags));
> 
> Before that, my library wanted to send a frame to an rtnet port
> that was already setup-ed with socket service. Is there something
> wrong with the fact that I'm trying to access to rtnet port with
> posix wrapped service?

I am not sure I understand what you mean. So, I am going to try and
explain a third time what I mean.

- This works:
int fd = socket

send(fd, buffer, n);

- This works:
int fd = rd_dev_socket

rt_dev_send(fd, buffer, n);

- This DOES NOT work:

int fd = rt_dev socket

send(fd, buffer, n);

- This DOES NOT work either:

int fd = socket

rt_dev_send(fd, buffer, n);

Once again, as long as you do not send us a testcase allowing us to
reproduce the problem, it is difficult to make any progress in
understanding the issue you have.

-- 
					    Gilles.


  parent reply	other threads:[~2014-12-19 10:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-18 11:30 [Xenomai] Differents switch mode from differents Xenomai skin Huy Cong Vu
2014-12-18 14:05 ` Gilles Chanteperdrix
     [not found]   ` <530357014.99522.1418920882907.JavaMail.zimbra@wandercraft.eu>
2014-12-18 16:41     ` Huy Cong Vu
2014-12-18 17:43       ` Gilles Chanteperdrix
     [not found]         ` <1886500835.102755.1418982478388.JavaMail.zimbra@wandercraft.eu>
2014-12-19 10:31           ` Gilles Chanteperdrix [this message]
     [not found]             ` <873251.115805.1419351709840.JavaMail.zimbra@wandercraft.eu>
2014-12-23 16:23               ` Huy Cong Vu
2014-12-23 16:35                 ` Gilles Chanteperdrix
     [not found]                   ` <1247107386.116030.1419353010523.JavaMail.zimbra@wandercraft.eu>
2014-12-23 16:43                     ` Huy Cong Vu
2014-12-23 16:46                       ` Gilles Chanteperdrix
     [not found]                         ` <473658337.116296.1419353916760.JavaMail.zimbra@wandercraft.eu>
2014-12-23 16:58                           ` Huy Cong Vu
2014-12-24  0:29                             ` Gilles Chanteperdrix
     [not found]                               ` <1579728558.117024.1419413400904.JavaMail.zimbra@wandercraft.eu>
2014-12-24  9:30                                 ` Huy Cong Vu
2014-12-24 14:49                                   ` Gilles Chanteperdrix
     [not found]                                     ` <122317517.130963.1420453826355.JavaMail.zimbra@wandercraft.eu>
2015-01-05 10:30                                       ` Huy Cong Vu
2015-01-05 16:58                                         ` Gilles Chanteperdrix
     [not found]                                           ` <53399875.136328.1420535338904.JavaMail.zimbra@wandercraft.eu>
2015-01-06  9:09                                             ` Huy Cong Vu
2015-01-06  9:16                                               ` Gilles Chanteperdrix
     [not found]                                                 ` <406329870.136348.1420536332444.JavaMail.zimbra@wandercraft.eu>
2015-01-06  9:34                                                   ` Huy Cong Vu

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=20141219103133.GY2012@hermes.click-hack.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=huy-cong.vu@wandercraft.eu \
    /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.