David,

On Mon, Apr 10, 2000 at 05:02:25PM -0400, David J. Christini wrote:
> I've seen a couple of posts on this list regarding strange floating point
> related crashes. I'm having such a problem, and I can't seem to solve it.
> 
> I believe it involves the fact that my floating point variables are in
> shared memory (using mbuff with volatile ... however I had the same
> crashing problems last week before I switched over to mbuff from the old
> shared memory approach). I #include <float.h> and pthread_setfp_np. I use
> the following shared memory struct:
> 
> typedef struct {
>     unsigned char head;
>     int scan_index;         //index holding current analog input scan
>     int current_fp;         //current value of fp
>     int current_xx;         //current value of state variable
>     //float g;              //g feedback proportionality control parameter
>     int g;                  //g feedback proportionality control parameter
>     unsigned int ai_chan[NUM_AD_CHANNELS_TO_USE]; 
>     unsigned char tail;
> } SharedMemStruct;                  
> 
> When I compile and run my application with only int's (as it currently
> reads), it doesn't crash. However if I change g to float, my application
> crashes my computer occasionally, but not always. The application has
> three floating point operations involving g.
> 
> Is there anything I should be doing to avoid this? My application, which
> is a feedback control process, needs to use float for g, so I don't really
> know how to get around this ... the one thing I'm considering is trying
> RTAI ... any thoughts?
> 

I use kernel 2.2.13, RTL 2.0. My RT application uses double variables
and operations heavily including sin(), cos(), sqrt(), atan2(). I also
use shared memory (Tomek Motylewski's mbuff). I don't remember any
crash caused by floating point operations. I'd expect your trouble is
caused by something else (float/double confusion?, kernel/user memory
context trouble?).

Regards,

-- 
..........................................................................
Pavel Andris                               | tel: +421 7 5941 2167
Institute of Control Theory and Robotics   | fax: +421 7 5477 6045
Slovak Academy of Sciences                 | 
Dubravska cesta 9                          | e-mail: [EMAIL PROTECTED]
SK - 842 37 Bratislava                     |
Slovakia                                   |
..........................................................................
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to