borisbrodski / sevenzipjbinding

7-Zip-JBinding
http://sevenzipjbind.sourceforge.net/
Other
176 stars 50 forks source link

Crash on macOS #62

Open ahadas opened 1 year ago

ahadas commented 1 year ago

Hello, sevenzipjbinding is used for RARv5 and 7z archives in muCommander quite well for over a year Two weeks ago a crash was reported and it seems from the dump file that the thread that crashed was in code that was called from sevenzipjbinding:

Thread 53 Crashed:: Java: Thread-305
0   ???                                     0x7ff8944b69a8 ???
1   libsystem_kernel.dylib                  0x7ff80486f202 __pthread_kill + 10
2   libsystem_pthread.dylib                 0x7ff8048a6ee6 pthread_kill + 263
3   libsystem_c.dylib                       0x7ff8047cdb45 abort + 123
4   libjvm.dylib                               0x10a992941 os::abort(bool, void*, void const*) + 49
5   libjvm.dylib                               0x10ac36966 VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long) + 3158
6   libjvm.dylib                               0x10ac35cdc VMError::report_and_die(Thread*, unsigned int, unsigned char*, void*, void*, char const*, ...) + 156
7   libjvm.dylib                               0x10ac36a61 VMError::report_and_die(Thread*, unsigned int, unsigned char*, void*, void*) + 33
8   libjvm.dylib                               0x10aaaff5c JVM_handle_bsd_signal + 332
9   libsystem_platform.dylib                0x7ff8048d45ed _sigtramp + 29
10  ???                                                0x0 ???
11  lib7-Zip-JBinding.dylib                    0x1bde1a7e0 Java_net_sf_sevenzipjbinding_impl_InArchiveImpl_nativeGetStringProperty + 256
12  ???                                        0x115f03f67 ???
13  ???                                        0x10e5a4e54 ???
14  ???                                        0x11591638a ???
15  ???                                        0x11591656d ???
16  ???                                        0x11591656d ???
17  ???                                        0x11591638a ???
18  ???                                        0x11620dbe8 ???
19  ???                                 0xffff845b001b7800 ???

Full report: bugreport3.txt Apparently it reproduced several times on macOS 13.4.1 x86_64, but I couldn't reproduce it on macOS 12.6.7 Any hint / help in investigating this would be appreciated!

borisbrodski commented 1 year ago

Hello, thank you for the report. Can you compose a small example including the RAR file, that reproduces the problem? I need to look at it in debugger.

ahadas commented 1 year ago

@borisbrodski it would be ideal to have such a simplified example to work with but unfortunately I didn't even manage to reproduce it yet. looking at the latest post on the original issue, it looks like a race so I'm not sure it would be easy to find a reproducer without deeper knowledge of the library... but we can try :)

borisbrodski commented 1 year ago

Ok, I understand. It's very hard to tell, where is the bug. The stacktrace indicates broken memory at the first glace.

If the actual bug is in 7zip engine or in 7-Zip-JBinding, I would expect it the be reproducible with the same archive/same actions. (It must not be, but often is)

I can give you 7-Zip-JBinding version with debug symbols. (Or instructions to build one yourself) The crash dump of it will have much more information to start with.

I plan to start porting 7-Zip-JBinding to the new version 7z engine. Maybe the problem will go away after that.

ahadas commented 1 year ago

@borisbrodski thanks, a version with debug symbols would be appreciated. The reporter also mentioned that it happened when trying to access an archive that no longer exists (which happens in muCommander when we open the list of recently-accessed files/folders and some of the items have already been removed), maybe that can explain he broken memory part? I don't think they had a corrupted archive since such archives are not supposed to be in the recently-accessed files/folders list