1 nothing-special github web page blows browser to almost 4GB

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
me_ee

1 nothing-special github web page blows browser to almost 4GB

Unread post by me_ee » 2020-05-31, 09:36

Hi,
I went to <https://github.com/bigH/git-fuzzy>. Browser mem size just exploded. Never seen anything like it.

This happens whether javascript is disabled or enabled in the browser.

Win 2k8R2, palemoon 28.6.1 (needs updating I know). Any more info needed, just ask.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: 1 nothing-special github web page blows browser to almost 4GB

Unread post by Moonchild » 2020-05-31, 09:48

"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

New Tobin Paradigm

Re: 1 nothing-special github web page blows browser to almost 4GB

Unread post by New Tobin Paradigm » 2020-05-31, 10:21

I can confirm this it is because of multiple 2800x1412 size ~4.5 megabyte animated gifs. (yes I checked it is actually a gif not just pretending)

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4983
Joined: 2015-12-09, 15:45

Re: 1 nothing-special github web page blows browser to almost 4GB

Unread post by moonbat » 2020-05-31, 10:45

New Tobin Paradigm wrote:
2020-05-31, 10:21
I can confirm this it is because of multiple 2800x1412 size ~4.5 megabyte animated gifs. (yes I checked it is actually a gif not just pretending)
Holy shit :shock:
What's the site supposed to be about? 'How to recreate MySpace using framework du jour' ?
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

me_ee

Re: 1 nothing-special github web page blows browser to almost 4GB

Unread post by me_ee » 2020-05-31, 10:57

Further info.
Was run in a virtual machine (VM), but originally done outside a VM with Jscript disabled. Original browser had TrackMeNot and Noscript enabled. Also cookies disabled.

Browser in VM had neither - it was plain, and restarted from scratch. Nothing special done to it at all.

Info on browser running clean in a VM below (sorry about previous idiocy):
Application Basics
------------------

Name: Pale Moon
Version: 28.6.1 (64-bit)
Build ID: 20190723150040
Update Channel: release
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.9) Gecko/20100101 Goanna/4.3 Firefox/60.9 PaleMoon/28.6.1
OS: Windows_NT 6.1
Multiprocess Windows: 0/1 (Disabled)
Safe Mode: false

Extensions
----------

Graphics
--------

Features
Compositing: Basic
Asynchronous Pan/Zoom: none
WebGL 1 Driver WSI Info: EGL_VENDOR: Google Inc. (adapter LUID: 0000000000000000) EGL_VERSION: 1.4 (ANGLE 2.1.0.) EGL_EXTENSIONS: EGL_EXT_create_context_robustness EGL_ANGLE_query_surface_pointer EGL_ANGLE_window_fixed_size EGL_ANGLE_keyed_mutex EGL_ANGLE_surface_orientation EGL_KHR_create_context EGL_EXT_device_query EGL_KHR_image EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_get_all_proc_addresses EGL_KHR_stream EGL_KHR_stream_consumer_gltexture EGL_NV_stream_consumer_gltexture_yuv EGL_ANGLE_flexible_surface_compatibility EGL_EXTENSIONS(nullptr): EGL_EXT_client_extensions EGL_EXT_platform_base EGL_EXT_platform_device EGL_ANGLE_platform_angle EGL_ANGLE_platform_angle_d3d EGL_ANGLE_device_creation EGL_ANGLE_device_creation_d3d11 EGL_ANGLE_experimental_present_path EGL_KHR_client_get_all_proc_addresses
WebGL 1 Driver Renderer: Google Inc. -- ANGLE (Software Adapter Direct3D11 vs_4_1 ps_4_1)
WebGL 1 Driver Version: OpenGL ES 2.0 (ANGLE 2.1.0.)
WebGL 1 Driver Extensions: GL_OES_element_index_uint GL_OES_packed_depth_stencil GL_OES_get_program_binary GL_OES_rgb8_rgba8 GL_EXT_texture_format_BGRA8888 GL_EXT_read_format_bgra GL_NV_pixel_buffer_object GL_OES_mapbuffer GL_EXT_map_buffer_range GL_EXT_color_buffer_half_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_float GL_OES_texture_float_linear GL_EXT_texture_rg GL_EXT_texture_compression_dxt1 GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_OES_compressed_ETC1_RGB8_texture GL_EXT_sRGB GL_ANGLE_depth_texture GL_OES_depth32 GL_EXT_texture_storage GL_OES_texture_npot GL_EXT_draw_buffers GL_EXT_texture_filter_anisotropic GL_EXT_occlusion_query_boolean GL_NV_fence GL_EXT_disjoint_timer_query GL_EXT_robustness GL_EXT_blend_minmax GL_ANGLE_framebuffer_blit GL_ANGLE_framebuffer_multisample GL_ANGLE_instanced_arrays GL_ANGLE_pack_reverse_row_order GL_OES_standard_derivatives GL_EXT_shader_texture_lod GL_EXT_frag_depth GL_ANGLE_texture_usage GL_ANGLE_translated_shader_source GL_EXT_discard_framebuffer GL_EXT_debug_marker GL_OES_EGL_image GL_OES_EGL_image_external GL_NV_EGL_stream_consumer_external GL_EXT_unpack_subimage GL_NV_pack_subimage GL_OES_vertex_array_object GL_KHR_debug GL_ANGLE_lossy_etc_decode GL_CHROMIUM_bind_uniform_location GL_CHROMIUM_sync_query GL_CHROMIUM_copy_texture
WebGL 1 Extensions: ANGLE_instanced_arrays EXT_blend_minmax EXT_color_buffer_half_float EXT_frag_depth EXT_shader_texture_lod EXT_texture_filter_anisotropic EXT_disjoint_timer_query MOZ_debug_get OES_element_index_uint OES_standard_derivatives OES_texture_float OES_texture_float_linear OES_texture_half_float OES_texture_half_float_linear OES_vertex_array_object WEBGL_color_buffer_float WEBGL_compressed_texture_etc1 WEBGL_compressed_texture_s3tc WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_depth_texture WEBGL_draw_buffers WEBGL_lose_context MOZ_WEBGL_lose_context MOZ_WEBGL_compressed_texture_s3tc MOZ_WEBGL_depth_texture
WebGL 2 Driver WSI Info: EGL_VENDOR: Google Inc. (adapter LUID: 0000000000000000) EGL_VERSION: 1.4 (ANGLE 2.1.0.) EGL_EXTENSIONS: EGL_EXT_create_context_robustness EGL_ANGLE_query_surface_pointer EGL_ANGLE_window_fixed_size EGL_ANGLE_keyed_mutex EGL_ANGLE_surface_orientation EGL_KHR_create_context EGL_EXT_device_query EGL_KHR_image EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_get_all_proc_addresses EGL_KHR_stream EGL_KHR_stream_consumer_gltexture EGL_NV_stream_consumer_gltexture_yuv EGL_ANGLE_flexible_surface_compatibility EGL_EXTENSIONS(nullptr): EGL_EXT_client_extensions EGL_EXT_platform_base EGL_EXT_platform_device EGL_ANGLE_platform_angle EGL_ANGLE_platform_angle_d3d EGL_ANGLE_device_creation EGL_ANGLE_device_creation_d3d11 EGL_ANGLE_experimental_present_path EGL_KHR_client_get_all_proc_addresses
WebGL 2 Driver Renderer: Google Inc. -- ANGLE (Software Adapter Direct3D11 vs_4_1 ps_4_1)
WebGL 2 Driver Version: OpenGL ES 3.0 (ANGLE 2.1.0.)
WebGL 2 Driver Extensions: GL_OES_element_index_uint GL_OES_packed_depth_stencil GL_OES_get_program_binary GL_OES_rgb8_rgba8 GL_EXT_texture_format_BGRA8888 GL_EXT_read_format_bgra GL_NV_pixel_buffer_object GL_OES_mapbuffer GL_EXT_map_buffer_range GL_EXT_color_buffer_half_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_float GL_OES_texture_float_linear GL_EXT_texture_rg GL_EXT_texture_compression_dxt1 GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_OES_compressed_ETC1_RGB8_texture GL_EXT_sRGB GL_ANGLE_depth_texture GL_OES_depth32 GL_EXT_texture_storage GL_OES_texture_npot GL_EXT_draw_buffers GL_EXT_texture_filter_anisotropic GL_EXT_occlusion_query_boolean GL_NV_fence GL_EXT_disjoint_timer_query GL_EXT_robustness GL_EXT_blend_minmax GL_ANGLE_framebuffer_blit GL_ANGLE_framebuffer_multisample GL_ANGLE_instanced_arrays GL_ANGLE_pack_reverse_row_order GL_OES_standard_derivatives GL_EXT_shader_texture_lod GL_EXT_frag_depth GL_ANGLE_texture_usage GL_ANGLE_translated_shader_source GL_EXT_discard_framebuffer GL_EXT_debug_marker GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_EGL_image_external_essl3 GL_NV_EGL_stream_consumer_external GL_EXT_unpack_subimage GL_NV_pack_subimage GL_EXT_color_buffer_float GL_OES_vertex_array_object GL_KHR_debug GL_ANGLE_lossy_etc_decode GL_CHROMIUM_bind_uniform_location GL_CHROMIUM_sync_query GL_CHROMIUM_copy_texture GL_EXT_texture_norm16
WebGL 2 Extensions: EXT_color_buffer_float EXT_texture_filter_anisotropic EXT_disjoint_timer_query MOZ_debug_get OES_texture_float_linear WEBGL_compressed_texture_etc WEBGL_compressed_texture_etc1 WEBGL_compressed_texture_s3tc WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_lose_context MOZ_WEBGL_lose_context MOZ_WEBGL_compressed_texture_s3tc
Hardware H264 Decoding: No; Failed to create H264 decoder
Audio Backend: unknown
Direct2D: Blocked for your graphics card because of unresolved driver issues.
DirectWrite: false (6.1.7601.24535)
GPU #1
Active: Yes
Description: VirtualBox Graphics Adapter
Vendor ID: 0x80ee
Device ID: 0xbeef
Driver Version: 5.2.30.0
Driver Date: 5-13-2019
Drivers: VBoxDisp
Subsys ID: 00000000
RAM: Unknown

Diagnostics
AzureCanvasAccelerated: 0
AzureCanvasBackend: skia
AzureContentBackend: cairo
AzureFallbackCanvasBackend: cairo
Decision Log
D3D11_COMPOSITING:
Blocklisted; failure code BLOCKLIST_FEATURE_FAILURE_UNKNOWN_DEVICE_VENDOR
D3D9_COMPOSITING:
Blocklisted; failure code BLOCKLIST_FEATURE_FAILURE_UNKNOWN_DEVICE_VENDOR
DIRECT2D:
unavailable by default: Direct2D requires Direct3D 11 compositing
D3D11_HW_ANGLE:
unavailable by default: D3D11 compositing is disabled
disabled by env: D3D11 compositing is disabled




Important Modified Preferences
------------------------------

accessibility.typeaheadfind.flashBar: 0
browser.cache.disk.capacity: 358400
browser.cache.disk.smart_size.first_run: false
browser.download.importedFromSqlite: true
browser.places.smartBookmarksVersion: 4
browser.privatebrowsing.autostart: true
browser.startup.homepage_override.buildID: 20190723150040
browser.startup.homepage_override.mstone: 4.3.0
extensions.lastAppVersion: 28.6.1
font.internaluseonly.changed: true
gfx.crash-guard.d3d11layers.appVersion: 28.6.1
gfx.crash-guard.d3d11layers.deviceID: 0xbeef
gfx.crash-guard.d3d11layers.driverVersion: 5.2.30.0
gfx.crash-guard.d3d11layers.feature-d2d: false
gfx.crash-guard.d3d11layers.feature-d3d11: false
gfx.crash-guard.status.d3d11layers: 2
media.hardware-video-decoding.failed: true
network.cookie.cookieBehavior: 1
network.cookie.prefsMigrated: true
places.database.lastMaintenance: 1590141627
places.history.expiration.transient_current_max_pages: 122334
privacy.sanitize.migrateFx3Prefs: true
privacy.sanitize.timeSpan: 0
storage.vacuum.last.index: 1
storage.vacuum.last.places.sqlite: 1590573584

Important Locked Preferences
----------------------------

Places Database
---------------

JavaScript
----------

Incremental GC: true

Accessibility
-------------

Activated: false
Prevent Accessibility: 1

Library Versions
----------------

NSPR
Expected minimum version: 4.20
Version in use: 4.20

NSS
Expected minimum version: 3.41.2
Version in use: 3.41.2

NSSSMIME
Expected minimum version: 3.41.2
Version in use: 3.41.2

NSSSSL
Expected minimum version: 3.41.2
Version in use: 3.41.2

NSSUTIL
Expected minimum version: 3.41.2
Version in use: 3.41.2

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4983
Joined: 2015-12-09, 15:45

Re: 1 nothing-special github web page blows browser to almost 4GB

Unread post by moonbat » 2020-05-31, 11:40

Have you tried it with other browsers?
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

New Tobin Paradigm

Re: 1 nothing-special github web page blows browser to almost 4GB

Unread post by New Tobin Paradigm » 2020-05-31, 11:44

I've already confirmed the behavior. I mean yeah, large ass animated gifs use a bunch of memory.. the question now is.. if there is anything can be done about it and if we should bother.. Large animated gifs may simply be out of spec to bother with. I don't know..

Also, moonbat.. You're not helping.

me_ee

Re: 1 nothing-special github web page blows browser to almost 4GB

Unread post by me_ee » 2020-05-31, 11:52

@Moonbat: I only use PM. I might have chrome lying around n a VM. Let me see.
(just tried it in eww, the emacs browser, it says "stopping animatrion; animation possibly too big). Will check chrome

@New Tobin Paradigm: Let's be generous and assume the GIFs total 20MB (it's less). The PM bloat goes to ~4GB. That's a memeory 200x blowup. Does that sound acceptable?

Will update shortly.

User avatar
gepus
Keeps coming back
Keeps coming back
Posts: 943
Joined: 2017-12-14, 12:59

Re: 1 nothing-special github web page blows browser to almost 4GB

Unread post by gepus » 2020-05-31, 12:02

New Tobin Paradigm wrote:
2020-05-31, 10:21
I can confirm this it is because of multiple 2800x1412 size ~4.5 megabyte animated gifs. (yes I checked it is actually a gif not just pretending)
Confirmed.
Shouldn't image.animation_mode set to none decrease RAM consumption?
It seems to have no effect on Pale Moon here.

me_ee

Re: 1 nothing-special github web page blows browser to almost 4GB

Unread post by me_ee » 2020-05-31, 12:22

Newish VM, installed chrome (latest; Ver 83.0.4103.61, released 2 days ago), loaded page in question, ram bounces up and down with multiple chrome processes, but when it's loaded the mem used by chrome processes totals about 130MB.

New Tobin Paradigm

Re: 1 nothing-special github web page blows browser to almost 4GB

Unread post by New Tobin Paradigm » 2020-05-31, 12:45

What did I say?

I now hope nothing is done about this because you people wouldn't listen. In fact it should use MORE ram.

JustOff

Re: 1 nothing-special github web page blows browser to almost 4GB

Unread post by JustOff » 2020-05-31, 12:49

Mozregression fix range: 505bafe - 17e4728
Solution: bug #523950

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4983
Joined: 2015-12-09, 15:45

Re: 1 nothing-special github web page blows browser to almost 4GB

Unread post by moonbat » 2020-05-31, 14:32

JustOff wrote:
2020-05-31, 12:49
Solution: bug #523950
Off-topic:
Wow. Just took them 9 years to get around to fixing this with a much bigger development team at their disposal. God knows what else was pushed on the backburner while they were dicking around with Australis and e10s.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: 1 nothing-special github web page blows browser to almost 4GB

Unread post by Moonchild » 2020-05-31, 15:54

Solution: don't use multiple 2800x1412 size ~4.5 megabyte animated gifs.

As for the memory consumption: yes that is normal. Every frame of the animated gif will be decoded and stored as a raw image in memory - in most cases such a decoded image frame will take 2800x1412x4=15MB. Multiply that by the number of frames and you see that this is very RAM-expensive.
Depending on its use, it may get one or more copies of that in memory for compositing and/or effects, or as texture memory or similar. On the plus side each frame may take less if not represented as 32-bits.
The problem is that an animated gif is NOT a video format even though it's commonly abused as such. Animated gifs almost always use delta frames for the next frame in the animation. If you discard frames there is no way to recreate the discarded frames except to re-decode the animation from the first frame.

The images take 1.7GB, 1.35GB and 920MB, respectively, in browser surface memory; of which the bulk is decoded frames and 1 extra compositing surface frame.

I don't see a reason for us to do anything about this. It's wrong use of images, and the solution will require a lot of compromise for a corner case of abuse.
You do not have the required permissions to view the files attached to this post.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

me_ee

Re: 1 nothing-special github web page blows browser to almost 4GB

Unread post by me_ee » 2020-05-31, 17:56

It's not my website so I can't change that. I was simply reporting it as a possible bug.
If that's how PM or its library handles animated gifs I can't complain. Your description of delta encoded frames matches what I'd expect its implementation to be. The trivial way of handling it is to have a 2-entry ring buffer to build off the last full frame, etc. etc. but that's to swap lots of memory for some amount of CPU. It's not a great answer. Best answer is as you say, just don't do it.
I assume you'll close this with wontfix or similar. I'd support that. Thanks.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: 1 nothing-special github web page blows browser to almost 4GB

Unread post by Moonchild » 2020-05-31, 21:22

me_ee wrote:
2020-05-31, 17:56
The trivial way of handling it is to have a 2-entry ring buffer to build off the last full frame, etc. etc.
You're still thinking that GIFs are like video. They aren't.
The only "full frame" in an animated gif is frame 0. So no fancy decoding tricks using keyframes or what not would work.
The moment you discard anything from the decoded image you'll have to decode from 0 again.

WONTFIX, indeed.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

me_ee

Re: 1 nothing-special github web page blows browser to almost 4GB

Unread post by me_ee » 2020-05-31, 21:48

@MoonChild: I'm just trying to understand, not suggesting you fix anything. I was talking through options to understand what's possible theoretically, not suggesting a pile of new work for you. If it came across that way, it wasn't intended at all. Sorry if it did sound like it.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: 1 nothing-special github web page blows browser to almost 4GB

Unread post by Moonchild » 2020-05-31, 22:04

No worries, I understood the context. just providing some more feedback, is all.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Massacre
Moon lover
Moon lover
Posts: 95
Joined: 2020-05-01, 13:16

Re: 1 nothing-special github web page blows browser to almost 4GB

Unread post by Massacre » 2020-07-18, 11:46

Maybe add an option in about:config to prevent loading such dangerous content at all?

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: 1 nothing-special github web page blows browser to almost 4GB

Unread post by Moonchild » 2020-07-18, 12:26

Massacre wrote:
2020-07-18, 11:46
Maybe add an option in about:config to prevent loading such dangerous content at all?
Already exists: image.animation_mode -- set to none to disable GIF animations.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite