Crash on start with UFO (_geo_inverse_wgs_84 infinite recusive calls)

Summary

On next branch (at least 6th of August 2025), when starting FG with UFO, after a few seconds, FG crashes.

Steps to reproduce

Launch using the UFO and wait, using : fgfs --aircraft=UFO

What is the current bug behavior?

The ingame menu appears, then crash.

What is the expected correct behavior?

No crash, just appearing at the default airport.

Relevant logs and/or screenshots

Nothing important in logs, but by launching using gdb, a Segmentation fault happens : _geo_inverse_wgs_84 is calling itself recursively non stop.

image

Here is the top of the stack:

image

System and version information

"next" branch, Linux OS

Possible fixes

In UFO.cxx, void FGUFO::update( double dt ), I notice the latitude (this->get_Latitude()) increase each time after the following call l.180:

    _set_Geocentric_Position( lat_geoc, get_Longitude(),
                             sl_radius + get_Altitude() + climb );

I suppose the latitude should be constant when the UFO starts and no input was done yet.

After many frames, the UFO then reaches the north pole, and the crash happens because _geo_inverse_wgs_84 does not handle limit cases very well.

Edited by Julien Nguyen