Issue 34140 - Calc hangs when default printer is a not available network printer
Summary: Calc hangs when default printer is a not available network printer
Status: CLOSED DUPLICATE of issue 65739
Alias: None
Product: Calc
Classification: Application
Component: code (show other issues)
Version: 680m51
Hardware: All Windows, all
: P3 Trivial with 2 votes (vote)
Target Milestone: ---
Assignee: hdu@apache.org
QA Contact: issues@sc
URL:
Keywords:
: 36407 76216 (view as issue list)
Depends on: 65739
Blocks:
  Show dependency tree
 
Reported: 2004-09-13 23:37 UTC by andy_m
Modified: 2013-08-07 15:14 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
stack of the problematic call chain (10.29 KB, text/plain)
2006-05-24 08:21 UTC, hdu@apache.org
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description andy_m 2004-09-13 23:37:26 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.
Comment 1 stephan.wunderlich 2004-09-14 08:48:44 UTC
SW->TM: no api-issue, looks more like something in your area
Comment 2 thorsten.martens 2004-09-15 10:14:29 UTC
TM->SSA: Duplicate of bugtraq+ task #5025693.
Comment 3 stephan_schaefer 2004-09-16 09:25:58 UTC
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.
Comment 4 stephan_schaefer 2004-09-24 15:18:14 UTC
ssa->dv: please, have a look. A way to reproduce is also described in the
mentioned bugtraq+ task #5025693.
Comment 5 pjentsch 2004-10-26 09:07:50 UTC
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)
Comment 6 mci 2004-12-22 13:53:00 UTC
*** Issue 36407 has been marked as a duplicate of this issue. ***
Comment 7 dirk.voelzke 2005-04-15 09:46:39 UTC
dv->ssa: Back to you.
Comment 8 stephan_schaefer 2005-12-02 16:15:27 UTC
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.
Comment 9 stephan_schaefer 2005-12-02 16:18:29 UTC
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.
Comment 10 hdu@apache.org 2005-12-05 11:29:03 UTC
.
Comment 11 janderk 2006-04-12 12:11:23 UTC
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.
Comment 12 janderk 2006-04-12 12:13:04 UTC
Or should I open a new bug for this?
Comment 13 hdu@apache.org 2006-04-12 12:44:25 UTC
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...
Comment 14 caveman42 2006-05-22 13:30:32 UTC
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.
Comment 15 hdu@apache.org 2006-05-22 14:15:32 UTC
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.
Comment 16 caveman42 2006-05-22 14:54:37 UTC
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.)
Comment 17 hdu@apache.org 2006-05-22 15:55:38 UTC
Please test again with a recent version, e.g. 2.0.2 or 2.0.3 which will be
available really soon.
Comment 18 caveman42 2006-05-22 16:17:24 UTC
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. :)
Comment 19 hdu@apache.org 2006-05-23 11:56:23 UTC
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.
Comment 20 caveman42 2006-05-23 13:59:57 UTC
Sure, I'll have a crack. Feel free to send me the file.  :)
Comment 21 hdu@apache.org 2006-05-24 08:18:02 UTC
@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...
Comment 22 frank 2006-05-24 08:20:36 UTC
re-assigned
Comment 23 hdu@apache.org 2006-05-24 08:21:34 UTC
Created attachment 36690 [details]
stack of the problematic call chain
Comment 24 niklas.nebel 2006-05-24 11:12:37 UTC
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.
Comment 25 hdu@apache.org 2006-05-24 13:15:00 UTC
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 ***
Comment 26 user12 2006-06-06 11:03:51 UTC
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.
Comment 27 hdu@apache.org 2006-06-06 15:00:45 UTC
@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".
Comment 28 user12 2006-06-07 12:37:52 UTC
@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...
Comment 29 janderk 2006-06-07 13:01:03 UTC
@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.
Comment 30 hdu@apache.org 2006-06-07 13:14:31 UTC
@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.
Comment 31 user12 2006-06-07 13:42:59 UTC
@hdu: Provided that killoo.exe does not install anything permanently I certainly
would help.
Comment 32 janderk 2006-06-07 13:49:13 UTC
Sure. No problem. If you send it to me I will run the tool.
Comment 33 hdu@apache.org 2006-06-07 14:19:32 UTC
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".
Comment 34 hdu@apache.org 2006-07-12 14:56:58 UTC
No time to analyze these new incidents this month.
Retargeting...
Comment 35 manicmark 2007-01-11 13:09:08 UTC
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.
Comment 36 frank.meies 2007-01-11 14:02:19 UTC
FME: There is a setting "paper tray" in the page setup dialog. The value for the
setting is obtained from the printer...
Comment 37 piotrmajdak 2007-02-26 21:56:19 UTC
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?
Comment 38 kpalagin 2007-03-13 05:23:26 UTC
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.
Comment 39 p9w.vu.31122010 2007-04-10 16:56:29 UTC
*** Issue 76216 has been marked as a duplicate of this issue. ***
Comment 40 jbf.faure 2008-03-09 08:42:15 UTC
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.
Comment 41 hdu@apache.org 2008-06-03 09:13:56 UTC
Closing bug with the same root cause as issue 67839. I'll update that issues subject line to stress the 
importance.
Comment 42 jbf.faure 2008-06-03 09:53:15 UTC
Really ? issue 67839 is itself a duplicate. Perhaps did you mean issue 65739 ?
Comment 43 hdu@apache.org 2008-06-03 10:01:03 UTC
good catch: yes, its issue 65739