Menu

#139 Deadlock in MK VIII EGPWS emulation

2.4.0
Fixed
nobody
None
2011-07-23
2010-06-26
Anonymous
No

Originally created by: bre... (code.google.com)@gmail.com

What steps will reproduce the problem?
Not easily reproduced. Happened with B737-300 just before landing at EDDF, with plane only a few feet above runway.

What is the expected output? What do you see instead?
Simulator deadlock.

What version of the product are you using? On what operating system?
GIT (2010-06-20), OpenSuSE 11.2

Please provide any additional information below.
Deadlock/infinite loop may be caused by "MK_VIII::Mode5Handler::get_soft_bias" in Instrumentation/mk_viii.cxx (line 3886):

MK_VIII::Mode5Handler::get_soft_bias (double initial_bias)
{
  while (is_soft(initial_bias))
    initial_bias += 0.2;

Method "get_soft_bias" was called with an extreme value
initial_bias = -4.3229706343512913e+155

Method will deadlock with such an extreme value due to limited floating-point precision (adding 0.2 does not change the value).
Not sure if another error triggered the extreme "initial_bias" value. But maybe an additional check could be reasonable to avoid such a deadlock if it *does* happen, e.g. add a condition "abs(initial_bias)<ReasonableValue" to avoid an infinite loop in get_soft_bias.

Manually changing the "initial_bias" to a reasonable value with GDB allowed me to continue with the simulation normally.

Discussion

  • Anonymous

    Anonymous - 2010-06-26

    Originally posted by: bre... (code.google.com)@gmail.com

    Ok, the strange value of "initial_bias" is a result of an uninitialzed member variable. Attached patch fixes the deadlock for me (initialize "soft_bias" to "0.0" in the constructor). But I haven't checked functionality... Someone should have a closer look...

     
  • Anonymous

    Anonymous - 2010-06-27

    Originally posted by: bre... (code.google.com)@gmail.com

    Ok, I had a deeper look into the module. The bias values make sure warnings are repeated whenever the altitude has changed by at least 20%.
    But all the bias factors are missing initialization. I did not get the "Too low! Flaps!" and "Too low! Gear!" warnings, since the random initial values of the respective bias factors were excessive. It's a similar issue like the one triggering the potential deadlock above.
    Attached patch now adds init values for *all* bias factors in the constructors (hxx file). This makes all the warnings work.
    Also, the bias factors must be reset once the warnings are cleared. Otherwise they are only working for a single flight without restarting the simulator. Attached patch also does this (modifications in cxx).

     
  • Anonymous

    Anonymous - 2011-06-05

    Originally posted by: bre... (code.google.com)@gmail.com

    (No comment was entered for this change.)

    Status: Temp

     
  • Anonymous

    Anonymous - 2011-06-05

    Originally posted by: bre... (code.google.com)@gmail.com

    (No comment was entered for this change.)

    Status: Fixed

     
  • Anonymous

    Anonymous - 2011-07-23

    Originally posted by: bre... (code.google.com)@gmail.com

    (No comment was entered for this change.)

    Labels: Milestone-2.4.0

     

Log in to post a comment.

MongoDB Logo MongoDB