Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CEF browser crashes when zooming in with leaflet.js #3327

Open
1 task done
bum8hj opened this issue Mar 1, 2024 · 4 comments
Open
1 task done

CEF browser crashes when zooming in with leaflet.js #3327

bum8hj opened this issue Mar 1, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@bum8hj
Copy link
Contributor

bum8hj commented Mar 1, 2024

Describe the bug

I'm having an issue where my CEF browser crashes due to a sort of unknown reason. I'm using leaflet.js to display a map, and when I zoom in on the map, the browser crashes.

Test Resource
leaflet.zip

Steps to reproduce

  1. Start the resource
  2. optional Press K to open BrowserDevTools
  3. Click the Zoom In button +

If (for whatever reason) it triggered the crash, you should notice that the browser is frozen on the last rendered frame.
If you have DevTools open, you should see 'Render process gone'.

Version

v1.6-release-22388
Windows 11 (10.0.22631)

Additional context

Things I found to be irrelevant (i.e. the crash happens regardless of it)

  • Windowed Mode
  • Screen Resolution
  • Image width/height / File size

I tried all sorts of debugging methods I can and there's no doubt it's caused by a function or some calculations within leaflet.js, but specifically within MTA's CEF. Particularly calling map.fitBounds() or map.zoomIn().

  • The crash never happens on my Chrome browser, but only in MTA.
  • The crash happens "randomly" and I haven't found a pattern as to what causes it.
  • I had 3 other testers try it. One never crashed, but another did crash sometimes. (same MTA version)
  • MTA/CEF/cefdebug.txt shows nothing at the time of the crash as far as I know.

I made a test resource which has the code necessary to enable you to trigger the crash. However, since I don't know the requirements/pattern for the crash, you may have to try the reproduction steps multiple times, restart the resource, reconnect, etc.

Relevant log output

No response

Security Policy

  • I have read and understood the Security Policy and this issue is not security related.
@bum8hj bum8hj added the bug Something isn't working label Mar 1, 2024
@znvjder
Copy link
Contributor

znvjder commented Mar 1, 2024

I can't reproduce crash on Win 10.0.19045.2364. Latest MTA Client.

@ffsPLASMA
Copy link

ffsPLASMA commented Mar 1, 2024

Henlo, Ive been one of the testers and I havent had a single crash for past few days.
Today I wanted to investigate more and on first loadup it just crashed. Second loading crashed as well.
On third time, everything was fine, even after restarting the test resource multiple times.
After the tenth try, it crashed again, so its not really consistent.
Note that the crash offset stays same accross multiple runs.

This error popped up for me:
Screenshot 2024-03-01 113125

Multi Theft Auto v1.6-release-22388
Nvidia RTX 3080

Looking at dxGetStatus, theres nothing suspicious going on.

Edit:
After looking in taskmanager, the process rams up to ~23MB before crashing, not sure if this is problematic, it doesnt look like much used memory though.

Screenshot 2024-03-01 114437_2

@Lpsd
Copy link
Member

Lpsd commented Mar 1, 2024

Adding console.log(any3d, webkit3d); to leaflet.js on line 2138 (after var Browser definition) returns true, true which suggests it's trying to use hardware accelerated 3D transforms. Hardware acceleration is not enabled in MTA CEF.

Can you try to add <script>L_DISABLE_3D = true;</script> before including leaflet.js in the index.html? i.e

<script>L_DISABLE_3D = true;</script>
<script src="leaflet.js"></script>

Edit: nevermind, I'm still able to replicate it after some tries. I've probably replicated the issue 3 times out of 50 attempts. Never received the crash dialog though, only the browser 'freezing'.

OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.19045 N/A Build 19045
Multi Theft Auto v1.6-release-22388
Nvidia RTX 3080

@ffsPLASMA
Copy link

Good news I guess, we traced down to what causes the freeze/crash.

Reference: Leaflet/Leaflet#4821

The painting "thread" causes the CEF process to freeze/crash due to overload/timeout.

As an example: 6000x6000 JPG image:
Screenshot 2024-03-04 230725

Now a 3000x3000 JPG image:
Screenshot 2024-03-04 231532

This would explain the incosistency across multiple runs, depending on how long the painting takes, the CEF process may freeze/crash.

Question remains if we can fix/optimize that in a certain way? For now the solution is to take a smaller image texture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants