x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

iOS Device Disconnect Sometimes Blocks Editor Forever

Here's a fun little issue.

Sometimes when I load maps (that usually take ~2 mins) progress will be made for maybe a minute and then it just hangs.

Breaking in LLDB and checking what the main thread is doing I can see that it's handling a DoDeviceDisconnect for my iPhone and forever blocking in MessageEndpoint::SafeRelease due to the fact that there's a shared reference of that pointer somewhere. Here's the backtrace from LinkerLoad -> Slate Tick -> Message Pump -> Disconnect Event and subsequent blocking.

The iOS device being disconnected is my iPhone, which isn't even physically connected to my laptop, but they're on the same WiFi so I guess that's how they find each other, and I'm guessing there's some choppiness in the WiFi causing the disconnect. It has only happened during map load, and it doesn't happen every time. Activating Flight Mode on my phone prevents it from happening altogether.

I guess the main question is: who has the outstanding reference to the message endpoint, and why won't they give it back.

Have fun, Tobias.

Product Version: UE 4.8
Tags:
more ▼

asked Jul 19 '15 at 05:10 PM in Bug Reports

avatar image

tobiasmollstam
36 2 6

avatar image Samantha Sutton ♦♦ STAFF Jul 27 '15 at 03:46 PM

Hey Tobias,

Thank you for bringing this to our attention. In order to better assist you, I have a few questions. Are you working within 4.8.2 through the Epic Games Launcher? Also, when you say that your iOS device blocks the editor, are you trying to launch or package a project onto that device at that given time? If not, what exactly are you doing? Do you have your iOS device and the laptop synced up with bluetooth?

Looking forward to hearing back from you, thanks!

avatar image tobiasmollstam Aug 01 '15 at 10:49 AM

Hi Sam, sorry for not replying earlier, went into vacation mode.

I'm running the editor in debug from the command-line through lldb, compiled from GH master with Build.sh. The project I'm working on isn't setup with my phone, nor have I ever packaged it for it or anything. I'm not actively interacting with the phone. I guess that OS X and my phone is keeping an open link (due to "Sync over Wi-Fi" option on the device in iTunes), which sometimes will trigger a disconnect/connect on the OS level, dispatching an event to the device managing code in UE.

I could check when at home if I can trigger the bug more predictably.

I realize the description is a bit abstract, and the case probably pretty narrow.

avatar image Samantha Sutton ♦♦ STAFF Aug 03 '15 at 04:11 PM

I would suggest turning your bluetooth and any options to sync over wifi/bluetooth to be disabled when you're working within UE4 as well. Make sure that you trust your computer on your device too, otherwise the project will not be able to push onto the device as intended.

Thanks!

avatar image tobiasmollstam Aug 06 '15 at 04:50 AM

Just to make sure we're on the same page: I don't want to push to my phone, I'm working on a desktop game. But having your Mac and your iDevice on the same choppy wifi will sometimes block the editor forever, due to the OS layer sending a disconnect event to UE4 which ends up in FMessageEndpoint::SafeRelease(...) which has a note:

MessageEndpoint.h:755
Note: When calling this function make sure that no other object is holding on to the endpoint, or otherwise the caller may get blocked forever.

If the recommended solution for this is to disable WiFi on your iDevice while working on any project in UE4 on your computer I'm fine with that, but it sounds kind of wonky.

avatar image Samantha Sutton ♦♦ STAFF Aug 11 '15 at 05:01 PM

Hey Tobias,

I wanted to let you know that I have reached out to our iOS developers and I am waiting on some information. We will update you as soon as possible, thank you for your patience!

avatar image tobiasmollstam Aug 12 '15 at 05:34 AM

Cheers, no worries! It's not a blocker for me. :)

avatar image Ravlek STAFF Aug 13 '15 at 07:06 PM

Right now there is bug with devices that have Sync over Wifi enabled. We only recently figured out it was that option causing the issue, so it won't be fixed in 4.9 (plus we never see it internally because our PCs are on a different subnet from the devices). However, in the mean time if you disable Sync over Wifi, it should resolve the issue until we can get a fix in.

-Pete

avatar image haowang1013 Aug 07 '18 at 03:02 AM

FYI, this is still happening to me in 4.20.1, on MacOS 10.14 beta. I didn't have any device connected while it happened.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Hey Tobias,

I have not heard from you in quite a few days and for that reason, I must mark this thread as resolved. However, if you have any further questions regarding this topic, do not hesitate in replying back. Thanks!

more ▼

answered Jul 30 '15 at 08:42 PM

avatar image MacAndor Dec 23 '15 at 01:28 PM

Hi, just had the same issue with 4.11p1, attached a stacktrace

avatar image MacAndor Dec 23 '15 at 01:29 PM

alt text

avatar image Samantha Sutton ♦♦ STAFF Dec 23 '15 at 09:06 PM

Hey MacAndor,

Could you please provide us with the full logs as a .txt file? Please attach it to your next reply.

avatar image MacAndor Jan 04 '16 at 06:22 PM

Hi,

Sorry for the late response, but here are some dumps, logs, etc: Sample in deadlock state Unreal Engine project log Unreal Engine log

I checked the iOS device logs, nothing there, but then again I created a desktop project, which should have nothing to do with my mobile devices.

Reproducing this bug is quite easy for me: - I have an Apple Airport router

1, Have an iOS device on the same network as your computer and make sure it is connected via the MobileDevice framework 2, Create a new project in UE 4 (I created advanced vehicle) 3, After project inited, turn off wifi and BT on your device (this may take a few tries)

If you need any more info, I'll try to provide as much as I can.

Best Regards, MacAndor

myproject.log (12.3 kB)
ue4.log (31.9 kB)
avatar image Samantha Sutton ♦♦ STAFF Jan 06 '16 at 08:18 PM

MacAndor,

Thank you for providing us with this information. I have looked through Jira and found UE-11999. Unfortunately, it is not resolved yet. It's set as a 'normal' priority bug that has been backlogged. We currently do not have a fixed version in place.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

So I've come up with a fix which ignores devices that are not physical attached to the Mac (it seems for some reason, as long as the Mac and iOS devices are in the same network, it's considered "connected"):

 void FIOSDeviceHelper::DoDeviceConnect(void* deviceHandle)
 {
     // connect to the device
     IOSDevice* Device = new IOSDevice(deviceHandle);
     bool Connected = Device->Connect();
     if (Connected)
     {
         // get the needed data
         CFStringRef deviceName = AMDeviceCopyValue(deviceHandle, 0, CFSTR("DeviceName"));
         CFStringRef deviceId = AMDeviceCopyValue(deviceHandle, 0, CFSTR("UniqueDeviceID"));
         CFStringRef productType = AMDeviceCopyValue(deviceHandle, 0, CFSTR("ProductType"));
         
         auto hostAttached = (CFBooleanRef)AMDeviceCopyValue(deviceHandle, 0, CFSTR("HostAttached"));
         if (hostAttached)
         {
             auto attached = CFBooleanGetValue(hostAttached);
             CFRelease(hostAttached);
             if (!attached)
             {
                 return;
             }
         }
         ...
     }
 }
more ▼

answered Aug 10 '18 at 09:06 AM

avatar image

haowang1013
31 6 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question