Skip to content

Thumbnailer assertion on application exit

Systematic crash on exit.

a9fdd37fefdc5c173ab3a58d089f51ef4d79fac9 is the first bad commit
commit a9fdd37fefdc5c173ab3a58d089f51ef4d79fac9
Author: Thomas Guillem <thomas@gllm.fr>
Date:   Tue Oct 15 15:52:50 2024 +0200

    thumbnailer: use an unsigned for the request identification
    
    This id can be used to cancel a task.
    
    vlc_thumbnailer_DestroyRequest() had been renamed to
    vlc_thumbnailer_Cancel(). The new function is optional and can be used
    to cancel a task. The user doesn't have the responsibility to free the
    request anymore.

 include/vlc_thumbnailer.h                 | 41 ++++++++++++++++++-----------------------
 lib/media.c                               | 12 ++++++------
 modules/misc/medialibrary/Thumbnailer.cpp | 13 ++++++-------
 modules/misc/medialibrary/medialibrary.h  |  2 --
 src/input/thumbnailer.c                   | 19 ++++++-------------
 src/libvlccore.sym                        |  2 +-
 test/src/input/thumbnail.c                | 13 ++++++-------
 7 files changed, 43 insertions(+), 59 deletions(-)
╰─$ git bisect log                                                                                                                                                                                                141 ↵
git bisect start
# status: waiting for both good and bad commits
# good: [b38a4eb4ee57936a93df5a85ed0fdd7807e5f799] macosx: Fix positioning of audio decorative view
git bisect good b38a4eb4ee57936a93df5a85ed0fdd7807e5f799
# status: waiting for bad commit, 1 good commit known
# bad: [9dbb3612fdca8764981b1404792254061f19d42f] qt: properly handle clicking on csd buttons on windows
git bisect bad 9dbb3612fdca8764981b1404792254061f19d42f
# bad: [f44cb4e6fef403e94a6e21ce89a6253c63ad7ffe] meson: define chroma_copy tests with vlc_tests
git bisect bad f44cb4e6fef403e94a6e21ce89a6253c63ad7ffe
# bad: [edd9b3874a51e4679efd792fad1648d6aa10ff67] meson: add missing windows audio output
git bisect bad edd9b3874a51e4679efd792fad1648d6aa10ff67
# bad: [c13b2803803c224561620a8cb8e7815b61028463] contrib: libaribcaption: fix libunwind usage when static linking
git bisect bad c13b2803803c224561620a8cb8e7815b61028463
# bad: [a9fdd37fefdc5c173ab3a58d089f51ef4d79fac9] thumbnailer: use an unsigned for the request identification
git bisect bad a9fdd37fefdc5c173ab3a58d089f51ef4d79fac9
# good: [30a9789571519b04a2b0246227f4db5254ddd656] medialibrary: add missing error check
git bisect good 30a9789571519b04a2b0246227f4db5254ddd656
# good: [69413e1db517b82c09433b3f5fbe5abae11586c6] thumbnailer: store requests internally
git bisect good 69413e1db517b82c09433b3f5fbe5abae11586c6
# first bad commit: [a9fdd37fefdc5c173ab3a58d089f51ef4d79fac9] thumbnailer: use an unsigned for the request identification

On master, sometimes it breaks on

* thread #15, name = 'vlc-run-thumb', stop reason = EXC_BAD_ACCESS (code=1, address=0x170d82d00)
    frame #0: 0x0000000100c1a538 libmedialibrary_plugin.dylib`Thumbnailer::onThumbnailComplete(thumbnail=0x0000000000000000, data=0x0000000170d82d00) at Thumbnailer.cpp:50:43 [opt]
   47  	{
   48  	   ThumbnailerCtx* ctx = static_cast<ThumbnailerCtx*>( data );
   49  	
-> 50  	   vlc::threads::mutex_locker lock( ctx->thumbnailer->m_mutex );
   51  	   ctx->done = true;
   52  	   if (thumbnail != nullptr)
   53  	       ctx->thumbnail = picture_Hold(thumbnail);
Target 0: (vlc-osx-static) stopped.
warning: libmedialibrary_plugin.dylib was compiled with optimization - stepping may behave oddly; variables may not be available.
(lldb) bt
* thread #15, name = 'vlc-run-thumb', stop reason = EXC_BAD_ACCESS (code=1, address=0x170d82d00)
  * frame #0: 0x0000000100c1a538 libmedialibrary_plugin.dylib`Thumbnailer::onThumbnailComplete(thumbnail=0x0000000000000000, data=0x0000000170d82d00) at Thumbnailer.cpp:50:43 [opt]
    frame #1: 0x0000000100695424 libvlccore.dylib`RunnableRun [inlined] NotifyThumbnail(task=0x0000600001acd380, pic=<unavailable>) at thumbnailer.c:110:5 [opt]
    frame #2: 0x0000000100695418 libvlccore.dylib`RunnableRun(userdata=0x0000600001acd380) at thumbnailer.c:217:5 [opt]
    frame #3: 0x00000001006ba960 libvlccore.dylib`ThreadRun(userdata=0x0000600003bdc7b0) at executor.c:134:9 [opt]
    frame #4: 0x00000001989e2f94 libsystem_pthread.dylib`_pthread_start + 136

Sometimes it breaks in the executor on

    assert(vlc_list_is_empty(&executor->queue));
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information