tristanhimmelman/AlamofireObjectMapper

dyld`dyld_fatal_error

Closed this issue ยท 14 comments

Hi,

My configuration:

  • Xcode 7.3.1
  • Carthage 0.16.2

On my Cartfile:

github "tristanhimmelman/AlamofireObjectMapper" == 3.0.0

On each time I run the application on the device (not the simulator) it's crash like this:

dyld`dyld_fatal_error:
->  0x120075088 <+0>: brk    #0x3

After some investigation I changed my Cartfile like this:

github "Alamofire/Alamofire" == 3.4.0
github "Hearst-DD/ObjectMapper" == 1.2.0
github "tristanhimmelman/AlamofireObjectMapper" == 3.0.0

With ObjectMapper 1.2.0 no crash
AlamofireObjectMapper is not compatible with ObjectMapper 1.3.0?!?!?

Thank you.Changed Cartfile Is work for me

I'll try to figure out what is happening here. Oddly, ObjectMapper 1.3 works fine with the extension when integrating via Cocoapods.

dyld: lazy symbol binding failed: Symbol not found: __TFC12ObjectMapper6MapperCfT_GS0_x_
  Referenced from: /Users/tristan/Library/Developer/CoreSimulator/Devices/DF252227-5FBF-4857-9F29-1C5F78D96F19/data/Containers/Bundle/Application/CED93CC2-8BB0-4619-89EC-99C19C9C33AA/CarthageTester.app/Frameworks/AlamofireObjectMapper.framework/AlamofireObjectMapper
  Expected in: /Users/tristan/Library/Developer/CoreSimulator/Devices/DF252227-5FBF-4857-9F29-1C5F78D96F19/data/Containers/Bundle/Application/CED93CC2-8BB0-4619-89EC-99C19C9C33AA/CarthageTester.app/Frameworks/ObjectMapper.framework/ObjectMapper

dyld: Symbol not found: __TFC12ObjectMapper6MapperCfT_GS0_x_
  Referenced from: /Users/tristan/Library/Developer/CoreSimulator/Devices/DF252227-5FBF-4857-9F29-1C5F78D96F19/data/Containers/Bundle/Application/CED93CC2-8BB0-4619-89EC-99C19C9C33AA/CarthageTester.app/Frameworks/AlamofireObjectMapper.framework/AlamofireObjectMapper
  Expected in: /Users/tristan/Library/Developer/CoreSimulator/Devices/DF252227-5FBF-4857-9F29-1C5F78D96F19/data/Containers/Bundle/Application/CED93CC2-8BB0-4619-89EC-99C19C9C33AA/CarthageTester.app/Frameworks/ObjectMapper.framework/ObjectMapper

@ikesyo do you have any idea why this might be happening? (I know you've done lots of work with Carthage)

Thanks in advance!

I'm having the same problem, crashing at runtime if built using Carthage

dyld: lazy symbol binding failed: Symbol not found: __TFC12ObjectMapper6MapperCfT_GS0_x_
  Referenced from: /Users/luonghuyduc/Library/Developer/CoreSimulator/Devices/677F6DF4-1EE8-432E-966B-42CF0EC6EEB3/data/Containers/Bundle/Application/EE174AE3-8AFD-43BA-9294-34CDCFAF1A4E/Sample.app/Frameworks/AlamofireObjectMapper.framework/AlamofireObjectMapper
  Expected in: /Users/luonghuyduc/Library/Developer/CoreSimulator/Devices/677F6DF4-1EE8-432E-966B-42CF0EC6EEB3/data/Containers/Bundle/Application/EE174AE3-8AFD-43BA-9294-34CDCFAF1A4E/Sample.app/Frameworks/ObjectMapper.framework/ObjectMapper

dyld: Symbol not found: __TFC12ObjectMapper6MapperCfT_GS0_x_
  Referenced from: /Users/luonghuyduc/Library/Developer/CoreSimulator/Devices/677F6DF4-1EE8-432E-966B-42CF0EC6EEB3/data/Containers/Bundle/Application/EE174AE3-8AFD-43BA-9294-34CDCFAF1A4E/Sample.app/Frameworks/AlamofireObjectMapper.framework/AlamofireObjectMapper
  Expected in: /Users/luonghuyduc/Library/Developer/CoreSimulator/Devices/677F6DF4-1EE8-432E-966B-42CF0EC6EEB3/data/Containers/Bundle/Application/EE174AE3-8AFD-43BA-9294-34CDCFAF1A4E/Sample.app/Frameworks/ObjectMapper.framework/ObjectMapper

Using ObjectMapper 1.2.0 indeed fixes the issue

TL;DR: ObjectMapper 1.3.0 isn't binary compatible with 1.2.0.

The demangled name of __TFC12ObjectMapper6MapperCfT_GS0_x_ is ObjectMapper.Mapper.__allocating_init () -> ObjectMapper.Mapper<A>.

AlamofireObjectMapper 3.0.0 is built with ObjectMapper 1.2.0 (here) and that certainly has Mapper.init() (here).

But Mapper of ObjectMapper 1.3.0 only has init(context: MapContext?) (here) and does not have init(). Yes, the former can be used as init() at source level since the arg is a default argument, but the signature isn't same with the latter.

This is the reason why dyld could not find the symbol. So I think you should update the Cartfile entry in the repo as follows:

github "Hearst-DD/ObjectMapper" ~> 1.3.0

or adding overloaded Mapper.init() to ObjectMapper should fix it.

public final class Mapper<N: Mappable> {
    public var context: MapContext?

    public convenience init(){
        self.init(context: nil)
    }

    public init(context: MapContext?){
        self.context = context
    }
}

@ikesyo Wow swift-demangle is a neat trick for debugging. Thanks a lot !

@ikesyo THANK YOU! ๐Ÿ‘ ๐Ÿ‘ I don't think I would have caught that.

I've pushed a new version of AlamofireObjectMapper (v3.0.1) that points to ObjectMapper 1.3.0. Everything seems to be working now.

For some reason I'm running in the same issue with AlamofireObjectMapper 4.0.1 and ObjectMapper 2.2.2.

dyld: lazy symbol binding failed: Symbol not found: __TFC12ObjectMapper6MapperCfT7contextGSqPS_10MapContext___GS0_x_
  Referenced from: /Users/glaurent/Library/Developer/CoreSimulator/Devices/C11DAE7D-34F6-42D5-8B72-6519CD76B987/data/Containers/Bundle/Application/145A91FE-45C6-44E0-9F22-BEC1FA8749A6/FenotekBackendTest.app/Frameworks/AlamofireObjectMapper.framework/AlamofireObjectMapper
  Expected in: /Users/glaurent/Library/Developer/CoreSimulator/Devices/C11DAE7D-34F6-42D5-8B72-6519CD76B987/data/Containers/Bundle/Application/145A91FE-45C6-44E0-9F22-BEC1FA8749A6/FenotekBackendTest.app/Frameworks/ObjectMapper.framework/ObjectMapper

xcrun swift-demangle "__TFC12ObjectMapper6MapperCfT7contextGSqPS_10MapContext___GS0_x_" _TFC12ObjectMapper6MapperCfT7contextGSqPS_10MapContext___GS0_x_ ---> ObjectMapper.Mapper.__allocating_init (context : ObjectMapper.MapContext?) -> ObjectMapper.Mapper<A>

I have the same error

My Cartfile:

github "Alamofire/Alamofire" == 4.2.0
github "Hearst-DD/ObjectMapper" == 2.2.2
github "tristanhimmelman/AlamofireObjectMapper" == 4.0.1

Crash with:

dyld`dyld_fatal_error:
->  0x1feb908c <+0>: trap   
    0x1feb9090 <+4>: nop    

in file AlamofireObjectMapper.swift line 74 function ObjectMapperSerializer:
image

@TofPlay see issue #170 : you need to use ObjectMapper 2.2.1.

@glaurent It's works! Thanks ๐Ÿ˜€

Having this issue again, can we have another release to fix the version incompatibility? Thanks! ๐Ÿ‘

Thnx @glaurent fix issue with this cartfile

github "Hearst-DD/ObjectMapper" == 2.2.1
github "tristanhimmelman/AlamofireObjectMapper" ~> 4.0.1
github "Alamofire/Alamofire" ~> 4.2.0

@litoarias you're welcome, but please, next time, look up a bit before posting, and copy/paste text, rather than screenshots. Thanks :)