On 07/01/2019 19:57, Frank Scheiner wrote:
root@powermac-g5:~# gdb --args /sbin/fsck.hfs -d /dev/sda2
GNU gdb (Debian 8.2-1) 8.2
[...]
Reading symbols from /sbin/fsck.hfs...done.
(gdb) run
Starting program: /sbin/fsck.hfs -d /dev/sda2
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/powerpc64-linux-gnu/libthread_db.so.1".
** /dev/sda2
Using cacheBlockSize=32K cacheTotalBlock=1024 cacheSize=32768K.
** Checking HFS volume.
Program received signal SIGSEGV, Segmentation fault.
0x0000000100034be4 in hfs_swap_HFSBTInternalNode (src=0x7fffffffd378,
fcb=0x100081898, direction=kSwapBTNodeBigToHost) at hfs_endian.c:883
883 hfs_endian.c: No such file or directory.
(gdb) bt
[...]
Interesting. So line 883 appears to be:
nextRecord = (char *)src->buffer + srcOffs[i-1];
Certainly there is some interesting pointer arithmetic going on there (and if i == 0
then you're reading something before src->buffer). Can you try the following commands
in gdb:
p src
p srcDesc
p srcOffs
p sizeof(UInt16)