All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Webb <jeff.webb@domain.hid>
Cc: Xenomai help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] invalid use of FPU in Xenomai context
Date: Fri, 15 Sep 2006 09:39:37 -0500	[thread overview]
Message-ID: <450ABB29.9000304@domain.hid> (raw)
In-Reply-To: <1158308720.5009.37.camel@domain.hid>

Philippe Gerum wrote:
> On Thu, 2006-09-14 at 17:47 -0500, Jeff Webb wrote:
>> I made some more progress in porting my RTLinux application, but now I'm spinning my wheels trying to track down the source of the following error:
>>
>>   "invalid use of FPU in Xenomai context at ..."
> 
> This message also gives the faulty location/symbol+offset. Where does it
> point to?

It's coming from some simple floating point operations in my application code.  The relevant code snippet is:

  print_msg(TRACE_MSG, "rt_delay_sim\n");
  print_msg(INFO_MSG, "jeff rt_delay: 1\n");
  actual_dt = sim_dt / rt_speed_factor + rt_skew_correction;
  print_msg(INFO_MSG, "jeff rt_delay: 2\n");

The kernel message output is:

  Sep 15 09:17:34 kernel: rt_delay_sim
  Sep 15 09:17:34 kernel: jeff rt_delay: 1
  Sep 15 09:17:34 kernel: invalid use of FPU in Xenomai context at [fc264152]
  Sep 15 09:17:34 kernel: Xenomai: suspending kernel thread c1ca3730 ('c1ca3730') at
  0xfc264152 after exception #7

The variables in question are doubles.  The faulty location offset is somewhere in the rt_delay_sim routine, as you would expect from the output above.  This specific code does not appear to be the problem, though.  If I remove the call to the rt_delay_sim routine, I simply get a floating point exception in another location.

The strange thing is that I can do a loop of floating point operations at the beginning of my real-time thread without any problem:

  for (i=0; i<1001; i++)
    {
      f = f * 1.0 + 0.1;
    };  
  print_msg(INFO_MSG, "f = %d\n", (int)f);

but once I get into my real application code, I get the above error after executing several floating point operations.  My 'real application code' is actually a linked list of routines that reside in other kernel modules.  I wish I could come up with a simple example that caused the same problem...  I will keep trying.

As I said before, I am porting an application that works properly under RTLinux GPL, and am making some small changes to compile with Xenomai POSIX threads/timers and RTAI FIFOs.

Thanks,

Jeff



  reply	other threads:[~2006-09-15 14:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-14 22:47 [Xenomai-help] invalid use of FPU in Xenomai context Jeff Webb
2006-09-15  8:25 ` Philippe Gerum
2006-09-15 14:39   ` Jeff Webb [this message]
2006-09-15  9:12 ` Gilles Chanteperdrix
2006-09-15 14:43   ` Jeff Webb
     [not found]     ` <17674.48814.824895.814925@domain.hid>
2006-09-15 20:33       ` Jeff Webb
     [not found] <450B2BE1.1050105@domain.hid>
2006-09-16  4:38 ` Fw: [Fwd: Re: [Xenomai-help] invalid use of FPU in Xenomai context] Jeff Webb
2006-09-18 20:40   ` [Xenomai-help] invalid use of FPU in Xenomai context Jeff Webb
2006-09-18 21:23     ` Philippe Gerum
2006-10-25 20:00       ` Jeff Webb
2006-10-25 20:24         ` Jan Kiszka
2006-10-25 20:43           ` Jeff Webb
2006-10-25 23:37           ` Jeff Webb
2006-10-27 16:30             ` Jeff Webb

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=450ABB29.9000304@domain.hid \
    --to=jeff.webb@domain.hid \
    --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.