Menu

#355 Increased frequency of crashes on macOS Sonoma

djview
closed
nobody
None
5
2025-04-15
2023-11-20
Terje Bless
No

On macOS Sonoma (14), djview has started crashing (SIGSEGV) a lot more frequently. I've not seen anything obvious in the crash logs, but recurring stacks is mutex related functions and IW44 decode functions. The thread actually crashing is in malloc (free). This jibes well with when it crashes: when scrolling the list of page thumbnails (so thumbs are being generated), or when selecting certain pages (some pages seem to be more likely to cause crashes).

My guess is that it's an underlying race condition that's just getting tickled more often on Sonoma than earlier versions (I've seen crashes like it previously, but much less frequent).

One crash trace looks like:

Thread 3 Crashed:
0   libsystem_malloc.dylib                 0x18cf1b9b8 tiny_free_list_add_ptr + 264
1   libsystem_malloc.dylib                 0x18cf1b2bc tiny_free_no_lock + 644
2   libsystem_malloc.dylib                 0x18cf1aeb4 free_tiny + 496
3   libdjvulibre.21.dylib                  0x103086ce0 DJVU::DataPool::clear_stream(bool) + 312
4   libdjvulibre.21.dylib                  0x10308aeb4 DJVU::DataPool::get_data(void*, int, int, int) + 1032
5   libdjvulibre.21.dylib                  0x10308aea0 DJVU::DataPool::get_data(void*, int, int, int) + 1012
6   libdjvulibre.21.dylib                  0x10308aea0 DJVU::DataPool::get_data(void*, int, int, int) + 1012
7   libdjvulibre.21.dylib                  0x10308be30 DJVU::PoolByteStream::read(void*, unsigned long) + 104
8   libdjvulibre.21.dylib                  0x1030c4964 0x10307c000 + 297316
9   libdjvulibre.21.dylib                  0x10311b4dc DJVU::IFFByteStream::read(void*, unsigned long) + 136
10  libdjvulibre.21.dylib                  0x10313d430 DJVU::ZPCodec::preload() + 100
11  libdjvulibre.21.dylib                  0x10313d608 DJVU::ZPCodec::decode_sub(unsigned char&, unsigned int) + 332
12  libdjvulibre.21.dylib                  0x1031241e8 DJVU::IW44Image::Codec::decode_buckets(DJVU::ZPCodec&, int, int, DJVU::IW44Image::Block&, int, int) + 428
13  libdjvulibre.21.dylib                  0x103123ff4 DJVU::IW44Image::Codec::Decode::code_slice(DJVU::ZPCodec&) + 112
14  libdjvulibre.21.dylib                  0x103127fa4 DJVU::IWPixmap::decode_chunk(DJVU::GP<DJVU::ByteStream>) + 1228
15  libdjvulibre.21.dylib                  0x1030bc190 DJVU::DjVuFile::decode_chunk(DJVU::GUTF8String const&, DJVU::GP<DJVU::ByteStream> const&, bool, bool, bool) + 1496
16  libdjvulibre.21.dylib                  0x1030b9a64 DJVU::DjVuFile::decode(DJVU::GP<DJVU::ByteStream> const&) + 532
17  libdjvulibre.21.dylib                  0x1030b91bc DJVU::DjVuFile::decode_func() + 164
18  libdjvulibre.21.dylib                  0x1030b909c DJVU::DjVuFile::static_decode_func(void*) + 56
19  libdjvulibre.21.dylib                  0x1031102ac DJVU::GThread::start(void*) + 52
20  libsystem_pthread.dylib                0x18d0fd034 _pthread_start + 136
21  libsystem_pthread.dylib                0x18d0f7e3c thread_start + 8
Thread 4 Crashed:
0   libsystem_malloc.dylib                 0x18cf18cb0 tiny_malloc_from_free_list + 244
1   libsystem_malloc.dylib                 0x18cf1853c tiny_malloc_should_clear + 288
2   libsystem_malloc.dylib                 0x18cf172c8 szone_malloc_should_clear + 92
3   libc++abi.dylib                        0x18d0b6528 operator new(unsigned long) + 32
4   libdjvulibre.21.dylib                  0x104b9af64 DJVU::DataPool::OpenFiles::request_stream(DJVU::GURL const&, DJVU::GP<DJVU::DataPool>) + 128
5   libdjvulibre.21.dylib                  0x104b9efac DJVU::DataPool::get_data(void*, int, int, int) + 1280
6   libdjvulibre.21.dylib                  0x104b9eea0 DJVU::DataPool::get_data(void*, int, int, int) + 1012
7   libdjvulibre.21.dylib                  0x104b9eea0 DJVU::DataPool::get_data(void*, int, int, int) + 1012
8   libdjvulibre.21.dylib                  0x104b9eea0 DJVU::DataPool::get_data(void*, int, int, int) + 1012
9   libdjvulibre.21.dylib                  0x104b9fe30 DJVU::PoolByteStream::read(void*, unsigned long) + 104
10  libdjvulibre.21.dylib                  0x104bd8964 0x104b90000 + 297316
11  libdjvulibre.21.dylib                  0x104c2f4dc DJVU::IFFByteStream::read(void*, unsigned long) + 136
12  libdjvulibre.21.dylib                  0x104c51430 DJVU::ZPCodec::preload() + 100
13  libdjvulibre.21.dylib                  0x104c51608 DJVU::ZPCodec::decode_sub(unsigned char&, unsigned int) + 332
14  libdjvulibre.21.dylib                  0x104c38614 DJVU::IW44Image::Codec::decode_buckets(DJVU::ZPCodec&, int, int, DJVU::IW44Image::Block&, int, int) + 1496
15  libdjvulibre.21.dylib                  0x104c37ff4 DJVU::IW44Image::Codec::Decode::code_slice(DJVU::ZPCodec&) + 112
16  libdjvulibre.21.dylib                  0x104c3bfa4 DJVU::IWPixmap::decode_chunk(DJVU::GP<DJVU::ByteStream>) + 1228
17  libdjvulibre.21.dylib                  0x104bd04a4 DJVU::DjVuFile::decode_chunk(DJVU::GUTF8String const&, DJVU::GP<DJVU::ByteStream> const&, bool, bool, bool) + 2284
18  libdjvulibre.21.dylib                  0x104bcda64 DJVU::DjVuFile::decode(DJVU::GP<DJVU::ByteStream> const&) + 532
19  libdjvulibre.21.dylib                  0x104bcd1bc DJVU::DjVuFile::decode_func() + 164
20  libdjvulibre.21.dylib                  0x104bcd09c DJVU::DjVuFile::static_decode_func(void*) + 56
21  libdjvulibre.21.dylib                  0x104c242ac DJVU::GThread::start(void*) + 52
22  libsystem_pthread.dylib                0x18d0fd034 _pthread_start + 136
23  libsystem_pthread.dylib                0x18d0f7e3c thread_start + 8
Thread 5 Crashed:
0   libsystem_malloc.dylib                 0x18cf18c40 tiny_malloc_from_free_list + 132
1   libsystem_malloc.dylib                 0x18cf1853c tiny_malloc_should_clear + 288
2   libsystem_malloc.dylib                 0x18cf172c8 szone_malloc_should_clear + 92
3   libc++abi.dylib                        0x18d0b6528 operator new(unsigned long) + 32
4   libdjvulibre.21.dylib                  0x100f3ef64 DJVU::DataPool::OpenFiles::request_stream(DJVU::GURL const&, DJVU::GP<DJVU::DataPool>) + 128
5   libdjvulibre.21.dylib                  0x100f42fac DJVU::DataPool::get_data(void*, int, int, int) + 1280
6   libdjvulibre.21.dylib                  0x100f42ea0 DJVU::DataPool::get_data(void*, int, int, int) + 1012
7   libdjvulibre.21.dylib                  0x100f42ea0 DJVU::DataPool::get_data(void*, int, int, int) + 1012
8   libdjvulibre.21.dylib                  0x100f42ea0 DJVU::DataPool::get_data(void*, int, int, int) + 1012
9   libdjvulibre.21.dylib                  0x100f43e30 DJVU::PoolByteStream::read(void*, unsigned long) + 104
10  libdjvulibre.21.dylib                  0x100f7c964 0x100f34000 + 297316
11  libdjvulibre.21.dylib                  0x100fd34dc DJVU::IFFByteStream::read(void*, unsigned long) + 136
12  libdjvulibre.21.dylib                  0x100ff5430 DJVU::ZPCodec::preload() + 100
13  libdjvulibre.21.dylib                  0x100ff558c DJVU::ZPCodec::decode_sub(unsigned char&, unsigned int) + 208
14  libdjvulibre.21.dylib                  0x100fdc614 DJVU::IW44Image::Codec::decode_buckets(DJVU::ZPCodec&, int, int, DJVU::IW44Image::Block&, int, int) + 1496
15  libdjvulibre.21.dylib                  0x100fdbff4 DJVU::IW44Image::Codec::Decode::code_slice(DJVU::ZPCodec&) + 112
16  libdjvulibre.21.dylib                  0x100fdffa4 DJVU::IWPixmap::decode_chunk(DJVU::GP<DJVU::ByteStream>) + 1228
17  libdjvulibre.21.dylib                  0x100f74190 DJVU::DjVuFile::decode_chunk(DJVU::GUTF8String const&, DJVU::GP<DJVU::ByteStream> const&, bool, bool, bool) + 1496
18  libdjvulibre.21.dylib                  0x100f71a64 DJVU::DjVuFile::decode(DJVU::GP<DJVU::ByteStream> const&) + 532
19  libdjvulibre.21.dylib                  0x100f711bc DJVU::DjVuFile::decode_func() + 164
20  libdjvulibre.21.dylib                  0x100f7109c DJVU::DjVuFile::static_decode_func(void*) + 56
21  libdjvulibre.21.dylib                  0x100fc82ac DJVU::GThread::start(void*) + 52
22  libsystem_pthread.dylib                0x18d0fd034 _pthread_start + 136
23  libsystem_pthread.dylib                0x18d0f7e3c thread_start + 8

Discussion

  • Leon Bottou

    Leon Bottou - 2024-10-18

    Not the same experience here. Things seem to work well under both Sonoma and Sequoia.
    Short of a reproducible crash, this is hard to debug.

     
  • Leon Bottou

    Leon Bottou - 2025-04-15
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB