⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 285191 in webkit


Ignore:
Timestamp:
Nov 2, 2021, 6:27:28 PM (5 years ago)
Author:
rmorisset@apple.com
Message:

Regression (r284330): [ macOS wk1 Debug ] webaudio/AudioBuffer/huge-buffer.html is a flaky timeout
​https://bugs.webkit.org/show_bug.cgi?id=232244
<rdar://problem/84616427>

Reviewed by Yusuke Suzuki.

Source/WebCore:

The test is verifying that trying to allocate an AudioBuffer with 4GB channels fails cleanly.
It used to work automatically, as AudioBuffer relies on Float32Array under the hood, which was limited to 2GB.
Since r284330, ArrayBuffers can be up to 4GB, so it now takes very long to OOM, and sometimes timeout.
I use the same solution which I used for PixelBuffers in r284330: just test that the length is reasonable
and if it is not then abort as if the allocation of the Float32Array had failed.

No new tests: covered by LayoutTests/webaudio/AudioBuffer/huge-buffer.html

  • Modules/webaudio/AudioBuffer.cpp:

(WebCore::AudioBuffer::AudioBuffer):

  • Modules/webaudio/AudioBuffer.h:

LayoutTests:

  • platform/mac-wk1/TestExpectations:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r285169 r285191  
     12021-11-02  Robin Morisset  <rmorisset@apple.com>
     2
     3        Regression (r284330): [ macOS wk1 Debug ] webaudio/AudioBuffer/huge-buffer.html is a flaky timeout
     4        https://bugs.webkit.org/show_bug.cgi?id=232244
     5        <rdar://problem/84616427>
     6
     7        Reviewed by Yusuke Suzuki.
     8
     9        * platform/mac-wk1/TestExpectations:
     10
    1112021-11-02  Tyler Wilcock  <tyler_w@apple.com>
    212
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r285135 r285191  
    13861386webkit.org/b/228796 [ Catalina Debug ] webaudio/silent-audio-interrupted-in-background.html [ Pass Timeout ]
    13871387
    1388 webkit.org/b/232244 [ Debug ] webaudio/AudioBuffer/huge-buffer.html [ Pass Timeout ]
    1389 
    13901388webkit.org/b/227136 media/video-pause-immediately.html [ Pass Failure ]
    13911389
  • trunk/Source/WebCore/ChangeLog

    r285186 r285191  
     12021-11-02  Robin Morisset  <rmorisset@apple.com>
     2
     3        Regression (r284330): [ macOS wk1 Debug ] webaudio/AudioBuffer/huge-buffer.html is a flaky timeout
     4        https://bugs.webkit.org/show_bug.cgi?id=232244
     5        <rdar://problem/84616427>
     6
     7        Reviewed by Yusuke Suzuki.
     8
     9        The test is verifying that trying to allocate an AudioBuffer with 4GB channels fails cleanly.
     10        It used to work automatically, as AudioBuffer relies on Float32Array under the hood, which was limited to 2GB.
     11        Since r284330, ArrayBuffers can be up to 4GB, so it now takes very long to OOM, and sometimes timeout.
     12        I use the same solution which I used for PixelBuffers in r284330: just test that the length is reasonable
     13        and if it is not then abort as if the allocation of the Float32Array had failed.
     14
     15        No new tests: covered by LayoutTests/webaudio/AudioBuffer/huge-buffer.html
     16
     17        * Modules/webaudio/AudioBuffer.cpp:
     18        (WebCore::AudioBuffer::AudioBuffer):
     19        * Modules/webaudio/AudioBuffer.h:
     20
    1212021-11-02  Don Olmstead  <don.olmstead@sony.com>
    222
  • trunk/Source/WebCore/Modules/webaudio/AudioBuffer.cpp

    r284330 r285191  
    8787    , m_isDetachable(preventDetaching == LegacyPreventDetaching::No)
    8888{
     89    if (static_cast<uint64_t>(m_originalLength) > s_maxLength) {
     90        invalidate();
     91        return;
     92    }
     93
    8994    m_channels.reserveCapacity(numberOfChannels);
    9095
    … …  
    108113    , m_originalLength(bus.length())
    109114{
     115    if (static_cast<uint64_t>(m_originalLength) > s_maxLength) {
     116        invalidate();
     117        return;
     118    }
     119
    110120    // Copy audio data from the bus to the Float32Arrays we manage.
    111121    unsigned numberOfChannels = bus.numberOfChannels();
  • trunk/Source/WebCore/Modules/webaudio/AudioBuffer.h

    r283605 r285191  
    9393    bool hasDetachedChannelBuffer() const;
    9494
     95    // We do not currently support having the Float32Arrays in m_channels being more than 2GB,
     96    // and we have tests that we return an error promptly on trying to create such a huge AudioBuffer.
     97    static constexpr uint64_t s_maxLength = (1ull << 32) / sizeof(float);
     98
    9599    float m_sampleRate;
    96100    mutable Lock m_channelsLock;
Note: See TracChangeset for help on using the changeset viewer.