Bug 225374 - REGRESSION (r276633): ASSERTION FAILED: !forbidMallocUseScopeCount || disableMallocRestrictionScopeCount
Summary: REGRESSION (r276633): ASSERTION FAILED: !forbidMallocUseScopeCount || disable...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-04 17:06 PDT by Ryan Haddad
Modified: 2021-05-05 10:01 PDT (History)
11 users (show)

See Also:


Attachments
Patch (2.19 KB, patch)
2021-05-05 01:11 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Haddad 2021-05-04 17:06:28 PDT
The following test is consistently asserting (and being classified as a timeout) on iOS debug bots:

    TestWebKitAPI.WebKit2.SpeechRecognitionErrorWhenStartingAudioCaptureOnDifferentPage
        ASSERTION FAILED: !forbidMallocUseScopeCount || disableMallocRestrictionScopeCount
        /Volumes/Data/worker/ios-simulator-14-debug/build/Source/WTF/wtf/FastMalloc.cpp(524) : void *WTF::fastMalloc(size_t)
        1   0x4a34d10b9 WTFCrash
        2   0x4a4d7687b WTFCrashWithInfo(int, char const*, char const*, int)
        3   0x4a351333b WTF::fastMalloc(unsigned long)
        4   0x48810ee15 IPC::Encoder::operator new(unsigned long)
        5   0x48810ed9f WTF::UniqueRef<IPC::Encoder> WTF::makeUniqueRefWithoutFastMallocCheck<IPC::Encoder, IPC::MessageName, unsigned long long&>(IPC::MessageName&&, unsigned long long&)
        6   0x48810ecab WTF::UniqueRef<IPC::Encoder> WTF::makeUniqueRef<IPC::Encoder, IPC::MessageName, unsigned long long&>(IPC::MessageName&&, unsigned long long&)
        7   0x489e363a9 bool IPC::Connection::send<Messages::SpeechRecognitionRemoteRealtimeMediaSourceManager::SetStorage>(Messages::SpeechRecognitionRemoteRealtimeMediaSourceManager::SetStorage&&, unsigned long long, WTF::OptionSet<IPC::SendOption>)
        8   0x489e34d7c WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::storageChanged(WebKit::SharedMemory*)
        9   0x489e359cf decltype(*(std::__1::forward<WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source*&>(fp0)).*fp(std::__1::forward<WebKit::SharedMemory*>(fp1))) std::__1::__invoke<void (WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::*&)(WebKit::SharedMemory*), WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source*&, WebKit::SharedMemory*, void>(void (WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::*&)(WebKit::SharedMemory*), WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source*&, WebKit::SharedMemory*&&)
        10  0x489e358ed std::__1::__bind_return<void (WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::*)(WebKit::SharedMemory*), std::__1::tuple<WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source*, std::__1::placeholders::__ph<1> >, std::__1::tuple<WebKit::SharedMemory*&&, WebCore::CAAudioStreamDescription const&, unsigned long&&>, __is_valid_bind_return<void (WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::*)(WebKit::SharedMemory*), std::__1::tuple<WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source*, std::__1::placeholders::__ph<1> >, std::__1::tuple<WebKit::SharedMemory*&&, WebCore::CAAudioStreamDescription const&, unsigned long&&> >::value>::type std::__1::__apply_functor<void (WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::*)(WebKit::SharedMemory*), std::__1::tuple<WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source*, std::__1::placeholders::__ph<1> >, 0ul, 1ul, std::__1::tuple<WebKit::SharedMemory*&&, WebCore::CAAudioStreamDescription const&, unsigned long&&> >(void (WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::*&)(WebKit::SharedMemory*), std::__1::tuple<WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source*, std::__1::placeholders::__ph<1> >&, std::__1::__tuple_indices<0ul, 1ul>, std::__1::tuple<WebKit::SharedMemory*&&, WebCore::CAAudioStreamDescription const&, unsigned long&&>&&)
        11  0x489e35856 std::__1::__bind_return<void (WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::*)(WebKit::SharedMemory*), std::__1::tuple<WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source*, std::__1::placeholders::__ph<1> >, std::__1::tuple<WebKit::SharedMemory*&&, WebCore::CAAudioStreamDescription const&, unsigned long&&>, __is_valid_bind_return<void (WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::*)(WebKit::SharedMemory*), std::__1::tuple<WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source*, std::__1::placeholders::__ph<1> >, std::__1::tuple<WebKit::SharedMemory*&&, WebCore::CAAudioStreamDescription const&, unsigned long&&> >::value>::type std::__1::__bind<void (WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::*)(WebKit::SharedMemory*), WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source*, std::__1::placeholders::__ph<1> const&>::operator()<WebKit::SharedMemory*, WebCore::CAAudioStreamDescription const&, unsigned long>(WebKit::SharedMemory*&&, WebCore::CAAudioStreamDescription const&, unsigned long&&)
        12  0x489e3578d WTF::Detail::CallableWrapper<std::__1::__bind<void (WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::*)(WebKit::SharedMemory*), WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source*, std::__1::placeholders::__ph<1> const&>, void, WebKit::SharedMemory*, WebCore::CAAudioStreamDescription const&, unsigned long>::call(WebKit::SharedMemory*, WebCore::CAAudioStreamDescription const&, unsigned long)
        13  0x4892b2923 WTF::Function<void (WebKit::SharedMemory*, WebCore::CAAudioStreamDescription const&, unsigned long)>::operator()(WebKit::SharedMemory*, WebCore::CAAudioStreamDescription const&, unsigned long) const
        14  0x4892b2818 WebKit::SharedRingBufferStorage::setStorage(WTF::RefPtr<WebKit::SharedMemory, WTF::RawPtrTraits<WebKit::SharedMemory>, WTF::DefaultRefDerefTraits<WebKit::SharedMemory> >&&, WebCore::CAAudioStreamDescription const&, unsigned long)
        15  0x4892b2a22 WebKit::SharedRingBufferStorage::deallocate()
        16  0x4afcba245 WebCore::CARingBuffer::deallocate()
        17  0x4afcba4cf WebCore::CARingBuffer::allocate(WebCore::CAAudioStreamDescription const&, unsigned long)
        18  0x489e351e4 WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::audioSamplesAvailable(WTF::MediaTime const&, WebCore::PlatformAudioData const&, WebCore::AudioStreamDescription const&, unsigned long)
        19  0x4b006afb9 WebCore::RealtimeMediaSource::audioSamplesAvailable(WTF::MediaTime const&, WebCore::PlatformAudioData const&, WebCore::AudioStreamDescription const&, unsigned long)
        20  0x4b00d1047 WebCore::BaseAudioSharedUnit::audioSamplesAvailable(WTF::MediaTime const&, WebCore::PlatformAudioData const&, WebCore::AudioStreamDescription const&, unsigned long)
        21  0x4add72c68 WebCore::MockAudioSharedUnit::emitSampleBuffers(unsigned int)
        22  0x4add72f71 WebCore::MockAudioSharedUnit::render(WTF::Seconds)
        23  0x4add7da15 WebCore::MockAudioSharedUnit::tick()::$_3::operator()() const
        ASSERTION FAILED: !forbidMallocUseScopeCount || disableMallocRestrictionScopeCount
        /Volumes/Data/worker/ios-simulator-14-debug/build/Source/WTF/wtf/FastMalloc.cpp(524) : void *WTF::fastMalloc(size_t)
        24  0x4add7d99e WTF::Detail::CallableWrapper<WebCore::MockAudioSharedUnit::tick()::$_3, void>::call()
        25  0x4a34fcf62 WTF::Function<void ()>::operator()() const
        26  0x4a36216be WTF::WorkQueue::dispatch(WTF::Function<void ()>&&)::$_0::operator()() const
        27  0x4a36218c2 WTF::BlockPtr<void ()> WTF::BlockPtr<void ()>::fromCallable<WTF::WorkQueue::dispatch(WTF::Function<void ()>&&)::$_0>(WTF::WorkQueue::dispatch(WTF::Function<void ()>&&)::$_0)::'lambda'(void*)::operator()(void*) const
        28  0x4a3621895 WTF::BlockPtr<void ()> WTF::BlockPtr<void ()>::fromCallable<WTF::WorkQueue::dispatch(WTF::Function<void ()>&&)::$_0>(WTF::WorkQueue::dispatch(WTF::Function<void ()>&&)::$_0)::'lambda'(void*)::__invoke(void*)
        29  0x49975f32f _dispatch_call_block_and_release
        30  0x499760508 _dispatch_client_callout
        31  0x4997663f9 _dispatch_lane_serial_drain
        1   0x65b4d10b9 WTFCrash
        2   0x65cd7687b WTFCrashWithInfo(int, char const*, char const*, int)
        3   0x65b51333b WTF::fastMalloc(unsigned long)
        4   0x64010ee15 IPC::Encoder::operator new(unsigned long)
        5   0x64010ed9f WTF::UniqueRef<IPC::Encoder> WTF::makeUniqueRefWithoutFastMallocCheck<IPC::Encoder, IPC::MessageName, unsigned long long&>(IPC::MessageName&&, unsigned long long&)
        6   0x64010ecab WTF::UniqueRef<IPC::Encoder> WTF::makeUniqueRef<IPC::Encoder, IPC::MessageName, unsigned long long&>(IPC::MessageName&&, unsigned long long&)
        7   0x641e363a9 bool IPC::Connection::send<Messages::SpeechRecognitionRemoteRealtimeMediaSourceManager::SetStorage>(Messages::SpeechRecognitionRemoteRealtimeMediaSourceManager::SetStorage&&, unsigned long long, WTF::OptionSet<IPC::SendOption>)
        8   0x641e34d7c WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::storageChanged(WebKit::SharedMemory*)
        9   0x641e359cf decltype(*(std::__1::forward<WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source*&>(fp0)).*fp(std::__1::forward<WebKit::SharedMemory*>(fp1))) std::__1::__invoke<void (WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::*&)(WebKit::SharedMemory*), WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source*&, WebKit::SharedMemory*, void>(void (WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::*&)(WebKit::SharedMemory*), WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source*&, WebKit::SharedMemory*&&)
        10  0x641e358ed std::__1::__bind_return<void (WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::*)(WebKit::SharedMemory*), std::__1::tuple<WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source*, std::__1::placeholders::__ph<1> >, std::__1::tuple<WebKit::SharedMemory*&&, WebCore::CAAudioStreamDescription const&, unsigned long&&>, __is_valid_bind_return<void (WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::*)(WebKit::SharedMemory*), std::__1::tuple<WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source*, std::__1::placeholders::__ph<1> >, std::__1::tuple<WebKit::SharedMemory*&&, WebCore::CAAudioStreamDescription const&, unsigned long&&> >::value>::type std::__1::__apply_functor<void (WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::*)(WebKit::SharedMemory*), std::__1::tuple<WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source*, std::__1::placeholders::__ph<1> >, 0ul, 1ul, std::__1::tuple<WebKit::SharedMemory*&&, WebCore::CAAudioStreamDescription const&, unsigned long&&> >(void (WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::*&)(WebKit::SharedMemory*), std::__1::tuple<WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source*, std::__1::placeholders::__ph<1> >&, std::__1::__tuple_indices<0ul, 1ul>, std::__1::tuple<WebKit::SharedMemory*&&, WebCore::CAAudioStreamDescription const&, unsigned long&&>&&)
        11  0x641e35856 std::__1::__bind_return<void (WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::*)(WebKit::SharedMemory*), std::__1::tuple<WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source*, std::__1::placeholders::__ph<1> >, std::__1::tuple<WebKit::SharedMemory*&&, WebCore::CAAudioStreamDescription const&, unsigned long&&>, __is_valid_bind_return<void (WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::*)(WebKit::SharedMemory*), std::__1::tuple<WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source*, std::__1::placeholders::__ph<1> >, std::__1::tuple<WebKit::SharedMemory*&&, WebCore::CAAudioStreamDescription const&, unsigned long&&> >::value>::type std::__1::__bind<void (WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::*)(WebKit::SharedMemory*), WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source*, std::__1::placeholders::__ph<1> const&>::operator()<WebKit::SharedMemory*, WebCore::CAAudioStreamDescription const&, unsigned long>(WebKit::SharedMemory*&&, WebCore::CAAudioStreamDescription const&, unsigned long&&)
        12  0x641e3578d WTF::Detail::CallableWrapper<std::__1::__bind<void (WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::*)(WebKit::SharedMemory*), WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source*, std::__1::placeholders::__ph<1> const&>, void, WebKit::SharedMemory*, WebCore::CAAudioStreamDescription const&, unsigned long>::call(WebKit::SharedMemory*, WebCore::CAAudioStreamDescription const&, unsigned long)
        13  0x6412b2923 WTF::Function<void (WebKit::SharedMemory*, WebCore::CAAudioStreamDescription const&, unsigned long)>::operator()(WebKit::SharedMemory*, WebCore::CAAudioStreamDescription const&, unsigned long) const
        14  0x6412b2818 WebKit::SharedRingBufferStorage::setStorage(WTF::RefPtr<WebKit::SharedMemory, WTF::RawPtrTraits<WebKit::SharedMemory>, WTF::DefaultRefDerefTraits<WebKit::SharedMemory> >&&, WebCore::CAAudioStreamDescription const&, unsigned long)
        15  0x6412b2a22 WebKit::SharedRingBufferStorage::deallocate()
        16  0x667cba245 WebCore::CARingBuffer::deallocate()
        17  0x667cba4cf WebCore::CARingBuffer::allocate(WebCore::CAAudioStreamDescription const&, unsigned long)
        18  0x641e351e4 WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::audioSamplesAvailable(WTF::MediaTime const&, WebCore::PlatformAudioData const&, WebCore::AudioStreamDescription const&, unsigned long)
        19  0x66806afb9 WebCore::RealtimeMediaSource::audioSamplesAvailable(WTF::MediaTime const&, WebCore::PlatformAudioData const&, WebCore::AudioStreamDescription const&, unsigned long)
        20  0x6680d1047 WebCore::BaseAudioSharedUnit::audioSamplesAvailable(WTF::MediaTime const&, WebCore::PlatformAudioData const&, WebCore::AudioStreamDescription const&, unsigned long)
        21  0x665d72c68 WebCore::MockAudioSharedUnit::emitSampleBuffers(unsigned int)
        22  0x665d72f71 WebCore::MockAudioSharedUnit::render(WTF::Seconds)
        23  0x665d7da15 WebCore::MockAudioSharedUnit::tick()::$_3::operator()() const
        24  0x665d7d99e WTF::Detail::CallableWrapper<WebCore::MockAudioSharedUnit::tick()::$_3, void>::call()
        25  0x65b4fcf62 WTF::Function<void ()>::operator()() const
        26  0x65b6216be WTF::WorkQueue::dispatch(WTF::Function<void ()>&&)::$_0::operator()() const
        27  0x65b6218c2 WTF::BlockPtr<void ()> WTF::BlockPtr<void ()>::fromCallable<WTF::WorkQueue::dispatch(WTF::Function<void ()>&&)::$_0>(WTF::WorkQueue::dispatch(WTF::Function<void ()>&&)::$_0)::'lambda'(void*)::operator()(void*) const
        28  0x65b621895 WTF::BlockPtr<void ()> WTF::BlockPtr<void ()>::fromCallable<WTF::WorkQueue::dispatch(WTF::Function<void ()>&&)::$_0>(WTF::WorkQueue::dispatch(WTF::Function<void ()>&&)::$_0)::'lambda'(void*)::__invoke(void*)
        29  0x65175f32f _dispatch_call_block_and_release
        30  0x651760508 _dispatch_client_callout
        31  0x6517663f9 _dispatch_lane_serial_drain

https://results.webkit.org/?suite=api-tests&test=TestWebKitAPI.WebKit2.SpeechRecognitionErrorWhenStartingAudioCaptureOnDifferentPage
Comment 1 Radar WebKit Bug Importer 2021-05-04 17:06:42 PDT
<rdar://problem/77533237>
Comment 2 Ryan Haddad 2021-05-04 17:07:56 PDT
This assert is also seen on Big Sur bots with both of these tests:
TestWebKitAPI.WebKit2.SpeechRecognitionPageBecomesInvisible
TestWebKitAPI.WebKit2.SpeechRecognitionErrorWhenStartingAudioCaptureOnDifferentPage

https://build.webkit.org/#/builders/3/builds/1676/steps/11/logs/stdio
Comment 3 Ryan Haddad 2021-05-04 17:15:19 PDT
(In reply to Ryan Haddad from comment #2)
> This assert is also seen on Big Sur bots with both of these tests:
> TestWebKitAPI.WebKit2.SpeechRecognitionPageBecomesInvisible
> TestWebKitAPI.WebKit2.
> SpeechRecognitionErrorWhenStartingAudioCaptureOnDifferentPage
> 
> https://build.webkit.org/#/builders/3/builds/1676/steps/11/logs/stdio
Actually, https://trac.webkit.org/changeset/276839/webkit fixed that for macOS.

We're still seeing issues on iOS, though.
Comment 4 youenn fablet 2021-05-05 01:11:26 PDT
Created attachment 427738 [details]
Patch
Comment 5 EWS 2021-05-05 10:00:58 PDT
Committed r277026 (237339@main): <https://commits.webkit.org/237339@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 427738 [details].