Ticket #53 (closed defect: fixed)

Opened 7 months ago

Last modified 3 weeks ago

Compatibility Issues with SimplifyMedia - Lack of two-level namespaces is suspected

Reported by: dmitryd Owned by: saurik
Priority: major Component: General
Keywords: Cc: joeywdy@…

Description

It appears that some of the Telesphonero distributed libraries have a different binding style than corresponding default libraries from Apple. One specific example of that is that Apple's distributed sqlite library uses two-level namespace (symbols are referenced by both symbol name and library name) while Cydia's one does not.

Here is output of otool for Apple's version:

$ otool -hv libsqlite3.dylib libsqlite3.dylib: Mach header

magic cputype cpusubtype caps filetype ncmds sizeofcmds flags

MH_MAGIC 12 6 0x00 DYLIB 11 1300 NOUNDEFS DYLDLINK PREBOUND SPLIT_SEGS TWOLEVEL

And here's telesphonero's:

$ otool -hv libsqlite3.dylib libsqlite3.dylib: Mach header

magic cputype cpusubtype caps filetype ncmds sizeofcmds flags

MH_MAGIC 12 0 0x00 DYLIB 8 1176 NOUNDEFS DYLDLINK

Note the differences is flags.

This fact came to light when investigating compatibility issue between Cydia and Simplify Media application on iPhone. In presence of Cydia (or more specifically latest version of Tetesphonero), Simplify Media executable crashes when a user attempts to enter account name or password. Simplify Media does link (statically) its own version of sqlite. That works fine with default set of libraries but not with Telephonero's. In fact, if Telephonero's sqlite library is replaced with the default one, the crash no longer occurs. (I'm Simplify Media developer investigating the issue and can be contacted at dmitryATsimplifymedia.com).

Telephonero's version of the system libraries should be as close as possible to the originals to avoid this type of compatibility issues. Looking through other Telephonero's libraries, sqlite is not the only one with this binding style.

Change History

Changed 7 months ago by saurik

  • status changed from new to closed
  • resolution set to fixed

Thanks for finding this! The configure script for sqlite3 was mis-detecting the version of Darwin it was compiling for and was not activating its two-level namespace support. I am very sorry this caused you problems ;(. I have fixed this in the latest version.

If you are using APT to support your Cydia users you could just depend on this version of the library to make certain people have it, but I think you are still using Installer. (Yes, I'm getting bitter about this. APT is just such a better solution for every single deployment issue I've seen people run into than Installer it just isn't funny.)

As for the other libraries, this is typically something that the library itself handles, and while I might break it with my cross compile setup, it isn't something I feel like I should be changing (as other people might be replying on flat namespaces for those libraries). I have verified that all the other libraries I install as OS upgrades are in fact two-level namespaced (although if I'm wrong, please poke me).

Changed 4 months ago by joeywdy

  • cc joeywdy@… added
  • status changed from closed to reopened
  • resolution deleted

Changed 3 weeks ago by saurik

  • status changed from reopened to closed
  • resolution set to fixed

This bug should not be reopened because it has been fixed. I have re-verified this against the currently shipping Telesphoreo sqlite3 package:

libsqlite3.dylib: Mach header

magic cputype cpusubtype caps filetype ncmds sizeofcmds flags

MH_MAGIC ARM ALL 0x00 DYLIB 12 1384 NOUNDEFS DYLDLINK TWOLEVEL SUBSECTIONS_VIA_SYMBOLS

Note: See TracTickets for help on using tickets.