iOS: EXC_BAD_ACCESS ExitGames::Photon::Internal::PeerBase::getConnectionProtocol:

My native iOS app (Swift) is crashing when I try to create an instance of EGLoadBalancingClient

by calling the following: EGLoadBalancingClient(client: photonListener, "<my app id>", "1.0", EGConnectionProtocol_TCP)


Here is my Xcode trace:

#0 0x000000010747cb84 in ExitGames::Photon::Internal::PeerBase::getConnectionProtocol() const at /Users/Shared/RelocatedItems/Security/Development/egp/trunkCopy13/Photon-cpp/src/Internal/PeerBase.cpp:895

#1 0x0000000107447bac in ExitGames::Photon::PhotonPeer::createPeerBase() at /Users/Shared/RelocatedItems/Security/Development/egp/trunkCopy13/Photon-cpp/src/PhotonPeer.cpp:100

#2 0x0000000107447954 in ExitGames::Photon::PhotonPeer::init(ExitGames::Photon::PhotonListener&, unsigned char) at /Users/Shared/RelocatedItems/Security/Development/egp/trunkCopy13/Photon-cpp/src/PhotonPeer.cpp:47

#3 0x0000000107447a7c in ExitGames::Photon::PhotonPeer::PhotonPeer(ExitGames::Photon::PhotonListener&, bool, unsigned char) at /Users/Shared/RelocatedItems/Security/Development/egp/trunkCopy13/Photon-cpp/src/PhotonPeer.cpp:40

#4 0x0000000107447b4c in ExitGames::Photon::PhotonPeer::PhotonPeer(ExitGames::Photon::PhotonListener&, bool, unsigned char) at /Users/Shared/RelocatedItems/Security/Development/egp/trunkCopy13/Photon-cpp/src/PhotonPeer.cpp:39

#5 0x0000000107443600 in EGObjCPhotonPeer::createPeer(ExitGames::Photon::PhotonListener*, unsigned char, bool) at /Users/Shared/RelocatedItems/Security/Development/egp/trunkCopy13/Photon-objc/src/EGPhotonPeer.mm:82

#6 0x0000000107443574 in -[EGPhotonPeer initWithPhotonListener:::] at /Users/Shared/RelocatedItems/Security/Development/egp/trunkCopy13/Photon-objc/src/EGPhotonPeer.mm:330

#7 0x00000001074434ac in -[EGPhotonPeer initWithPhotonListener::] at /Users/Shared/RelocatedItems/Security/Development/egp/trunkCopy13/Photon-objc/src/EGPhotonPeer.mm:322

#8 0x00000001074856c8 in -[EGLoadBalancingClient initClient::::::] at /Users/Shared/RelocatedItems/Security/Development/egp/trunkCopy13/LoadBalancing-objc/src/EGLoadBalancingClient.mm:377

#9 0x000000010748562c in -[EGLoadBalancingClient initClient:::::] at /Users/Shared/RelocatedItems/Security/Development/egp/trunkCopy13/LoadBalancing-objc/src/EGLoadBalancingClient.mm:371

#10 0x00000001074855c0 in -[EGLoadBalancingClient initClient::::] at /Users/Shared/RelocatedItems/Security/Development/egp/trunkCopy13/LoadBalancing-objc/src/EGLoadBalancingClient.mm:366

#11 0x00000001071ae748 in @nonobjc EGLoadBalancingClient.init(client:_:_:_:) ()

#12 0x00000001071adf68 in EGLoadBalancingClient.__allocating_init(client:_:_:_:) ()

#13 0x00000001071ad808 in MultiplayerHostingController.startHostingSession(with:) at /Users/nick/Projects/....../MultiplayerHostingController+Networking.swift:39

Best Answer

  • Kaiserludi
    Kaiserludi admin
    Answer ✓

    Hi @Nick_Russell.


    Thank you for reporting this.

    I can confirm that this is a bug in the 5.0.0.0 - 5.0.0.2 SDKs. It will be fixed in 5.0.0.3.

    4.x versions are not affected.

Answers

  • I am also getting the same crash when running the demo_iPhone_loadBalancing_swift demo.

    • iPhone X
    • iOS 14.7.1
    • Xcode 12.5.1
    • Photon 5.0.0.2
  • After downgrading to Photon 4.1.16.5 I am no longer getting the crash?

  • Kaiserludi
    Kaiserludi admin
    Answer ✓

    Hi @Nick_Russell.


    Thank you for reporting this.

    I can confirm that this is a bug in the 5.0.0.0 - 5.0.0.2 SDKs. It will be fixed in 5.0.0.3.

    4.x versions are not affected.