Apache OpenOffice (AOO) Bugzilla – Issue 34140
Calc hangs when default printer is a not available network printer
Last modified: 2013-08-07 15:14:21 UTC
When starting the main application and the default printer under windows is a network printer which isn't available at this moment (i.e. the computer with that printer is off), the main application hangs several minutes! (Yes minutes, not seconds) After that time of waiting, you can work with the whole openoffice with no further problems.
SW->TM: no api-issue, looks more like something in your area
TM->SSA: Duplicate of bugtraq+ task #5025693.
There are timeouts in system calls that we cannot circumvent. But of course it must be clarified that the user is notified as soon as possible, if a network printer is not available, i.e. after the very first system call that revealed the problem.
ssa->dv: please, have a look. A way to reproduce is also described in the mentioned bugtraq+ task #5025693.
We experienced timeouts even after the main application has started. Every time a document is loaded, openoffice hangs for a couple of seconds (about 20-30). (OpenOffice.org 1.1.2 on Windows XP)
*** Issue 36407 has been marked as a duplicate of this issue. ***
dv->ssa: Back to you.
ssa->hdu: not sure if we can do anything against it. afaik dv has already tried to track this down, but I think the outcome was that some API call just did not return.
ssa->hdu: may be the corresponding call must be issued within an own thread and we could provide a message to the user if he wants to continue to wait after a few seconds.
.
Would it be good idea to change the summary of this bug to: Checking the default printer at startup should happen in the background (thread). Many users experience slow Open Office startup times after booting due to this issue. By checking in a background thread users can start working immediately and the open office startup time perception would be much better.
Or should I open a new bug for this?
Well, it is not that easy... When opening an application like Writer without opening any documents the availability of the printer shouldn't make a difference. Since the Writer default for layouting was changed from "use printer metrics" to "use generic metrics" even before at least OOo2.0, I doubt that the problem still exists. I haven't been able to reproduce it with a recent version. When opening documents which are formatted with "use printer metrics" access to the printer is really needed. For Writer documents this is the case if checkbox "use printer metrics" in the dialog "Tools->Options->Writer->Compatibility" is checked. This usually happens for older documents from e.g. OOo 1.x. So now the situation can be summarized as: - if the printer is not needed the problem isn't there anymore - if the printer metrics are really needed there is no point to put the printer access into a separate thread because one has to wait anyway...
Just thought I'd add that I'm also getting the slow startup, but my issue is only with Calc (Open Office 2.0.2) In Writer, my documents open straight away, but in Calc, my documents access the network for about 30 seconds (the size of the spreadsheet doesn't seem to matter) before opening the document. The printer is available, but Calc seems to want to have a chat with it before letting me work on the spreadsheet. If I stop the Print Spooler service in Windows, my spreadsheets will open immediately.
When opening one of your Calc documents which has the problem please have a look at the dialog Tools->Options->Calc->General->"Use printer metrics for formatting". I'm quite sure that this checkbox is enabled for the document.
Thanks, hdu. That doesn't seem to be the problem, though. That option is unchecked. The problem also occurs if I create a new spreadsheet from the start menu, so it doesn't seem to be a problem with any particular spreadsheet, either. (any new document I create has that option unchecked as well.)
Please test again with a recent version, e.g. 2.0.2 or 2.0.3 which will be available really soon.
I'm using 2.0.2 now. (I'm not game to use a snapshot build.) I'll test again when 2.0.3 comes out and post back here then. :)
I haven't been able to reproduce the problem here, but I'd like to debug it anyway: Is someone who is experiencing the problem willing to kill OOo during the hang? I would send the volunteers a special "kill.exe" by mail. Running "kill.exe -NULL soffice.bin" during the hang will crash OOo and the resulting crashreport would help me to isolate the problem.
Sure, I'll have a crack. Feel free to send me the file. :)
@caveman42: Thank you very much for volunteering and the submitting the results! @sab: what do you need a printer for when "Use printer metrics for formatting" is disabled? For details please have a look at the reportids 1683672 and 1683649. I'll also attach a stack that shows that SvXMLUnitConverter indirectly requests a SfxPrinter...
re-assigned
Created attachment 36690 [details] stack of the problematic call chain
The stack shows that the printer is created when the "PrinterSetup" settings are loaded. That's intended behavior. Also, "Use printer metrics for formatting" affects screen display only. Text width calculation (done in background) uses the printer anyway.
I submitted a followup issue 65739 for the root cause of the problem here. Calc uses printer metrics for layouting even when the similarly named checkbox is disabled. Does anyone experience these "printer hangs" with applications other than Calc? As far as I know the answer is no. The remaining problem, that applications which depend on getting information from printer do not continue to work when the platform's printer subsystem hangs when when answering these requests for info, can only be solved in the application layers. They should fall back to printer independent formatting in these cases. *** This issue has been marked as a duplicate of 65739 ***
My experiences are: 1. Writer and Calc are affected; 2. OO doesn't care for the standard printer set in the windows enviroment (I use win2000 SP4) but remembers the last printer used within an OO application on startup and hangs if this is a network printer and not available; 3. This is a very annoying bug around since quite some time (OO 1.1.2, SO 5.6 if I remember correctly); I am currently using OO 2.0.2.
@user12: When opening a Writer document that has this problem, then please have a look at this checkbox: Tools->Options->Writer->Compatibility->"Use printer metrics for formatting".
@hdu: I double checked: that checkbox is definitely switched off. I made the following tests: 1) saved a write document (checkbox switched off) with printer setup for a network printer. Shut the network down at the server side (suse 9.1 samba server). Tried to load the write document: hang of several minutes. Made the same trial with server side network up: no delay. I think your assumption that the compatiblity checkbox unchecked prevents OO writer from accessing the printer at startup time is wrong. Writer *and* Calc seem to have the same bug. I think these are in fact two bugs: 1) printers should not be accessed unless really necessary; 2) if non available printers are accessed the resulting delay (caused by ms API-calls) should be notified to the user with the choice of aborting the operation. BTW, you also get the minute hang, if you try to open the printer setup dialog, if the non available printer is currently selected. So in fact you get a punishment twice, if you try to correct the situation locally. Room for improvements...
@hdu:I double checked too. The "Use printer metrics for formatting" option is switched off on the computer that takes 50 seconds the first time Writer 2.0.2 is started (secondary starts take less than 10 seconds) and when printing the first time after booting.
@user12 @janderk: Would one of you two volunteer to crash Writer while it is hanging? I'd send you a special "killoo.exe" by mail. The resulting crashreport would help me to isolate the problem with Writer.
@hdu: Provided that killoo.exe does not install anything permanently I certainly would help.
Sure. No problem. If you send it to me I will run the tool.
Thanks. I sent the tool to both of you and look forward to the reports. @janderk: the first start is probably not the issue here, but the hang "when printing the first time after booting".
No time to analyze these new incidents this month. Retargeting...
A similar problem is still present in ooo 2.1 Writer. On XP there is a delay of several seconds when the printer is unavailable and: - open the 'page setup' dialog - open the 'change paragraph style' dialog - switch between tabs in the above dialogs (the first time a tab is selected; only on certain tabs like page, font) The option 'use printer metrics' is unchecked.
FME: There is a setting "paper tray" in the page setup dialog. The value for the setting is obtained from the printer...
I just saw that this issue is resolved because of being a duplicate of #65739. I don't think that this is correct: #65739 looks like a cosmetic problem only, however, this issue is a really annoying bug. Maybe you want to change the status?
piotrmajdak, do you see the problem with long startup time when default printer? I can't repro this problem. Please provide step by step case if you experience the symptoms described by this issue.
*** Issue 76216 has been marked as a duplicate of this issue. ***
I have the same problem (see also #76216) on my laptop (Kubuntu 6.06 FR) : - printers are managed by the office network - at home it is connected to Internet but I do not have printer Step to reproduce at home : 1. launch OOo by double-clicking on some ODF file in konqueror, for example ODT or ODP file 2. OOo takes seconds to open the file and it is possible to scoll through the file, modify and save it without problem 3. now right click on some word in the file and choose an item in context menu, for example "Edit paragraph style" : OOo-writer hangs during around 3 minutes before it displays the dialog. Subsequent calls for format dialog does not hang OOo. option "Use printer metrics for formatting" is not checked. 4. If I do same steps before having started my Internet connection, OOo-writer does not hang.
Closing bug with the same root cause as issue 67839. I'll update that issues subject line to stress the importance.
Really ? issue 67839 is itself a duplicate. Perhaps did you mean issue 65739 ?
good catch: yes, its issue 65739