New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 122996 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2012
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 1
Type: Bug

Restricted
  • Only users with EditIssue permission may comment.



Sign in to add a comment

Google Cloud Print Crashes with Remote Desktop Viewer

Reported by shamuge...@gmail.com, Apr 11 2012

Issue description

Chrome Version       : 19.0.1084.15
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
URLs (if applicable) :
Other browsers tested:
 Not Applicable 

What steps will reproduce the problem?
1. Set up Google Cloud Print
2. Remote into computer with Google Chrome running and Cloud print enabled. 
3.

What is the expected result? Cloud print should just work.


What happens instead? I get a dialog after I close the Remote Desktop Connection that says the Google Cloud Print Connector process has crashed, would you like to restart?


Please provide any additional information below. Attach a screenshot if
possible.

It does it consistantly every time I disconnect from a remote desktop connection to my computer.

UserAgentString: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.15 Safari/536.5



 
Capture.JPG
16.5 KB View Download
Cc: kdlucas@chromium.org
Labels: -Area-Undefined Area-Internals Feature-CloudPrint
Labels: Feature-Printing
Owner: abodenha@chromium.org
Status: Assigned
Labels: -Pri-2 Pri-1 Mstone-20
I'm able to repro with 18.0.1025.152 m on Win 7.

I'm looking into the cause now. Hopefully it's something simple to fix so we can merge it to M19.
Status: Started
Current working hypothesis:  Remote Desktop injects printers into the machine you're logged into.  When you disconnect those printers go away, rather ungracefully.

Ideally, the connector should just skip over those printers.  Barring that we should handle it when they go away.
abodenha I think you are correct. When I connected with an RDP client for iPhone it didn't crash. The computer I have been connecting from does have printers on it. 
Yep, if I connect from a machine that has no printers it's all good.  I managed to get a debugger attached to the crash.  Call stack:


 	chrome.dll!PrinterJobHandler::OnReceivePrinterCaps(bool succeeded, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & printer_name, const printing::PrinterCapsAndDefaults & caps_and_defaults)  Line 185 + 0x20 bytes	C++
 	chrome.dll!base::internal::RunnableAdapter<void (__thiscall PrinterJobHandler::*)(bool,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,printing::PrinterCapsAndDefaults const &)>::Run(PrinterJobHandler * object, const bool & a1, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & a2, const printing::PrinterCapsAndDefaults & a3)  Line 309 + 0x3e bytes	C++
 	chrome.dll!base::internal::InvokeHelper<0,void,base::internal::RunnableAdapter<void (__thiscall PrinterJobHandler::*)(bool,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,printing::PrinterCapsAndDefaults const &)>,void __cdecl(PrinterJobHandler *,bool const &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,printing::PrinterCapsAndDefaults const &)>::MakeItSo(base::internal::RunnableAdapter<void (__thiscall PrinterJobHandler::*)(bool,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,printing::PrinterCapsAndDefaults const &)> runnable, PrinterJobHandler * a1, const bool & a2, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & a3, const printing::PrinterCapsAndDefaults & a4)  Line 958	C++
 	chrome.dll!base::internal::Invoker<1,base::internal::BindState<base::internal::RunnableAdapter<void (__thiscall PrinterJobHandler::*)(bool,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,printing::PrinterCapsAndDefaults const &)>,void __cdecl(PrinterJobHandler *,bool,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,printing::PrinterCapsAndDefaults const &),void __cdecl(base::internal::UnretainedWrapper<PrinterJobHandler>)>,void __cdecl(PrinterJobHandler *,bool,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,printing::PrinterCapsAndDefaults const &)>::Run(base::internal::BindStateBase * base, const bool & x2, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & x3, const printing::PrinterCapsAndDefaults & x4)  Line 1455 + 0x46 bytes	C++
 	chrome.dll!base::Callback<void __cdecl(bool,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,printing::PrinterCapsAndDefaults const &)>::Run(const bool & a1, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & a2, const printing::PrinterCapsAndDefaults & a3)  Line 398 + 0x35 bytes	C++
>	chrome.dll!cloud_print::PrintSystemWin::PrinterCapsHandler::OnGetPrinterCapsAndDefaultsFailed(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & printer_name)  Line 688	C++
 	chrome.dll!base::internal::RunnableAdapter<void (__thiscall ServiceUtilityProcessHost::Client::*)(std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &)>::Run(ServiceUtilityProcessHost::Client * object, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & a1)  Line 188 + 0x21 bytes	C++
 	chrome.dll!base::internal::InvokeHelper<0,void,base::internal::RunnableAdapter<void (__thiscall ServiceUtilityProcessHost::Client::*)(std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &)>,void __cdecl(ServiceUtilityProcessHost::Client * const &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &)>::MakeItSo(base::internal::RunnableAdapter<void (__thiscall ServiceUtilityProcessHost::Client::*)(std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &)> runnable, ServiceUtilityProcessHost::Client * const & a1, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & a2)  Line 897	C++
 	chrome.dll!base::internal::Invoker<2,base::internal::BindState<base::internal::RunnableAdapter<void (__thiscall ServiceUtilityProcessHost::Client::*)(std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &)>,void __cdecl(ServiceUtilityProcessHost::Client *,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &),void __cdecl(ServiceUtilityProcessHost::Client *,std::basic_string<char,std::char_traits<char>,std::allocator<char> >)>,void __cdecl(ServiceUtilityProcessHost::Client *,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &)>::Run(base::internal::BindStateBase * base)  Line 1254 + 0x2a bytes	C++
 	chrome.dll!base::Callback<void __cdecl(void)>::Run()  Line 272 + 0xe bytes	C++
 	chrome.dll!MessageLoop::RunTask(const base::PendingTask & pending_task)  Line 460	C++
 	chrome.dll!MessageLoop::DeferOrRunPendingTask(const base::PendingTask & pending_task)  Line 473	C++
 	chrome.dll!MessageLoop::DoWork()  Line 647 + 0xc bytes	C++
 	chrome.dll!base::MessagePumpDefault::Run(base::MessagePump::Delegate * delegate)  Line 28 + 0xf bytes	C++
 	chrome.dll!MessageLoop::RunInternal()  Line 417 + 0x29 bytes	C++
 	chrome.dll!MessageLoop::RunHandler()  Line 391	C++
 	chrome.dll!MessageLoop::Run()  Line 301	C++
 	chrome.dll!base::Thread::Run(MessageLoop * message_loop)  Line 127	C++
 	chrome.dll!base::Thread::ThreadMain()  Line 161 + 0x16 bytes	C++
 	chrome.dll!base::`anonymous namespace'::ThreadFunc(void * params)  Line 58 + 0xf bytes	C++

Looks like we're getting a printer caps failed event for a printer that's already been removed.

I have a fix in the works.

A workaround:
If connecting from Windows:
When connecting to the machine via RDP hit "options" and then "local resources".  Under "Local devices and resources" make sure "printers" is NOT checked.

If connecting from a Mac:
RDC -> Prefereces
Hit the "printers" tab
Uncheck "Use a printer that is connected to the Mac"

Other platforms: Whatever client you use there should be SOME way to tell it NOT to share local printers with the machine you're connecting to.  If you do that it should prevent the crash.
Project Member

Comment 8 by bugdroid1@chromium.org, Apr 13 2012

The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=132283

------------------------------------------------------------------------
r132283 | abodenha@chromium.org | Fri Apr 13 15:35:10 PDT 2012

Changed paths:
 M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/service/cloud_print/printer_job_handler.cc?r1=132283&r2=132282&pathrev=132283
 M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/service/cloud_print/printer_job_handler.h?r1=132283&r2=132282&pathrev=132283

Fix a crash if GetPrinterCapsAndDefaults returns after the calling printer is deleted.
There was a crash when disconnecting from a machine via Windows RDP.  RDP injects client machine printers into the host machine.  GetPrinterCapsAndDefaults blocks on these printers.  When the user disconnects, the printer is deleted and then GetPrinterCapsAndDefaults returns.  The failure handler fires and attempts to access the now-freed PrinterJobHandler that was passed with the callback resulting in a crash.

The solution is to pass a WeakPtr to the callback so that if the PrinterJobHandler is destroyed the
callback wont fire.

BUG= 122996 
TEST=Verify bug.


Review URL: http://codereview.chromium.org/10079017
------------------------------------------------------------------------
Status: Fixed
Labels: -Mstone-20 Mstone-19 Merge-Requested
The change is pretty safe.  I'd like to pick it up for 19.

Comment 11 by laforge@google.com, Apr 18 2012

Labels: -Merge-Requested Merge-Approved
Project Member

Comment 12 by bugdroid1@chromium.org, Apr 18 2012

Labels: merge-merged-1084
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=132832

------------------------------------------------------------------------
r132832 | abodenha@chromium.org | Wed Apr 18 11:48:01 PDT 2012

Changed paths:
 M http://src.chromium.org/viewvc/chrome/branches/1084/src/chrome/service/cloud_print/printer_job_handler.h?r1=132832&r2=132831&pathrev=132832
 M http://src.chromium.org/viewvc/chrome/branches/1084/src/chrome/service/cloud_print/printer_job_handler.cc?r1=132832&r2=132831&pathrev=132832

Merge 132283 - Fix a crash if GetPrinterCapsAndDefaults returns after the calling printer is deleted.
There was a crash when disconnecting from a machine via Windows RDP.  RDP injects client machine printers into the host machine.  GetPrinterCapsAndDefaults blocks on these printers.  When the user disconnects, the printer is deleted and then GetPrinterCapsAndDefaults returns.  The failure handler fires and attempts to access the now-freed PrinterJobHandler that was passed with the callback resulting in a crash.

The solution is to pass a WeakPtr to the callback so that if the PrinterJobHandler is destroyed the
callback wont fire.

BUG= 122996 
TEST=Verify bug.


Review URL: http://codereview.chromium.org/10079017

TBR=abodenha@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10021067
------------------------------------------------------------------------
Labels: -Merge-Approved Merge-Merged
More detailed repro steps:

1: Connect a printer to your local machine.
2: Use RDP to connect to a remote machine.
3: Check printer settings on the remote machine.  Verify that the printer on your local machine is available on the remote machine.
4: Start chrome and enable the cloud print connector via the wrench menu.
5: Disconnect the RDP session.
6: Reconnect the RDP session.

Expected:
No problems

Actual:
An error message displays saying that the cloud print connector has crashed.
Project Member

Comment 15 by bugdroid1@chromium.org, Oct 13 2012

Labels: Restrict-AddIssueComment-Commit
This issue has been closed for some time. No one will pay attention to new comments.
If you are seeing this bug or have new data, please click New Issue to start a new bug.
Project Member

Comment 16 by bugdroid1@chromium.org, Mar 10 2013

Labels: -Area-Internals -Feature-CloudPrint -Feature-Printing -Mstone-19 M-19 Cr-Internals Cr-Services-CloudPrint Cr-Internals-Printing
Project Member

Comment 17 by bugdroid1@chromium.org, Mar 13 2013

Labels: -Restrict-AddIssueComment-Commit Restrict-AddIssueComment-EditIssue

Sign in to add a comment