Skip to content

Initial attempt at floating point debugging - #2340

Open
vatral wants to merge 2 commits into
overte-org:masterfrom
vatral:fpe-debugging
Open

Initial attempt at floating point debugging#2340
vatral wants to merge 2 commits into
overte-org:masterfrom
vatral:fpe-debugging

Conversation

@vatral

@vatral vatral commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

This is a bit of a hack to try to get to the bottom of all the NaN issues.

It adds a new parameter, which allows to enable floating point exceptions. There's a hack to disable this around QML because when enabled, there's an apparently limitless amount of divides by zero coming from the QML for AvatarInputsBar.qml for some reason.

With this patch, and running interface --floatExcept divbyzero here's what I get:

Thread 81 "Thread (pooled)" hit Breakpoint 5, fpe_handler (signum=8) at /home/vadim/git/overte/overte/interface/src/main.cpp:59
59	   ++fpe_counter;
(gdb) bt
#0  fpe_handler (signum=8) at /home/vadim/git/overte/overte/interface/src/main.cpp:59
#1  0x00007fffcce210b0 in <signal handler called> () at /lib64/libc.so.6
#2  _mm256_div_ps(float __vector(8), float __vector(8)) (__A=..., __B=...) at /usr/lib/gcc/x86_64-redhat-linux/16/include/avxintrin.h:227
#3  packBlendshapeOffsets_AVX2 (unpacked=unpacked@entry=0x7ffe602c9948, packed=packed@entry=0x7ffe60034aa8, size=size@entry=559)
    at /home/vadim/git/overte/overte/libraries/shared/src/avx2/BlendshapePacking_avx2.cpp:65
#4  0x00007ffff5cb9c10 in packBlendshapeOffsets (unpacked=unpacked@entry=0x7ffe602c9948, packed=0x7ffe60034aa8, size=559)
    at /home/vadim/git/overte/overte/libraries/render-utils/src/Model.cpp:1888
#5  0x00007ffff5cbac92 in Blender::run (this=0x31a37c60) at /home/vadim/git/overte/overte/libraries/render-utils/src/Model.cpp:1991
#6  0x00007ffff5e5dccb in QThreadPoolThread::run (this=0x27b594c0) at thread/qthreadpool.cpp:100
#7  0x00007ffff5e5aaaa in operator() (__closure=<optimized out>) at thread/qthread_unix.cpp:350
#8  (anonymous namespace)::terminate_on_exception<QThreadPrivate::start(void*)::<lambda()> > (t=<optimized out>) at thread/qthread_unix.cpp:287
#9  QThreadPrivate::start (arg=0x27b594c0) at thread/qthread_unix.cpp:310
#10 0x00007fffcce79d19 in start_thread (arg=<optimized out>) at pthread_create.c:454
#11 0x00007fffccefd64c in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
(gdb) frame 4
#4  0x00007ffff5cb9c10 in packBlendshapeOffsets (unpacked=unpacked@entry=0x7ffe602c9948, packed=0x7ffe60034aa8, size=559)
    at /home/vadim/git/overte/overte/libraries/render-utils/src/Model.cpp:1888
1888	       packBlendshapeOffsets_AVX2((float(*)[9])unpacked, (uint32_t(*)[4])packed, size);
(gdb) print unpacked
$6 = (BlendshapeOffsetUnpacked *) 0x7ffe602c9948
(gdb) print *unpacked
$7 = {positionOffsetX = 0, positionOffsetY = 0, positionOffsetZ = 0, normalOffsetX = 0, normalOffsetY = 0, normalOffsetZ = 0, tangentOffsetX = 0, tangentOffsetY = 0, 
  tangentOffsetZ = 0}
(gdb) frame 3
#3  packBlendshapeOffsets_AVX2 (unpacked=unpacked@entry=0x7ffe602c9948, packed=packed@entry=0x7ffe60034aa8, size=size@entry=559)
    at /home/vadim/git/overte/overte/libraries/shared/src/avx2/BlendshapePacking_avx2.cpp:65
65	       __m256 rcp = _mm256_div_ps(_mm256_set1_ps(1.0f), len);
(gdb) print len
$8 = {0, 0, 0, 0, 0, 0, 0, 0}
(gdb)  

@ada-tv -- Does this help any?

@vatral
vatral requested a review from ada-tv June 18, 2026 18:13
Comment thread libraries/qml/src/qml/OffscreenSurface.cpp

@ada-tv ada-tv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Windows build is failing. I don't think fedisableexcept has an equivalent on Windows, so the OffscreenSurface changes might need to be ifdef'd.

libraries\qml\src\qml\OffscreenSurface.cpp(468,5): error C3861: 'fedisableexcept': identifier not found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants