Closed Bug 1602678 Opened 6 years ago Closed 6 years ago

Intermittent image/test/reftest/downscaling/huge-1.html?32768x100.png,100,100 == image/test/reftest/downscaling/huge-1.html?100x100.png,100,100 | application crashed [@ __aeabi_memcpy]

Categories

(Core :: Graphics: WebRender, defect, P2)

ARM
Android
defect

Tracking

()

RESOLVED FIXED
mozilla73
Tracking Status
firefox-esr68 --- unaffected
firefox72 --- unaffected
firefox73 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: jnicol)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: crash, intermittent-failure, regression, Whiteboard: [stockwell fixed:other])

Crash Data

Attachments

(2 obsolete files)

Filed by: apavel [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer.html#?job_id=280385235&repo=autoland
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/XvAjtu7LQoWScvY0q--hxA/runs/0/artifacts/public/logs/live_backing.log
Reftest URL: https://hg.mozilla.org/mozilla-central/raw-file/tip/layout/tools/reftest/reftest-analyzer.xhtml#logurl=https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/XvAjtu7LQoWScvY0q--hxA/runs/0/artifacts/public/logs/live_backing.log&only_show_unexpected=1


[task 2019-12-10T04:48:46.930Z] 04:48:18 INFO - REFTEST TEST-START | http://10.7.205.207:8854/tests/image/test/reftest/downscaling/huge-1.html?32768x100.png,100,100 == http://10.7.205.207:8854/tests/image/test/reftest/downscaling/huge-1.html?100x100.png,100,100
[task 2019-12-10T04:48:46.930Z] 04:48:18 INFO - REFTEST INFO | RESTORE PREFERENCE pref(image.downscale-during-decode.enabled,false)
[task 2019-12-10T04:48:46.930Z] 04:48:18 INFO - REFTEST INFO | SET PREFERENCE pref(image.downscale-during-decode.enabled,true)
[task 2019-12-10T04:48:46.930Z] 04:48:18 INFO - REFTEST TEST-LOAD | http://10.7.205.207:8854/tests/image/test/reftest/downscaling/huge-1.html?32768x100.png,100,100 | 455 / 1915 (23%)
[task 2019-12-10T04:48:46.930Z] 04:48:40 INFO - wait for org.mozilla.geckoview.test complete; top activity=com.bitbar.testdroid.monitor
[task 2019-12-10T04:48:46.930Z] 04:48:40 INFO - remoteautomation.py | Application ran for: 0:02:45.120319
[task 2019-12-10T04:48:46.930Z] 04:48:41 INFO - REFTEST INFO | Downloading symbols from: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/W5F-nlUrTT-PnbUFuRYN5A/artifacts/public/build/target.crashreporter-symbols.zip
[task 2019-12-10T04:48:46.930Z] 04:48:43 INFO - REFTEST INFO | Copy/paste: /builds/task_1575952736/workspace/build/linux64-minidump_stackwalk /tmp/tmpNTZL5Q/36a90f5d-d9f8-da91-2f61-322bcfcf2109.dmp /tmp/tmpH7AJy2
[task 2019-12-10T04:48:46.930Z] 04:48:46 INFO - REFTEST INFO | Saved minidump as /builds/task_1575952736/workspace/build/blobber_upload_dir/36a90f5d-d9f8-da91-2f61-322bcfcf2109.dmp
[task 2019-12-10T04:48:46.930Z] 04:48:46 INFO - REFTEST INFO | Saved app info as /builds/task_1575952736/workspace/build/blobber_upload_dir/36a90f5d-d9f8-da91-2f61-322bcfcf2109.extra
[task 2019-12-10T04:48:46.930Z] 04:48:46 WARNING - REFTEST PROCESS-CRASH | http://10.7.205.207:8854/tests/image/test/reftest/downscaling/huge-1.html?32768x100.png,100,100 == http://10.7.205.207:8854/tests/image/test/reftest/downscaling/huge-1.html?100x100.png,100,100 | application crashed [@ __aeabi_memcpy]
[task 2019-12-10T04:48:46.930Z] 04:48:46 INFO - Crash dump filename: /tmp/tmpNTZL5Q/36a90f5d-d9f8-da91-2f61-322bcfcf2109.dmp
[task 2019-12-10T04:48:46.930Z] 04:48:46 INFO - Operating system: Android
[task 2019-12-10T04:48:46.930Z] 04:48:46 INFO - 0.0.0 Linux 4.4.56-g594d847d09a1 #1 SMP PREEMPT Thu Oct 26 22:34:08 UTC 2017 armv8l
[task 2019-12-10T04:48:46.930Z] 04:48:46 INFO - CPU: arm
[task 2019-12-10T04:48:46.930Z] 04:48:46 INFO - ARMv1 Qualcomm part(0x51008010) features: half,thumb,fastmult,vfpv2,edsp,neon,vfpv3,tls,vfpv4,idiva,idivt
[task 2019-12-10T04:48:46.930Z] 04:48:46 INFO - 8 CPUs
[task 2019-12-10T04:48:46.930Z] 04:48:46 INFO - GPU: UNKNOWN
[task 2019-12-10T04:48:46.930Z] 04:48:46 INFO - Crash reason: SIGSEGV /SEGV_MAPERR
[task 2019-12-10T04:48:46.930Z] 04:48:46 INFO - Crash address: 0x0
[task 2019-12-10T04:48:46.930Z] 04:48:46 INFO - Process uptime: not available
[task 2019-12-10T04:48:46.930Z] 04:48:46 INFO - Thread 42 (crashed)
[task 2019-12-10T04:48:46.930Z] 04:48:46 INFO - 0 libxul.so!__aeabi_memcpy [arm.rs : 131 + 0x24]
[task 2019-12-10T04:48:46.930Z] 04:48:46 INFO - r0 = 0x00000000 r1 = 0xa6f01000 r2 = 0x00c60800 r3 = 0x00000000
[task 2019-12-10T04:48:46.930Z] 04:48:46 INFO - r4 = 0xa6f01010 r5 = 0x00000064 r6 = 0x00020000 r7 = 0xbc87e6b8
[task 2019-12-10T04:48:46.930Z] 04:48:46 INFO - r8 = 0xbc87e800 r9 = 0x00000001 r10 = 0xbc87e7a0 r12 = 0x00c60800
[task 2019-12-10T04:48:46.930Z] 04:48:46 INFO - fp = 0x00000800 sp = 0xbc87e650 lr = 0x00c607f0 pc = 0xd0193328
[task 2019-12-10T04:48:46.930Z] 04:48:46 INFO - Found by: given as instruction pointer in context
[task 2019-12-10T04:48:46.931Z] 04:48:46 INFO - 1 libxul.so!webrender::device::gl::TextureUploader<T>::upload [intrinsics.rs:4560ea788cb760f0a34127156c78e2552949f734 : 1484 + 0x5]
[task 2019-12-10T04:48:46.931Z] 04:48:46 INFO - r4 = 0x00c80000 r5 = 0x00000064 r6 = 0x00020000 r7 = 0xbc87e6b8
[task 2019-12-10T04:48:46.931Z] 04:48:46 INFO - r8 = 0xbc87e800 r9 = 0x00000001 r10 = 0xbc87e7a0 fp = 0x00000800
[task 2019-12-10T04:48:46.931Z] 04:48:46 INFO - sp = 0xbc87e658 pc = 0xd00aed97
[task 2019-12-10T04:48:46.931Z] 04:48:46 INFO - Found by: call frame info
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - 2 libxul.so!webrender::renderer::Renderer::update_texture_cache [renderer.rs:3f9482614123972f6fcd8b6a1d99dc8db8cb6c07 : 3553 + 0x5]
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - r4 = 0x00000064 r5 = 0x00000000 r6 = 0x00000000 r7 = 0xbc87e968
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - r8 = 0xbc87e7a0 r9 = 0xb4928040 r10 = 0x00000000 fp = 0x00000009
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - sp = 0xbc87e6c0 pc = 0xd00ab645
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - Found by: call frame info
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - 3 libxul.so!webrender::renderer::Renderer::render_impl [renderer.rs:3f9482614123972f6fcd8b6a1d99dc8db8cb6c07 : 3089 + 0x5]
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - r4 = 0xb8c3f000 r5 = 0xfffffffc r6 = 0xb8c3f000 r7 = 0xbc87f420
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - r8 = 0x0000026e r9 = 0x188ad711 r10 = 0x00000683 fp = 0x00000001
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - sp = 0xbc87e970 pc = 0xd00a4b23
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - Found by: call frame info
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - 4 libxul.so!wr_renderer_render [bindings.rs:3f9482614123972f6fcd8b6a1d99dc8db8cb6c07 : 654 + 0x1d]
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - r4 = 0x00000000 r5 = 0x00000008 r6 = 0x00000008 r7 = 0xbc87f560
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - r8 = 0xbc87f714 r9 = 0xbc87f4e0 r10 = 0xb8c40620 fp = 0xbc87f648
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - sp = 0xbc87f428 pc = 0xd00eee5b
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - Found by: call frame info
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - 5 libxul.so!mozilla::wr::RenderThread::UpdateAndRender(mozilla::wr::WrWindowId, mozilla::layers::BaseTransactionId<mozilla::VsyncIdType> const&, mozilla::TimeStamp const&, bool, mozilla::Maybe<mozilla::gfx::IntSizeTyped<mozilla::gfx::UnknownUnits> > const&, mozilla::Maybe<mozilla::wr::ImageFormat> const&, mozilla::Maybe<mozilla::Range<unsigned char> > const&, bool) [RenderThread.cpp:3f9482614123972f6fcd8b6a1d99dc8db8cb6c07 : 477 + 0x4b]
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - r4 = 0x00000000 r5 = 0xb8c1d100 r6 = 0x00000001 r7 = 0xbc87f6b8
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - r8 = 0xbc87f714 r9 = 0xd0c90ab8 r10 = 0xb8c3d660 fp = 0xbc87f714
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - sp = 0xbc87f568 pc = 0xce34a021
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - Found by: call frame info
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - 6 libxul.so!mozilla::wr::RenderThread::HandleFrameOneDoc(mozilla::wr::WrWindowId, bool) [RenderThread.cpp:3f9482614123972f6fcd8b6a1d99dc8db8cb6c07 : 353 + 0x1d]
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - r4 = 0x00000001 r5 = 0x00000000 r6 = 0xbcbaa160 r7 = 0xbc87f750
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - r8 = 0x00000001 r9 = 0xbc87f720 r10 = 0xeebd91b8 fp = 0xbc87f714
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - sp = 0xbc87f6c0 lr = 0xce3499cb pc = 0xce3499cb
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - Found by: call frame info
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - 7 libxul.so!mozilla::detail::RunnableMethodImpl<RefPtr<mozilla::layers::APZCTreeManager>, void (mozilla::layers::IAPZCTreeManager::)(unsigned long long, bool), true, (mozilla::RunnableKind)0, unsigned long long, bool>::Run() [nsThreadUtils.h:3f9482614123972f6fcd8b6a1d99dc8db8cb6c07 : 1176 + 0x1d]
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - r4 = 0xce349881 r5 = 0xb4910190 r6 = 0xbcba8690 r7 = 0xbc87f768
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - r8 = 0xbc87f880 r9 = 0xbc87f820 r10 = 0x00000000 fp = 0x00000000
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - sp = 0xbc87f758 lr = 0xce2f43af pc = 0xce2f43af
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - Found by: call frame info
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - 8 libxul.so!MessageLoop::RunTask(already_AddRefed<nsIRunnable>) [message_loop.cc:3f9482614123972f6fcd8b6a1d99dc8db8cb6c07 : 442 + 0x7]
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - r4 = 0xbc87f880 r5 = 0xb4910190 r6 = 0xbcba8690 r7 = 0xbc87f778
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - r8 = 0xbc87f880 r9 = 0xbc87f820 r10 = 0x00000000 fp = 0x00000000
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - sp = 0xbc87f770 lr = 0xcdee68a3 pc = 0xcdee68a3
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - Found by: call frame info
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - 9 libxul.so!MessageLoop::DeferOrRunPendingTask(MessageLoop::PendingTask&&) [message_loop.cc:3f9482614123972f6fcd8b6a1d99dc8db8cb6c07 : 450 + 0xb]
[task 2019-12-10T04:48:46.933Z] 04:48:46 INFO - r4 = 0x00000102 r5 = 0x00000000 r6 = 0xbcba8690 r7 = 0xbc87f780
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - r8 = 0xbc87f880 r9 = 0xbc87f820 r10 = 0x00000000 fp = 0x00000000
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - sp = 0xbc87f780 lr = 0xcdee6a85 pc = 0xcdee6a85
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - Found by: call frame info
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - 10 libxul.so!MessageLoop::DoWork() [message_loop.cc:3f9482614123972f6fcd8b6a1d99dc8db8cb6c07 : 523 + 0x7]
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - r4 = 0x00000102 r5 = 0x00000000 r6 = 0xbcba8690 r7 = 0xbc87f7f8
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - r8 = 0xbc87f880 r9 = 0xbc87f820 r10 = 0x00000000 fp = 0x00000000
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - sp = 0xbc87f788 lr = 0xcdee6d07 pc = 0xcdee6d07
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - Found by: call frame info
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - 11 libxul.so!base::MessagePumpDefault::Run(base::MessagePump::Delegate
) [message_pump_default.cc:3f9482614123972f6fcd8b6a1d99dc8db8cb6c07 : 35 + 0x7]
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - r4 = 0xbcba8680 r5 = 0xbc87f880 r6 = 0xbcba8690 r7 = 0xbc87f848
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - r8 = 0xd0383589 r9 = 0xbc87f820 r10 = 0x00000000 fp = 0x00000000
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - sp = 0xbc87f800 lr = 0xcdee753b pc = 0xcdee753b
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - Found by: call frame info
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - 12 libxul.so!MessageLoop::Run() [message_loop.cc:3f9482614123972f6fcd8b6a1d99dc8db8cb6c07 : 290 + 0x7]
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - r4 = 0xeebd91b8 r5 = 0x00000000 r6 = 0xbcba85f4 r7 = 0xbc87f870
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - r8 = 0xeebd91b8 r9 = 0xbc87f880 r10 = 0xcdee93d5 fp = 0x00000002
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - sp = 0xbc87f850 lr = 0xcdee6867 pc = 0xcdee6867
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - Found by: call frame info
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - 13 libxul.so!base::Thread::ThreadMain() [thread.cc:3f9482614123972f6fcd8b6a1d99dc8db8cb6c07 : 192 + 0x5]
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - r4 = 0xbcba85e0 r5 = 0x00000000 r6 = 0xbcba85f4 r7 = 0xbc87f948
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - r8 = 0xeebd91b8 r9 = 0xbc87f880 r10 = 0xcdee93d5 fp = 0x00000002
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - sp = 0xbc87f878 lr = 0xcdeeb327 pc = 0xcdeeb327
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - Found by: call frame info
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - 14 libxul.so!ThreadFunc(void*) [platform_thread_posix.cc:3f9482614123972f6fcd8b6a1d99dc8db8cb6c07 : 40 + 0x5]
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - r4 = 0xbc87f970 r5 = 0xbc87f970 r6 = 0xbc87f970 r7 = 0xbc87f950
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - r8 = 0x0000173e r9 = 0x0000174e r10 = 0xcdee93d5 fp = 0x00000002
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - sp = 0xbc87f950 lr = 0xcdee93df pc = 0xcdee93df
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - Found by: call frame info
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - 15 libc.so + 0x47947
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - r4 = 0xbc87f970 r5 = 0xbc87f970 r6 = 0xbc87f970 r7 = 0x00000078
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - r8 = 0x0000173e r9 = 0x0000174e r10 = 0xcdee93d5 fp = 0x00000002
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - sp = 0xbc87f958 lr = 0xeeb88949 pc = 0xeeb88949
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - Found by: call frame info
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - 16 libc.so + 0x4792f
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - sp = 0xbc87f95c pc = 0xeeb88931
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - Found by: stack scanning
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - 17 libc.so + 0x1b381
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - sp = 0xbc87f960 pc = 0xeeb5c383
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - Found by: stack scanning
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - 18 libc.so + 0x4792f
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - sp = 0xbc87f968 pc = 0xeeb88931
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - Found by: stack scanning
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - 19 libxul.so!std::__ndk1::__vector_base<MessageLoop::PendingTask, std::__ndk1::allocator<MessageLoop::PendingTask> >::__destruct_at_end(MessageLoop::PendingTask*) [vector : 429 + 0x5]
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - sp = 0xbc87f9a4 pc = 0xcdee93d5
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - Found by: stack scanning
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - 20 dalvik-main space (region space) (deleted) + 0x1d7820b6
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - sp = 0xbc87f9d8 pc = 0x303820b8
[task 2019-12-10T04:48:46.941Z] 04:48:46 INFO - Found by: stack scanning

Flags: needinfo?(aosmond)

Perhaps it could be caused by Bug 1598380.

Null pointer deref from map_buffer_range? (Spec says it can return null in case of an error.)

Blocks: wr-android, wr-73
Component: ImageLib → Graphics: WebRender
Flags: needinfo?(aosmond) → needinfo?(jnicol)
OS: Unspecified → Android
Priority: -- → P2
Regressed by: 1598380
Hardware: Unspecified → ARM
Has Regression Range: --- → yes
Keywords: regression

Yeah that seems believable. We'll be attempting to map larger ranges now since bug 1598380, so that could increase the likelihood of it failing.

Assignee: nobody → jnicol
Flags: needinfo?(jnicol)

I cannot reproduce a crash locally, but I can reproduce very suspect behaviour. For the test huge-1.html?32768x100.jpg,100,100, if I add some logging, I can see that we attempt to allocate a PBO of 838860800 bytes. We then attempt to upload 64 512x100 regions, each with a stride of 131072. 131072 / 4 is 32768, the original image's width.

So it appears webrender is being given a non-downscaled image, 32768x100. Webrender then tiles it in to 64 different 512x100 tiles, so they fit in the texture cache. I presume that when we go to upload each tile, they are still sharing the single source buffer, which means the stride of each tile is the full width of the original image. Previously, we allocated a PBO for each tile of stride * height size, which was still the same total amount of memory but perhaps the driver handled it better as separate buffers. Since bug 1598380, however, we allocate a single PBO the size of 64 * stride * height, which is clearly large enough to fail sometimes. I guess Andrew is correct that this then leads to us memcpying to null.

So there are a few things to do here:

  1. Segfaults are bad. If glMapBufferRange() fails, we should handle that. Probably by falling back to immediate uploads for now. Longer term, bug 1602550 will be more graceful.
  2. We can tightly pack data in PBOs. This will drastically reduce the required memory usage.
  3. Work out why webrender is receiving a non-downscaled image in this test case. This seems wrong, but in any case, we need to fix 1) and 2) because we could encounter images genuinely that large in the real world

When attempting to use PBOs to upload texture data, it is possible that
glMapBufferRange() will fail, likely due to OOM. Currently we do not handle this
case, so can crash when attempting to copy data in to the (not) mapped
region. This change makes it so that we check glMapBufferRange() for failure,
and fall back to immediate (non-PBO) uploads in this case.

Currently when copying texture data in to a mapped PBO, we keep stride of the
data the same as in the CPU-side buffer (possibly rounded up slightly for
alignment reasons). For data with a stride greater than the width * bpp, this is
wasted space, and results in our PBOs requiring more memory than is strictly
necessary.

This is especially bad in the case of very large images which are tiled in the
texture cache: each tile will require its own region in the PBO of
height * non-tiled-stride, making the total PBO size many multiples of the
original image.

To fix this, we pack the data as tightly as possible within the PBO. The
downside is that this may require a line-by-line memcpy rather than copying the
entire chunk at once. But the upside is drastically reduced memory usage and
total amount of copying.

Depends on D56752

Attachment #9115212 - Attachment is obsolete: true
Attachment #9115211 - Attachment is obsolete: true

Abandoning these revisions as the fixes were included in bug 1602678 when it was re-landed.

Whiteboard: [stockwell needswork:owner] → [stockwell fixed:other]

@jnicol: Marking this as fixed, please re-open if this is incorrect.

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED

Thanks Kris. Andrew, should we file a follow up bug for why webrender wasn't being passed a downscaled image, or did you think you understood the reason and it wasn't an issue?

Flags: needinfo?(aosmond)
Target Milestone: --- → mozilla73

I think I know why. I'm not sure how we can do better though, it will give a substitute if that's what it has....maybe it shouldn't if it is too big.

Flags: needinfo?(aosmond)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: