Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug builds crash with assert on custom font URL #1132

Open
JulianGro opened this issue Sep 7, 2024 · 3 comments · Fixed by #1111
Open

debug builds crash with assert on custom font URL #1132

JulianGro opened this issue Sep 7, 2024 · 3 comments · Fixed by #1111
Assignees
Labels
bug Something isn't working

Comments

@JulianGro
Copy link
Member

JulianGro commented Sep 7, 2024

Adding https://data. as font URL for a text entity, apparently makes debug builds exit with an assert.
Apparently, a working URL such as currently https://data.moto9000.moe/nishiki-teki_3.99zhb.arfont also throws an assert.

@JulianGro JulianGro added the bug Something isn't working label Sep 7, 2024
@JulianGro JulianGro changed the title debug builds crash with assert on broken font URL debug builds crash with assert on custom font URL Sep 7, 2024
@daleglass
Copy link
Contributor

Backtrace:

#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007fffe0ca86d3 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:78
#2  0x00007fffe0c4fc4e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007fffe0c37902 in __GI_abort () at abort.c:79
#4  0x00007fffe0c3781e in __assert_fail_base (fmt=0x7fffe0dc3b98 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7ffff650bd7b "result", file=file@entry=0x7ffff65099e8 "/home/dale/git/overte/overte/libraries/shared/src/Transform.h", line=line@entry=42, function=function@entry=0x7ffff650bd62 "bool isValidScale(float)")
    at assert.c:94
#5  0x00007fffe0c47d87 in __assert_fail (assertion=0x7ffff650bd7b "result", file=0x7ffff65099e8 "/home/dale/git/overte/overte/libraries/shared/src/Transform.h", line=42, function=0x7ffff650bd62 "bool isValidScale(float)") at assert.c:103
#6  0x00007ffff6132b8f in isValidScale (scale=<optimized out>) at /home/dale/git/overte/overte/libraries/shared/src/Transform.h:42
#7  Transform::setScale (this=0x7fff31ffda40, scale=<optimized out>) at /home/dale/git/overte/overte/libraries/shared/src/Transform.h:336
#8  render::entities::TextPayload::render (this=<optimized out>, args=<optimized out>) at /home/dale/git/overte/overte/libraries/entities-renderer/src/RenderableTextEntityItem.cpp:359
#9  0x00007ffff4ad6c3a in render::Item::render (this=0x3102a498, args=0x7fff31ffe900) at /home/dale/git/overte/overte/libraries/render/src/render/Item.h:499
#10 render::renderStateSortShapes (renderContext=<optimized out>, shapeContext=<optimized out>, inItems=<optimized out>, maxDrawnItems=<optimized out>, globalKey=<optimized out>) at /home/dale/git/overte/overte/libraries/render/src/render/DrawTask.cpp:137
#11 0x00007ffff50d0e98 in operator() (__closure=0x7ffec4fc7990, batch=...) at /home/dale/git/overte/overte/libraries/render-utils/src/RenderForwardTask.cpp:293
#12 0x00007ffff377e2ae in std::function<void(gpu::Batch&)>::operator() (this=0x7fff31ffdde0, __args#0=<optimized out>) at /usr/include/c++/14/bits/std_function.h:591
#13 gpu::doInBatch (name=name@entry=0x7ffff5153eb0 "DrawForward::run", context=std::shared_ptr<gpu::Context> (use count 7, weak count 0) = {...}, f=...) at /home/dale/git/overte/overte/libraries/gpu/src/gpu/Context.cpp:434
#14 0x00007ffff50d114d in DrawForward::run (this=this@entry=0xc6452f8, renderContext=std::shared_ptr<render::RenderContext> (use count 1, weak count 0) = {...}, inputs=...) at /home/dale/git/overte/overte/libraries/render-utils/src/RenderForwardTask.cpp:263
#15 0x00007ffff50d5652 in task::jobRun<DrawForward, std::shared_ptr<render::RenderContext>, task::VaryingSet3<std::vector<render::ItemBound, std::allocator<render::ItemBound> >, std::shared_ptr<LightingModel>, std::shared_ptr<HazeStage::Frame> > >
    (data=..., jobContext=std::shared_ptr<render::RenderContext> (use count 1, weak count 0) = {...}, input=..., output=<optimized out>) at /home/dale/git/overte/overte/libraries/task/src/task/Task.h:104
#16 task::Job<render::RenderContext, render::RenderTimeProfiler>::Model<DrawForward, task::JobConfig, task::VaryingSet3<std::vector<render::ItemBound, std::allocator<render::ItemBound> >, std::shared_ptr<LightingModel>, std::shared_ptr<HazeStage::Frame> >, task::JobNoIO>::run
    (this=0xc6452c0, jobContext=std::shared_ptr<render::RenderContext> (use count 1, weak count 0) = {...}) at /home/dale/git/overte/overte/libraries/task/src/task/Task.h:180
#17 0x00007ffff5106d75 in task::Job<render::RenderContext, render::RenderTimeProfiler>::run (this=<synthetic pointer>, jobContext=<optimized out>) at /home/dale/git/overte/overte/libraries/task/src/task/Task.h:218
#18 task::Task<render::RenderContext, render::RenderTimeProfiler>::TaskModel<RenderForwardTask, RenderForwardTaskConfig, task::VaryingSet3<task::VaryingSet2<task::VaryingArray<std::vector<render::ItemBound, std::allocator<render::ItemBound> >, 10>, render::ItemSpatialTree::ItemSelection>, std::shared_ptr<LightingModel>, task::VaryingSet2<task::VaryingSet4<std::shared_ptr<LightStage::Frame>, std::shared_ptr<BackgroundStage::Frame>, std::shared_ptr<HazeStage::Frame>, std::shared_ptr<BloomStage::Frame> >, std::vector<render::ItemBound, std::allocator<render::ItemBound> > > >, task::JobNoIO>::run
    (this=<optimized out>, jobContext=std::shared_ptr<render::RenderContext> (use count 1, weak count 0) = {...}) at /home/dale/git/overte/overte/libraries/task/src/task/Task.h:336
#19 0x00000000007923a8 in task::Job<render::RenderContext, render::RenderTimeProfiler>::run (this=0x5d265f0, jobContext=std::shared_ptr<render::RenderContext> (use count 1, weak count 0) = {...}) at /usr/include/c++/14/bits/shared_ptr_base.h:1666
#20 0x00007ffff5105e8a in task::Switch<render::RenderContext, render::RenderTimeProfiler>::SwitchModel<DeferredForwardSwitchJob, task::JobConfig, task::VaryingSet3<task::VaryingSet2<task::VaryingArray<std::vector<render::ItemBound, std::allocator<render::ItemBound> >, 10>, render::ItemSpatialTree::ItemSelection>, std::shared_ptr<LightingModel>, task::VaryingSet2<task::VaryingSet4<std::shared_ptr<LightStage::Frame>, std::shared_ptr<BackgroundStage::Frame>, std::shared_ptr<HazeStage::Frame>, std::shared_ptr<BloomStage::Frame> >, std::vector<render::ItemBound, std::allocator<render::ItemBound> > > >, task::JobNoIO>::run (this=<optimized out>, jobContext=<optimized out>)
    at /home/dale/git/overte/overte/libraries/task/src/task/Task.h:477
#21 0x0000000000790f48 in task::Job<render::RenderContext, render::RenderTimeProfiler>::run (this=<synthetic pointer>, jobContext=<optimized out>) at /home/dale/git/overte/overte/libraries/task/src/task/Task.h:218
#22 task::Task<render::RenderContext, render::RenderTimeProfiler>::TaskModel<RenderViewTask, task::JobConfig, task::VaryingSet2<task::VaryingArray<std::vector<render::ItemBound, std::allocator<render::ItemBound> >, 10>, render::ItemSpatialTree::ItemSelection>, task::JobNoIO>::run
    (this=<optimized out>, jobContext=std::shared_ptr<render::RenderContext> (use count 1, weak count 0) = {...}) at /home/dale/git/overte/overte/libraries/task/src/task/Task.h:336
#23 0x00007ffff4adc410 in task::Job<render::RenderContext, render::RenderTimeProfiler>::run (this=<synthetic pointer>, jobContext=<optimized out>) at /home/dale/git/overte/overte/libraries/task/src/task/Task.h:218
#24 task::Task<render::RenderContext, render::RenderTimeProfiler>::TaskModel<EngineTask, task::JobConfig, task::JobNoIO, task::JobNoIO>::run (this=<optimized out>, jobContext=std::shared_ptr<render::RenderContext> (use count 1, weak count 0) = {...}) at /home/dale/git/overte/overte/libraries/task/src/task/Task.h:336
#25 0x00000000007923a8 in task::Job<render::RenderContext, render::RenderTimeProfiler>::run (this=0x4bce240, jobContext=std::shared_ptr<render::RenderContext> (use count 1, weak count 0) = {...}) at /usr/include/c++/14/bits/shared_ptr_base.h:1666
#26 0x000000000082bda5 in task::Engine<render::RenderContext, render::RenderTimeProfiler>::run (this=<optimized out>, jobContext=<optimized out>) at /home/dale/git/overte/overte/libraries/task/src/task/Task.h:524
#27 task::Engine<render::RenderContext, render::RenderTimeProfiler>::run (this=<optimized out>) at /home/dale/git/overte/overte/libraries/task/src/task/Task.h:519
#28 GraphicsEngine::render_runRenderFrame (this=this@entry=0x4bcd880, renderArgs=renderArgs@entry=0x7fff31ffe900) at /home/dale/git/overte/overte/interface/src/graphics/GraphicsEngine.cpp:128
#29 0x000000000082e884 in GraphicsEngine::render_performFrame (this=0x4bcd880) at /home/dale/git/overte/overte/interface/src/graphics/GraphicsEngine.cpp:288
#30 0x00000000008452d5 in RenderEventHandler::event (this=0x50c2ea0, event=<optimized out>) at /home/dale/git/overte/overte/interface/src/graphics/RenderEventHandler.cpp:49
#31 0x00007fffe238cc35 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x50c2ea0, e=0x7ffec4a8fdf0) at kernel/qapplication.cpp:3640
#32 0x00007ffff56b7178 in QCoreApplication::notifyInternal2 (receiver=0x50c2ea0, event=0x7ffec4a8fdf0) at kernel/qcoreapplication.cpp:1064
#33 0x00007ffff56b73a2 in QCoreApplication::sendEvent (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1462
#34 0x00007ffff56ba71c in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x50c9be0) at kernel/qcoreapplication.cpp:1821
#35 0x00007ffff56ba9cd in QCoreApplication::sendPostedEvents (receiver=<optimized out>, event_type=<optimized out>) at kernel/qcoreapplication.cpp:1680
#36 0x00007ffff570c0ff in postEventSourceDispatch (s=0x7ffec4000ef0) at kernel/qeventdispatcher_glib.cpp:277
#37 0x00007fffe051ae8c in g_main_dispatch (context=0x7ffec4000c30) at ../glib/gmain.c:3344
#38 g_main_context_dispatch_unlocked (context=0x7ffec4000c30) at ../glib/gmain.c:4152
#39 0x00007fffe057cc98 in g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x7ffec4000c30, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4217
#40 0x00007fffe051c383 in g_main_context_iteration (context=0x7ffec4000c30, may_block=1) at ../glib/gmain.c:4282
#41 0x00007ffff570bbed in QEventDispatcherGlib::processEvents (this=0x7ffec4000b70, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#42 0x00007ffff56b5adb in QEventLoop::exec (this=this@entry=0x7fff31fff190, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#43 0x00007ffff54ee827 in QThread::exec (this=<optimized out>) at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#44 0x00007ffff54efbc6 in operator() (__closure=<optimized out>) at thread/qthread_unix.cpp:350
#45 (anonymous namespace)::terminate_on_exception<QThreadPrivate::start(void*)::<lambda()> > (t=<optimized out>) at thread/qthread_unix.cpp:287
#46 QThreadPrivate::start (arg=0x50c2410) at thread/qthread_unix.cpp:310
#47 0x00007fffe0ca66d7 in start_thread (arg=<optimized out>) at pthread_create.c:447
#48 0x00007fffe0d2a60c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

@daleglass
Copy link
Contributor

Hm, debugger's being unhelpful, too much optimization. Will need a proper debug build for this one.

@HifiExperiments
Copy link
Member

HifiExperiments commented Sep 9, 2024

this was an issue with any font that failed to download (not just links that started with https://data.). we'd end up dividing by 0 when setting the scale. fix here: https://github.com/overte-org/overte/pull/1111/files#r1750914970

it was also a problem during font loading, which is why the working URL also threw an assert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants