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

fix: printing crash when settings invalid #38165

Merged
merged 1 commit into from May 4, 2023
Merged

Conversation

codebytere
Copy link
Member

Description of Change

Fixes the following potential crash:

Stacktrace
[18342:0503/150402.720320:FATAL:struct_ptr.h(85)] Check failed: ptr_. 
0   Electron Framework                  0x000000011a5d6ae4 base::debug::CollectStackTrace(void**, unsigned long) + 28
1   Electron Framework                  0x000000011a5c6c7c base::debug::StackTrace::StackTrace() + 24
2   Electron Framework                  0x000000011a50f158 logging::LogMessage::~LogMessage() + 156
3   Electron Framework                  0x000000011a4fb45c logging::(anonymous namespace)::DCheckLogMessage::~DCheckLogMessage() + 60
4   Electron Framework                  0x000000011a4fb13c logging::CheckError::~CheckError() + 40
5   Electron Framework                  0x000000011a4fb16c logging::CheckError::~CheckError() + 12
6   Electron Framework                  0x000000011ee5c508 printing::PrintRenderFrameHelper::InitPrintSettings(bool, base::Value::Dict) + 412
7   Electron Framework                  0x000000011ee5acd4 printing::PrintRenderFrameHelper::CalculateNumberOfPages(blink::WebLocalFrame*, blink::WebNode const&, unsigned int*, base::Value::Dict) + 144
8   Electron Framework                  0x000000011ee54108 printing::PrintRenderFrameHelper::Print(blink::WebLocalFrame*, blink::WebNode const&, printing::PrintRenderFrameHelper::PrintRequestType, bool, base::Value::Dict) + 196
9   Electron Framework                  0x000000011ee54784 printing::PrintRenderFrameHelper::PrintRequestedPages(bool, base::Value::Dict) + 244
10  Electron Framework                  0x0000000119ecaa50 printing::mojom::PrintRenderFrameStubDispatch::Accept(printing::mojom::PrintRenderFrame*, mojo::Message*) + 268
11  Electron Framework                  0x000000011a8f6c80 mojo::InterfaceEndpointClient::HandleValidatedMessage(mojo::Message*) + 1200
12  Electron Framework                  0x000000011a8fcbc4 mojo::MessageDispatcher::Accept(mojo::Message*) + 148
13  Electron Framework                  0x000000011a8f8758 mojo::InterfaceEndpointClient::HandleIncomingMessage(mojo::Message*) + 100
14  Electron Framework                  0x000000011acee52c IPC::(anonymous namespace)::ChannelAssociatedGroupController::AcceptOnEndpointThread(mojo::Message) + 480
15  Electron Framework                  0x000000011a8faa00 base::internal::Invoker<base::internal::BindState<void (mojo::(anonymous namespace)::ThreadSafeInterfaceEndpointClientProxy::*)(mojo::Message), scoped_refptr<mojo::(anonymous namespace)::ThreadSafeInterfaceEndpointClientProxy>, mojo::Message>, void ()>::RunOnce(base::internal::BindStateBase*) + 84
16  Electron Framework                  0x000000011a55d814 base::TaskAnnotator::RunTaskImpl(base::PendingTask&) + 244
17  Electron Framework                  0x000000011a58491c base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*) + 1164
18  Electron Framework                  0x000000011a583f4c base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() + 104
19  Electron Framework                  0x000000011a5171e4 base::MessagePumpDefault::Run(base::MessagePump::Delegate*) + 152
20  Electron Framework                  0x000000011a58575c base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta) + 452
21  Electron Framework                  0x000000011a53d3d8 base::RunLoop::Run(base::Location const&) + 424
22  Electron Framework                  0x000000011eba94c0 content::RendererMain(content::MainFunctionParams) + 1456
23  Electron Framework                  0x0000000116352980 content::RunOtherNamedProcessTypeMain(std::Cr::basic_string<char, std::Cr::char_traits<char>, std::Cr::allocator<char>> const&, content::MainFunctionParams, content::ContentMainDelegate*) + 716
24  Electron Framework                  0x0000000116353738 content::ContentMainRunnerImpl::Run() + 764
25  Electron Framework                  0x0000000116351d10 content::RunContentProcess(content::ContentMainParams, content::ContentMainRunner*) + 1380
26  Electron Framework                  0x0000000116351f28 content::ContentMain(content::ContentMainParams) + 112
27  Electron Framework                  0x0000000116012d48 ElectronMain + 128
28  Electron Helper (Renderer)          0x0000000100fd8a00 main + 224
29  dyld                                0x00000001a5567f28 start + 2236
Task trace:
0   Electron Framework                  0x000000011acea458 IPC::(anonymous namespace)::ChannelAssociatedGroupController::Accept(mojo::Message*) + 820
Crash keys:
  "blink_scheduler_async_stack" = "0x11ACEA458 0x0"
  "renderer_foreground" = "false"
  "v8_ro_space_firstpage_address" = "0x348f00000000"
  "v8_isolate_address" = "0x148008000"
  "num-experiments" = "0"
  "platform" = "darwin"
  "process_type" = "renderer"
  "osarch" = "arm64"
  "pid" = "18342"
  "ptype" = "renderer"
Renderer process crashed - see https://www.electronjs.org/docs/tutorial/application-debugging for potential debugging information.

Checklist

Release Notes

Notes: Fixed a potential crash when calling webContents.print with invalid settings.

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/24-x-y PR should also be added to the "24-x-y" branch. target/25-x-y PR should also be added to the "25-x-y" branch. labels May 3, 2023
@codebytere codebytere requested a review from a team as a code owner May 3, 2023 13:04
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label May 3, 2023
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label May 4, 2023
@jkleinsc jkleinsc merged commit bb49016 into main May 4, 2023
16 checks passed
@jkleinsc jkleinsc deleted the fix-printing-crash branch May 4, 2023 13:10
@release-clerk
Copy link

release-clerk bot commented May 4, 2023

Release Notes Persisted

Fixed a potential crash when calling webContents.print with invalid settings.

@trop
Copy link
Contributor

trop bot commented May 4, 2023

I was unable to backport this PR to "24-x-y" cleanly;
you will need to perform this backport manually.

@trop trop bot added needs-manual-bp/24-x-y and removed target/24-x-y PR should also be added to the "24-x-y" branch. labels May 4, 2023
@trop
Copy link
Contributor

trop bot commented May 4, 2023

I was unable to backport this PR to "25-x-y" cleanly;
you will need to perform this backport manually.

@trop trop bot added needs-manual-bp/25-x-y and removed target/25-x-y PR should also be added to the "25-x-y" branch. labels May 4, 2023
@trop
Copy link
Contributor

trop bot commented May 9, 2023

@codebytere has manually backported this PR to "25-x-y", please check out #38230

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged/25-x-y PR was merged to the "25-x-y" branch. semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants