three.js: Textures not loading/returning on latest Chrome [Version 50.0.2661.75]

Description of the problem

Hello all, I’ve run into an issue where I have a series of promises concurrently calling TextureLoader.load, and occasionally the call simply doesn’t appear to be triggering its success/failure callback, which leaves promises unresolved indefinitely.

I put together the most basic JSFiddle I could here: http://jsfiddle.net/b7bbbLxz/14/

You’ll need to pop open web inspector’s console to see the logs, but in general you’ll see 10 promises resolve with success, and the Promise.all subsequently resolve with success. This would be the expected, good behaviour.

However, sometimes one promise will hang without ever returning, and the whole call then hangs. You’ll need to Run the fiddle manually to ensure the resources go through a full load. With 1-2 seconds between runs, the issue occurs every ~10-15 attempts. Running more quickly (i.e. right after the previous success message is shown), the issue occurs every ~3-4 attempts.

This all seems related to the latest release of Chrome as the code was working in previous versions, and other browsers do not seem to present the issue. In Firefox, I can hammer on the Run button non-stop and always get a successful resolve back.

The issue appears to be producible more reliably when throttling the network connection to 2G, but that is not required.

This may be related to https://github.com/mrdoob/three.js/issues/8666, but it’s hard to tell. Not related.

I’ve attached an image of the console output that displays the issue. The arrow points at a subsequent Run after the previous Promise.all was hanging without getting to PROMISES SUCCESS.

screen shot 2016-04-18 at 6 41 26 pm 1 ##### Three.js version - [x] Dev - [x] r75 - [ ] ... ##### Browser - [ ] All of them - [x] Chrome - [ ] Firefox - [ ] Internet Explorer ##### OS - [x] All of them - [ ] Windows - [ ] Linux - [ ] Android - [ ] IOS ##### Hardware Requirements (graphics card, VR Device, ...)

None

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 5
  • Comments: 19 (6 by maintainers)

Commits related to this issue

Most upvoted comments

I just debugged what I think is this same issue and also reached the conclusion that garbage collection is removing the object. So far the following simple change to ImageLoader.load() seems to correct the problem we were seeing:

    scope.manager.itemStart( url );

    image.src = url;
    this.image = image; // retain a reference to the object to prevent garbage collection

    return image;

For reference, have opened a Chromium bug here: https://bugs.chromium.org/p/chromium/issues/detail?id=604844

FYI, just updated to Chrome 50.0.2661.94 (stable release channel) and am not seeing the issue in my environment anymore.

I think an update for Chrome 50 is imminent…