[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Problems with hfsprogs on G5 Power Macs



On 06/01/2019 20:48, Frank Scheiner wrote:

> Hi Mathieu,
> 
> On 1/4/19 08:51, Mathieu Malaterre wrote:
>> On Thu, Jan 3, 2019 at 5:54 PM Frank Scheiner <frank.scheiner@web.de> wrote:
>>> On 1/3/19 12:10, Mathieu Malaterre wrote:
>>>> The way you describe this bug makes me think of a 64bits vs 32bits
>>>> issue. Next time this happen to you, use a foreign powerpc
>>>> installation to run ppc32 binary on your G5.
>>>
>>> That's a good idea and I think we don't even have to wait for the next
>>> time this issue hits me, as even for a clean HFS the `fsck.hfs`
>>> segfaults. The significance of the result of such a test will not be the
>>> same as for checking a borked HFS, but could show a tendency.
>>
>> Right ! Good point.
>>
>>> Say, will a powerpc64 kernel from arch ppc64 work with a userland from
>>> arch powerpc or do I need the powerpc64 kernel from arch powerpc? Or are
>>> these kernels actually identical?
>>
>> If I understand your sentence, the answer is yes: they are identical.
>> The only (main?) difference with amd64/i386 world is that you cannot
>> run a ppc32 kernel on a ppc64 machine.
> 
> Ok. It works to use the powerpc64 kernel from arch ppc64 and a userland from arch
> powerpc with kernel modules of the powerpc64 kernel of arch powerpc. Hence I assume
> the powerpc64 kernels of arch ppc64 and powerpc are actually identical.
> 
> Back to the testing of the powerpc version of `fsck.hfs`. I first checked the HFS
> bootstrap FS on a Mac mini G4 to have a known state for later testing:
> 
> ```
> root@mac-mini:~# fsck.hfs -d -f /dev/sdb2
> ** /dev/sdb2
>     Using cacheBlockSize=32K cacheTotalBlock=1024 cacheSize=32768K.
> ** Checking HFS volume.
> ** Checking Extents Overflow file.
> ** Checking Catalog file.
>    Reserved fields in the catalog record have incorrect data
> (4, 185)
>    Reserved fields in the catalog record have incorrect data
> (4, 2)
>    Reserved fields in the catalog record have incorrect data
> (4, 2)
> ** Checking Catalog hierarchy.
> ** Checking volume bitmap.
> ** Checking volume information.
>    Verify Status: VIStat = 0x0000, ABTStat = 0x0000 EBTStat = 0x0000
>                   CBTStat = 0x0200 CatStat = 0x0000
> ** Repairing volume.
> ** Rechecking volume.
> ** Checking HFS volume.
> ** Checking Extents Overflow file.
> ** Checking Catalog file.
> ** Checking Catalog hierarchy.
> ** Checking volume bitmap.
> ** Checking volume information.
> ** The volume bootstrap was repaired successfully.
> 
> root@mac-mini:~# echo $?
> 0
> 
> root@mac-mini:~# fsck.hfs -d -f /dev/sdb2
> ** /dev/sdb2
>     Using cacheBlockSize=32K cacheTotalBlock=1024 cacheSize=32768K.
> ** Checking HFS volume.
> ** Checking Extents Overflow file.
> ** Checking Catalog file.
> ** Checking Catalog hierarchy.
> ** Checking volume bitmap.
> ** Checking volume information.
> ** The volume bootstrap appears to be OK.
> 
> root@mac-mini:~# echo $?
> 0
> ```
> 
> ...then tested the ppc64 version on the 11,2 G5 with the expected result (segfault):
> 
> ```
> root@powermac-g5:~# dpkg -l hfsprogs
> Desired=Unknown/Install/Remove/Purge/Hold
> | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
> |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
> ||/ Name           Version      Architecture Description
> +++-==============-============-============-===========================================
> ii  hfsprogs       332.25-11+b3 ppc64        mkfs and fsck for HFS and HFS+ file systems
> 
> root@powermac-g5:~# file /sbin/fsck.hfs
> /sbin/fsck.hfs: symbolic link to fsck.hfsplus
> 
> root@powermac-g5:~# file /sbin/fsck.hfsplus
> /sbin/fsck.hfsplus: ELF 64-bit MSB executable, 64-bit PowerPC or cisco 7500, version
> 1 (SYSV), dynamically linked, interpreter /lib64/ld64.so.1, for GNU/Linux 3.2.0,
> BuildID[sha1]=9e14a88ea04ea0fc8a89f3d79b039cf1daa6f3ed, stripped
> 
> root@powermac-g5:~# fsck.hfs -d -f /dev/sda2
> ** /dev/sda2
>     Using cacheBlockSize=32K cacheTotalBlock=1024 cacheSize=32768K.
> ** Checking HFS volume.
> Segmentation fault
> ```
> 
> But then testing with the powerpc version on the 11,2 G5 actually seems to work:
> 
> ```
> root@powermac-g5:~# dpkg -l hfsprogs
> Desired=Unknown/Install/Remove/Purge/Hold
> | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
> |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
> ||/ Name           Version      Architecture Description
> +++-==============-============-============-===========================================
> ii  hfsprogs       332.25-11+b2 powerpc      mkfs and fsck for HFS and HFS+ file systems
> 
> root@powermac-g5:~# file /sbin/fsck.hfs
> /sbin/fsck.hfs: symbolic link to fsck.hfsplus
> 
> root@powermac-g5:~# file /sbin/fsck.hfsplus
> /sbin/fsck.hfsplus: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1
> (SYSV), dynamically linked, interpreter /lib/ld.so.1, for GNU/Linux 3.2.0,
> BuildID[sha1]=ce95122bcb0b56e4c1dc1b256cdf24135f6e4cad, stripped
> 
> root@powermac-g5:~# fsck.hfs -d -f /dev/sda2
> ** /dev/sda2
>     Using cacheBlockSize=32K cacheTotalBlock=1024 cacheSize=32768K.
> ** Checking HFS volume.
> ** Checking Extents Overflow file.
> ** Checking Catalog file.
> ** Checking Catalog hierarchy.
> ** Checking volume bitmap.
> ** Checking volume information.
> ** The volume bootstrap appears to be OK.
> 
> root@powermac-g5:~# echo $?
> 0
> ```
> 
> So how do we proceed from here?

Can you post a backtrace from a package build with debug symbols? I suspect this will
be something quite obvious, i.e. using pointers to int/long rather than specific
32-bit types in the HFS code.


ATB,

Mark.


Reply to: