Mahlet-Inc / hobbits

A multi-platform GUI for bit-based analysis, processing, and visualization
https://mahlet-inc.github.io
MIT License
660 stars 45 forks source link

Fails to start on macOS 11 #128

Closed RazrFalcon closed 2 years ago

RazrFalcon commented 2 years ago
> /Applications/hobbits.app/Contents/MacOS/hobbits 
dyld: Library not loaded: /usr/local/opt/gettext/lib/libintl.8.dylib
  Referenced from: /Applications/hobbits.app/Contents/Frameworks/hobbits-cpython/lib/libpython3.9.dylib
  Reason: image not found
fish: Job 1, '/Applications/hobbits.app/Conte…' terminated by signal SIGABRT (Abort)

I would suggest using macdeployqt for mac builds. It packages Qt a bit more nicely.

Mac 11.5.2, hobbits-0.51.1

hello-adam commented 2 years ago

Sorry about this! My CMake and Qt packaging skills leave a lot to be desired.

I should probably reference something like this: https://github.com/miurahr/cmake-qt-packaging-example

I think I'll be able to get to this in the next week or so

hello-adam commented 2 years ago

I don't have anything running macOS 11, but maybe this new mac 11 build will work: https://dev.azure.com/mahlet-inc/hobbits/_build/results?buildId=674&view=artifacts&pathAsName=false&type=publishedArtifacts

The 10.14 build works fine for me, so it's possible that just building it on 11 will solve your problem (I'm not sure macdeployqt is smart enough to grab and package the dylibs for non-Qt libraries like python anyways)

RazrFalcon commented 2 years ago

Yes, this build works, thanks.

RazrFalcon commented 2 years ago

But I'm getting this when trying to open mac executable using Kaitai:

Screen Shot 2021-09-24 at 15 55 26

RazrFalcon commented 2 years ago

TrueType parsing doesn't fail with an error, but fails with to actually parse the data. Log:

Python stdout:
Parsing Ttf at ''
Parsing OffsetTable at 'offset_table'
Parsing Fixed at 'offset_table.sfnt_version'
Parsing DirTableEntry at 'directory_table[0]'
Parsing DirTableEntry at 'directory_table[1]'
Parsing DirTableEntry at 'directory_table[2]'
Parsing DirTableEntry at 'directory_table[3]'
Parsing Os2 at 'directory_table[3]._m_value'
New base offset for Os2: 344
Parsing Panose at 'directory_table[3]._m_value.panose'
Parsing UnicodeRange at 'directory_table[3]._m_value.unicode_range'
Parsing CodePageRange at 'directory_table[3]._m_value.code_page_range'
Parsing DirTableEntry at 'directory_table[4]'
Parsing Cmap at 'directory_table[4]._m_value'
New base offset for Cmap: 31848
Parsing SubtableHeader at 'directory_table[4]._m_value.tables[0]'
Parsing Subtable at 'directory_table[4]._m_value.tables[0]._m_table'
Parsing SegmentMappingToDeltaValues at 'directory_table[4]._m_value.tables[0]._m_table.value'
New base offset for SegmentMappingToDeltaValues: 63738
Parsing SubtableHeader at 'directory_table[4]._m_value.tables[1]'
Parsing Subtable at 'directory_table[4]._m_value.tables[1]._m_table'
Parsing TrimmedTableMapping at 'directory_table[4]._m_value.tables[1]._m_table.value'
New base offset for TrimmedTableMapping: 64226
Parsing SubtableHeader at 'directory_table[4]._m_value.tables[2]'
Parsing Subtable at 'directory_table[4]._m_value.tables[2]._m_table'
Parsing SegmentMappingToDeltaValues at 'directory_table[4]._m_value.tables[2]._m_table.value'
New base offset for SegmentMappingToDeltaValues: 64748
Parsing SubtableHeader at 'directory_table[4]._m_value.tables[3]'
Failed when getting property table: Traceback (most recent call last):
  File "/private/var/folders/v4/0yf346l94y1bv3wrx6df9n680000gn/T/HobbitsPythonCYcGpo/thescript.py", line 65, in parse_struct
    getattr(struct, attr)
  File "/private/var/folders/v4/0yf346l94y1bv3wrx6df9n680000gn/T/hobbits-XHrYhM/ttf.py", line 1616, in table
    self._m_table._read()
  File "/private/var/folders/v4/0yf346l94y1bv3wrx6df9n680000gn/T/hobbits-XHrYhM/ttf.py", line 1669, in _read
    self.value = self._io.read_bytes((self.length - 6))
  File "/private/var/folders/v4/0yf346l94y1bv3wrx6df9n680000gn/T/hobbits-XHrYhM/pydeps/kaitaistruct.py", line 284, in read_bytes
    raise ValueError(
ValueError: requested invalid -6 amount of bytes

Skipping _m_table, no start-end...
Parsing DirTableEntry at 'directory_table[5]'
Parsing Glyf at 'directory_table[5]._m_value'
New base offset for Glyf: 66612
Parsing SimpleGlyph at 'directory_table[5]._m_value.value'
Parsing Flag at 'directory_table[5]._m_value.value.flags[0]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[1]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[2]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[3]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[4]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[5]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[6]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[7]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[8]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[9]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[10]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[11]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[12]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[13]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[14]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[15]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[16]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[17]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[18]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[19]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[20]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[21]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[22]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[23]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[24]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[25]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[26]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[27]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[28]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[29]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[30]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[31]'
Parsing Flag at 'directory_table[5]._m_value.value.flags[32]'
Parsing DirTableEntry at 'directory_table[6]'
Parsing Head at 'directory_table[6]._m_value'
New base offset for Head: 220
Parsing Fixed at 'directory_table[6]._m_value.version'
Parsing Fixed at 'directory_table[6]._m_value.font_revision'
Parsing DirTableEntry at 'directory_table[7]'
Parsing Hhea at 'directory_table[7]._m_value'
New base offset for Hhea: 276
Parsing Fixed at 'directory_table[7]._m_value.version'
Parsing DirTableEntry at 'directory_table[8]'
Parsing DirTableEntry at 'directory_table[9]'
Parsing DirTableEntry at 'directory_table[10]'
Parsing Maxp at 'directory_table[10]._m_value'
New base offset for Maxp: 312
Parsing Fixed at 'directory_table[10]._m_value.table_version_number'
Parsing DirTableEntry at 'directory_table[11]'
Parsing Name at 'directory_table[11]._m_value'
New base offset for Name: 2084648
Parsing NameRecord at 'directory_table[11]._m_value.name_records[0]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[1]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[2]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[3]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[4]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[5]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[6]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[7]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[8]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[9]'
Failed when getting property unicode_value: Traceback (most recent call last):
  File "/private/var/folders/v4/0yf346l94y1bv3wrx6df9n680000gn/T/HobbitsPythonCYcGpo/thescript.py", line 65, in parse_struct
    getattr(struct, attr)
  File "/private/var/folders/v4/0yf346l94y1bv3wrx6df9n680000gn/T/hobbits-XHrYhM/ttf.py", line 270, in unicode_value
    self._m_unicode_value = (io.read_bytes(self.len_str)).decode(u"utf-16be")
  File "/Users/runner/.conan/data/hobbits-cpython/3.9.7/_/_/package/f83037eff23ab3a94190d7f3f7b37a2d6d522241/lib/python3.9/encodings/utf_16_be.py", line 16, in decode
UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x61 in position 6: truncated data

Skipping _m_unicode_value, not an attribute in struct
Parsing NameRecord at 'directory_table[11]._m_value.name_records[10]'
Failed when getting property unicode_value: Traceback (most recent call last):
  File "/private/var/folders/v4/0yf346l94y1bv3wrx6df9n680000gn/T/HobbitsPythonCYcGpo/thescript.py", line 65, in parse_struct
    getattr(struct, attr)
  File "/private/var/folders/v4/0yf346l94y1bv3wrx6df9n680000gn/T/hobbits-XHrYhM/ttf.py", line 270, in unicode_value
    self._m_unicode_value = (io.read_bytes(self.len_str)).decode(u"utf-16be")
  File "/Users/runner/.conan/data/hobbits-cpython/3.9.7/_/_/package/f83037eff23ab3a94190d7f3f7b37a2d6d522241/lib/python3.9/encodings/utf_16_be.py", line 16, in decode
UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x72 in position 6: truncated data

Skipping _m_unicode_value, not an attribute in struct
Parsing NameRecord at 'directory_table[11]._m_value.name_records[11]'
Failed when getting property unicode_value: Traceback (most recent call last):
  File "/private/var/folders/v4/0yf346l94y1bv3wrx6df9n680000gn/T/HobbitsPythonCYcGpo/thescript.py", line 65, in parse_struct
    getattr(struct, attr)
  File "/private/var/folders/v4/0yf346l94y1bv3wrx6df9n680000gn/T/hobbits-XHrYhM/ttf.py", line 270, in unicode_value
    self._m_unicode_value = (io.read_bytes(self.len_str)).decode(u"utf-16be")
  File "/Users/runner/.conan/data/hobbits-cpython/3.9.7/_/_/package/f83037eff23ab3a94190d7f3f7b37a2d6d522241/lib/python3.9/encodings/utf_16_be.py", line 16, in decode
UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x61 in position 6: truncated data

Skipping _m_unicode_value, not an attribute in struct
Parsing NameRecord at 'directory_table[11]._m_value.name_records[12]'
Failed when getting property unicode_value: Traceback (most recent call last):
  File "/private/var/folders/v4/0yf346l94y1bv3wrx6df9n680000gn/T/HobbitsPythonCYcGpo/thescript.py", line 65, in parse_struct
    getattr(struct, attr)
  File "/private/var/folders/v4/0yf346l94y1bv3wrx6df9n680000gn/T/hobbits-XHrYhM/ttf.py", line 270, in unicode_value
    self._m_unicode_value = (io.read_bytes(self.len_str)).decode(u"utf-16be")
  File "/Users/runner/.conan/data/hobbits-cpython/3.9.7/_/_/package/f83037eff23ab3a94190d7f3f7b37a2d6d522241/lib/python3.9/encodings/utf_16_be.py", line 16, in decode
UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x61 in position 6: truncated data

Skipping _m_unicode_value, not an attribute in struct
Parsing NameRecord at 'directory_table[11]._m_value.name_records[13]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[14]'
Failed when getting property unicode_value: Traceback (most recent call last):
  File "/private/var/folders/v4/0yf346l94y1bv3wrx6df9n680000gn/T/HobbitsPythonCYcGpo/thescript.py", line 65, in parse_struct
    getattr(struct, attr)
  File "/private/var/folders/v4/0yf346l94y1bv3wrx6df9n680000gn/T/hobbits-XHrYhM/ttf.py", line 270, in unicode_value
    self._m_unicode_value = (io.read_bytes(self.len_str)).decode(u"utf-16be")
  File "/Users/runner/.conan/data/hobbits-cpython/3.9.7/_/_/package/f83037eff23ab3a94190d7f3f7b37a2d6d522241/lib/python3.9/encodings/utf_16_be.py", line 16, in decode
UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x61 in position 6: truncated data

Skipping _m_unicode_value, not an attribute in struct
Parsing NameRecord at 'directory_table[11]._m_value.name_records[15]'
Failed when getting property unicode_value: Traceback (most recent call last):
  File "/private/var/folders/v4/0yf346l94y1bv3wrx6df9n680000gn/T/HobbitsPythonCYcGpo/thescript.py", line 65, in parse_struct
    getattr(struct, attr)
  File "/private/var/folders/v4/0yf346l94y1bv3wrx6df9n680000gn/T/hobbits-XHrYhM/ttf.py", line 270, in unicode_value
    self._m_unicode_value = (io.read_bytes(self.len_str)).decode(u"utf-16be")
  File "/Users/runner/.conan/data/hobbits-cpython/3.9.7/_/_/package/f83037eff23ab3a94190d7f3f7b37a2d6d522241/lib/python3.9/encodings/utf_16_be.py", line 16, in decode
UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x2e in position 28: truncated data

Skipping _m_unicode_value, not an attribute in struct
Parsing NameRecord at 'directory_table[11]._m_value.name_records[16]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[17]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[18]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[19]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[20]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[21]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[22]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[23]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[24]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[25]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[26]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[27]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[28]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[29]'
Parsing NameRecord at 'directory_table[11]._m_value.name_records[30]'
Parsing DirTableEntry at 'directory_table[12]'
Failed when getting property value: Traceback (most recent call last):
  File "/private/var/folders/v4/0yf346l94y1bv3wrx6df9n680000gn/T/HobbitsPythonCYcGpo/thescript.py", line 65, in parse_struct
    getattr(struct, attr)
  File "/private/var/folders/v4/0yf346l94y1bv3wrx6df9n680000gn/T/hobbits-XHrYhM/ttf.py", line 623, in value
    self._m_value._read()
  File "/private/var/folders/v4/0yf346l94y1bv3wrx6df9n680000gn/T/hobbits-XHrYhM/ttf.py", line 86, in _read
    self.format20._read()
  File "/private/var/folders/v4/0yf346l94y1bv3wrx6df9n680000gn/T/hobbits-XHrYhM/ttf.py", line 120, in _read
    _t_glyph_names._read()
  File "/private/var/folders/v4/0yf346l94y1bv3wrx6df9n680000gn/T/hobbits-XHrYhM/ttf.py", line 139, in _read
    self.length = self._io.read_u1()
  File "/private/var/folders/v4/0yf346l94y1bv3wrx6df9n680000gn/T/hobbits-XHrYhM/pydeps/kaitaistruct.py", line 159, in read_u1
    return KaitaiStream.packer_u1.unpack(self.read_bytes(1))[0]
  File "/private/var/folders/v4/0yf346l94y1bv3wrx6df9n680000gn/T/hobbits-XHrYhM/pydeps/kaitaistruct.py", line 290, in read_bytes
    raise EOFError(
EOFError: requested 1 bytes, but got only 0 bytes

Skipping _m_value, no start-end...

Not sure if this is mac related.

hello-adam commented 2 years ago

this looks like a bug in my parser result parser. if you could share the file that does that I might be able to reproduce and fix it

RazrFalcon commented 2 years ago

You can reproduce it on hobbits mac binary itself.

hello-adam commented 2 years ago

It looks like my parser didn't account for the specs with underscores. I fixed it in 33613e926c8c452fb1d52cce22da97a06fb33d9b (which, along with the new Mac 11 build, will be part of the 0.52.0 release).

The TTF error is expected if you aren't using it on a file that the TTF spec can parse (it worked fine when I tried it on a TTF file I had).

I'm going to consider this issue closed since it looks like the pending 0.52.0 release will run fine on Mac 11. If you run into any other kaitai issues, feel free to report them in new issues.

RazrFalcon commented 2 years ago

Thanks!