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

Crash while using Copy text from image #30178

Closed
simonhong opened this issue May 6, 2023 · 5 comments · Fixed by brave/brave-core#18394
Closed

Crash while using Copy text from image #30178

simonhong opened this issue May 6, 2023 · 5 comments · Fixed by brave/brave-core#18394

Comments

@simonhong
Copy link
Member

Reporetd from @MadhaviSeelam while testing #29003

[ 00 ] views::View::GetPreferredSize() ( view.cc:539 )
[ 01 ] views::Label::SetText(std::Cr::basic_string<char16_t,std::Cr::char_traits<char16_t>,std::Cr::allocator<char16_t> > const &) ( label.cc:120 )
[ 02 ] ipcz::Router::AcceptInboundParcel(ipcz::OperationContext const &,ipcz::Parcel &) ( router.cc:264 )
[ 03 ] static void TextRecognitionDialogView::OnGetTextFromImage(const class std::Cr::vector<std::Cr::basic_string<char,std::Cr::char_traits<char>,std::Cr::allocator<char> >,std::Cr::allocator<std::Cr::basic_string<char,std::Cr::char_traits<char>,std::Cr::allocator<char> > > > & const) ( text_recognition_dialog_view.cc:212 )
[ 04 ] brave::ShowTextRecognitionDialog(content::WebContents *,SkBitmap const &) ( text_recognition_dialog_view.cc:87 )
[ 05 ] _tailMerge_esent.dll
[ 06 ] _tailMerge_esent.dll
[ 07 ] brave::ShowTextRecognitionDialog(content::WebContents *,SkBitmap const &) ( text_recognition_dialog_view.cc:87 )
[ 08 ] static void allocator_shim::internal::PartitionFree(const struct allocator_shim::AllocatorDispatch *, void *, void *) ( allocator_shim_default_dispatch_to_partition_alloc.cc:440 )
[ 09 ] IPC::`anonymous namespace'::ChannelAssociatedGroupController::Accept(mojo::Message *) ( ipc_mojo_bootstrap.cc:1010 )
[ 10 ] ipcz::Router::AcceptInboundParcel(ipcz::OperationContext const &,ipcz::Parcel &) ( router.cc:264 )
[ 11 ] static void TextRecognitionDialogView::StartExtractingText(const class std::Cr::basic_string<char,std::Cr::char_traits<char>,std::Cr::allocator<char> > & const) ( text_recognition_dialog_view.cc:156 )
[ 12 ] bool base::TaskRunner::PostTaskAndReplyWithResult<std::Cr::vector<std::Cr::basic_string<char,std::Cr::char_traits<char>,std::Cr::allocator<char> >,std::Cr::allocator<std::Cr::basic_string<char,std::Cr::char_traits<char>,std::Cr::allocator<char> > > >,const std::Cr::vector<std::Cr::basic_string<char,std::Cr::char_traits<char>,std::Cr::allocator<char> >,std::Cr::allocator<std::Cr::basic_string<char,std::Cr::char_traits<char>,std::Cr::allocator<char> > > > &,base::OnceCallback,base::OnceCallback,void,void>(const class base::Location & const, class base::OnceCallback<std::Cr::vector<std::Cr::basic_string<char,std::Cr::char_traits<char>,std::Cr::allocator<char> >,std::Cr::allocator<std::Cr::basic_string<char,std::Cr::char_traits<char>,std::Cr::allocator<char> > > > ()>, class base::OnceCallback<void (const std::Cr::vector<std::Cr::basic_string<char,std::Cr::char_traits<char>,std::Cr::allocator<char> >,std::Cr::allocator<std::Cr::basic_string<char,std::Cr::char_traits<char>,std::Cr::allocator<char> > > > &)>) ( task_runner.h:163 )
[ 13 ] malloc ( allocator_shim_override_ucrt_symbols_win.h:71 )
[ 14 ] brave::ShowTextRecognitionDialog(content::WebContents *,SkBitmap const &) ( text_recognition_dialog_view.cc:88 )
[ 15 ] brave::ShowTextRecognitionDialog(content::WebContents *,SkBitmap const &) ( text_recognition_dialog_view.cc:87 )
[ 16 ] static void `anonymous namespace'::OnGetImageForTextCopy(class base::WeakPtr<content::WebContents>, const class SkBitmap & const) ( render_view_context_menu.cc:164 )
[ 17 ] static void base::internal::Invoker<base::internal::BindState<void (*)(base::WeakPtr<content::WebContents>, const SkBitmap &),base::WeakPtr<content::WebContents> >,void (const SkBitmap &)>::RunOnce(const class SkBitmap & const) ( bind_internal.h:971 )
[ 18 ] _tailMerge_esent.dll
[ 19 ] _tailMerge_esent.dll
[ 20 ] blink::mojom::LocalFrame_GetImageAt_ForwardToCallback::Accept(mojo::Message *) ( frame.mojom.cc:14490 )
[ 21 ] mojo::internal::MessageDispatchContext::MessageDispatchContext(mojo::Message *) ( message.cc:617 )
[ 22 ] mojo::InterfaceEndpointClient::HandleValidatedMessage(mojo::Message *) ( interface_endpoint_client.cc:1009 )
[ 23 ] _tailMerge_esent.dll
[ 24 ] blink::mojom::internal::LocalFrame_GetImageAt_ResponseParams_Data::Validate(void const *,mojo::internal::ValidationContext *) ( frame.mojom-shared.cc:4603 )
[ 25 ] static void * allocator_shim::internal::PartitionMalloc(const struct allocator_shim::AllocatorDispatch *, unsigned __int64, void *) ( allocator_shim_default_dispatch_to_partition_alloc.cc:302 )
[ 26 ] mojo::internal::ValidateResponseGeneric(mojo::Message *,char const *,base::span<std::Cr::pair<unsigned int,mojo::internal::GenericValidationInfo> const ,-1>) ( generated_code_util.cc:112 )
[ 27 ] _tailMerge_esent.dll
[ 28 ] mojo::InterfaceEndpointClient::HandleIncomingMessage(mojo::Message *) ( interface_endpoint_client.cc:695 )
[ 29 ] _tailMerge_esent.dll
  • STR
  1. Search blue jay bird at search.brave.com
  2. Scroll down and find below thumbnail and try to use Copy text form image for it
    image
@simonhong simonhong self-assigned this May 6, 2023
@simonhong simonhong added the crash label May 6, 2023
simonhong added a commit to brave/brave-core that referenced this issue May 6, 2023
fix brave/brave-browser#30178

In the view control, GetWidget() whould be called when it's added
to widget.
@stephendonner
Copy link

stephendonner commented May 6, 2023

Also crashes on macOS, latest beta: 8b2a0400-1cae-080a-0000-000000000000 (will update w/stack when I have it):

[ 00 ] absl::optional<gfx::Size>::operator bool() const ( optional.h:455 )
[ 01 ] views::View::GetPreferredSize() const ( view.cc:539 )
[ 02 ] TextRecognitionDialogView::AdjustWidgetSize() ( text_recognition_dialog_view.cc:253 )
[ 03 ] TextRecognitionDialogView::OnGetTextFromImage(std::Cr::vector<std::Cr::basic_string<char, std::Cr::char_traits<char>, std::Cr::allocator<char>>, std::Cr::allocator<std::Cr::basic_string<char, std::Cr::char_traits<char>, std::Cr::allocator<char>>>> const&) ( text_recognition_dialog_view.cc:212 )
[ 04 ] TextRecognitionDialogView::StartExtractingText(std::Cr::basic_string<char, std::Cr::char_traits<char>, std::Cr::allocator<char>> const&) ( text_recognition_dialog_view.cc:156 )
[ 05 ] TextRecognitionDialogView::TextRecognitionDialogView(SkBitmap const&) ( text_recognition_dialog_view.cc:142 )
[ 06 ] TextRecognitionDialogView::TextRecognitionDialogView(SkBitmap const&) ( text_recognition_dialog_view.cc:102 )
[ 07 ] brave::ShowTextRecognitionDialog(content::WebContents*, SkBitmap const&) ( text_recognition_dialog_view.cc:87 )
[ 08 ] (anonymous namespace)::OnGetImageForTextCopy(base::WeakPtr<content::WebContents>, SkBitmap const&) ( render_view_context_menu.cc:163 )
[ 09 ] base::OnceCallback<void (SkBitmap const&)>::Run(SkBitmap const&) && ( callback.h:152 )
[ 10 ] blink::mojom::LocalFrame_GetImageAt_ForwardToCallback::Accept(mojo::Message*) ( frame.mojom.cc:14853 )
[ 11 ] mojo::InterfaceEndpointClient::HandleValidatedMessage(mojo::Message*) ( interface_endpoint_client.cc:1009 )
[ 12 ] mojo::MessageDispatcher::Accept(mojo::Message*) ( message_dispatcher.cc:43 )
[ 13 ] mojo::InterfaceEndpointClient::HandleIncomingMessage(mojo::Message*) ( interface_endpoint_client.cc:695 )
[ 14 ] IPC::(anonymous namespace)::ChannelAssociatedGroupController::AcceptOnEndpointThread(mojo::Message) ( ipc_mojo_bootstrap.cc:1069 )
[ 15 ] void base::internal::FunctorTraits<void (IPC::(anonymous namespace)::ChannelAssociatedGroupController::*)(mojo::Message), void>::Invoke<void (IPC::(anonymous namespace)::ChannelAssociatedGroupController::*)(mojo::Message), scoped_refptr<IPC::(anonymous namespace)::ChannelAssociatedGroupController>, mojo::Message>(void (IPC::(anonymous namespace)::ChannelAssociatedGroupController::*)(mojo::Message), scoped_refptr<IPC::(anonymous namespace)::ChannelAssociatedGroupController>&&, mojo::Message&&) ( bind_internal.h:746 )
[ 16 ] void base::internal::InvokeHelper<false, void, 0ul, 1ul>::MakeItSo<void (IPC::(anonymous namespace)::ChannelAssociatedGroupController::*)(mojo::Message), std::Cr::tuple<scoped_refptr<IPC::(anonymous namespace)::ChannelAssociatedGroupController>, mojo::Message>>(void (IPC::(anonymous namespace)::ChannelAssociatedGroupController::*&&)(mojo::Message), std::Cr::tuple<scoped_refptr<IPC::(anonymous namespace)::ChannelAssociatedGroupController>, mojo::Message>&&) ( bind_internal.h:925 )
[ 17 ] void base::internal::Invoker<base::internal::BindState<void (IPC::(anonymous namespace)::ChannelAssociatedGroupController::*)(mojo::Message), scoped_refptr<IPC::(anonymous namespace)::ChannelAssociatedGroupController>, mojo::Message>, void ()>::RunImpl<void (IPC::(anonymous namespace)::ChannelAssociatedGroupController::*)(mojo::Message), std::Cr::tuple<scoped_refptr<IPC::(anonymous namespace)::ChannelAssociatedGroupController>, mojo::Message>, 0ul, 1ul>(void (IPC::(anonymous namespace)::ChannelAssociatedGroupController::*&&)(mojo::Message), std::Cr::tuple<scoped_refptr<IPC::(anonymous namespace)::ChannelAssociatedGroupController>, mojo::Message>&&, std::Cr::integer_sequence<unsigned long, 0ul, 1ul>) ( bind_internal.h:1020 )
[ 18 ] base::internal::Invoker<base::internal::BindState<void (IPC::(anonymous namespace)::ChannelAssociatedGroupController::*)(mojo::Message), scoped_refptr<IPC::(anonymous namespace)::ChannelAssociatedGroupController>, mojo::Message>, void ()>::RunOnce(base::internal::BindStateBase*) ( bind_internal.h:971 )
[ 19 ] base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*) ( callback.h:152 )
[ 20 ] base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() ( thread_controller_with_message_pump_impl.cc:341 )
[ 21 ] non-virtual thunk to base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() ( thread_controller_with_message_pump_impl.cc:0 )
[ 22 ] base::MessagePumpCFRunLoopBase::RunWork() ( message_pump_mac.mm:463 )
[ 23 ] invocation function for block in base::MessagePumpCFRunLoopBase::RunWorkSource(void*) ( message_pump_mac.mm:436 )
[ 24 ] base::mac::CallWithEHFrame(void () block_pointer)
[ 25 ] base::MessagePumpCFRunLoopBase::RunWorkSource(void*) ( message_pump_mac.mm:435 )
[ 26 ] 0x7fff2053bcdc
[ 27 ] 0x7fff2053bc44
[ 28 ] 0x7fff2053b9c4
[ 29 ] 0x7fff2053a3ec
[ 30 ] 0x7fff205399ac
[ 31 ] 0x7fff287831f3
[ 32 ] 0x7fff28782e26
[ 33 ] 0x7fff28782cf3
[ 34 ] 0x7fff22d42ad2
[ 35 ] 0x7fff22d412a5
[ 36 ] __71-[BrowserCrApplication nextEventMatchingMask:untilDate:inMode:dequeue:]_block_invoke ( chrome_browser_application_mac.mm:239 )
[ 37 ] base::mac::CallWithEHFrame(void () block_pointer)
[ 38 ] -[BrowserCrApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ( chrome_browser_application_mac.mm:238 )
[ 39 ] 0x7fff22d335c9
[ 40 ] base::MessagePumpNSApplication::DoRun(base::MessagePump::Delegate*) ( message_pump_mac.mm:833 )
[ 41 ] base::MessagePumpCFRunLoopBase::Run(base::MessagePump::Delegate*) ( message_pump_mac.mm:170 )
[ 42 ] base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta) ( thread_controller_with_message_pump_impl.cc:636 )
[ 43 ] non-virtual thunk to base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta) ( thread_controller_with_message_pump_impl.cc:0 )
[ 44 ] base::RunLoop::Run(base::Location const&) ( run_loop.cc:134 )
[ 45 ] content::BrowserMainLoop::RunMainMessageLoop() ( browser_main_loop.cc:1071 )
[ 46 ] content::BrowserMainRunnerImpl::Run() ( browser_main_runner_impl.cc:159 )
[ 47 ] content::BrowserMain(content::MainFunctionParams) ( browser_main.cc:32 )
[ 48 ] content::RunBrowserProcessMain(content::MainFunctionParams, content::ContentMainDelegate*) ( content_main_runner_impl.cc:702 )
[ 49 ] content::ContentMainRunnerImpl::RunBrowser(content::MainFunctionParams, bool) ( content_main_runner_impl.cc:1257 )
[ 50 ] content::ContentMainRunnerImpl::Run() ( content_main_runner_impl.cc:1111 )
[ 51 ] content::RunContentProcess(content::ContentMainParams, content::ContentMainRunner*) ( content_main.cc:326 )
[ 52 ] content::ContentMain(content::ContentMainParams) ( content_main.cc:343 )
[ 53 ] ChromeMain ( chrome_main.cc:198 )
[ 54 ] main ( chrome_exe_main_mac.cc:216 )
[ 55 ] 0x7fff2045ef3d

@simonhong simonhong changed the title Crash while using Copy text from image on Windows Crash while using Copy text from image May 6, 2023
@simonhong
Copy link
Member Author

Added OS/macOS OS/WindowOS as this Copy text from image is not available on linux now.

@kjozwiak
Copy link
Member

kjozwiak commented May 8, 2023

The above requires 1.52.92 or higher for 1.52.x verification 👍

@stephendonner
Copy link

Verified PASSED using

Brave 1.52.92 Chromium: 113.0.5672.92 (Official Build) beta (x86_64)
Revision b6f521170062a1fa8a82c33fb223b06fec566da1-refs/branch-heads/5672_63@{#10}
OS macOS Version 11.7.6 (Build 20G1231)

Steps:

  1. installed 1.52.92
  2. launched Brave
  3. searched for blue jay bird
  4. scrolled down on the results page at https://search.brave.com/search?q=blue+jay+bird&source=web
  5. context-clicked on the video
  6. chose Copy Text From Image

Confirmed no crash; encountered #30203

example example
Screen Shot 2023-05-09 at 9 30 54 AM Screen Shot 2023-05-09 at 9 31 02 AM

@MadhaviSeelam
Copy link

Verification PASSED using

Brave | 1.52.93 Chromium: 113.0.5672.92 (Official Build) beta (64-bit)
-- | --
Revision | b6f521170062a1fa8a82c33fb223b06fec566da1-refs/branch-heads/5672_63@{#10}
OS | Windows 11 Version 22H2 (Build 22621.1555)
  • Installed 1.52.93
  • launched Brave
  • navigated to search.brave.com in a new tab
  • searched for blue jay bird
  • right clicked on a thumbnail to open context menu
  • selected Copy Text From Image

Confirmed Brave no longer crashed and Text copy failed dialog is shown

encountered ##30203

example example
image image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment