Issue 13031 - Application hangs if I try to print to a printer which is not set as default on RedHat 6.2
Summary: Application hangs if I try to print to a printer which is not set as default ...
Status: CLOSED FIXED
Alias: None
Product: gsl
Classification: Code
Component: code (show other issues)
Version: OOo 1.0.3
Hardware: PC Linux, all
: P2 Trivial (vote)
Target Milestone: OOo 1.0.4
Assignee: robert.kinsella
QA Contact: issues@gsl
URL:
Keywords:
: 8627 13364 13403 13438 13490 13513 13525 13526 13547 13559 13646 13668 13855 15817 (view as issue list)
Depends on:
Blocks:
 
Reported: 2003-04-04 12:06 UTC by robert.kinsella
Modified: 2003-06-30 11:52 UTC (History)
7 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description robert.kinsella 2003-04-04 12:06:58 UTC
OpenOffice.org 1.0.3 (builda) Linux RedHat6.2

User cannot print documents from OO.org, when user selects OK in the print
dialog OO.org appears to hang.

I have tested print with OO.org 1.0.1 and 1.0.2 on the same system with the same
user and there appears to be no problems, i.e. print works for these versions of
OO.org. It would appear that it is a problem with print in OO.org 1.0.3, but
maybe it is my print setup ??. Can anyone else recreate this error??.

A workaround for the problem is to print to a file and then from the command
line issue lpr -P printer filename.
Comment 1 robert.kinsella 2003-04-04 13:52:09 UTC
On RedHat8.0 using the same type of printer setup, I cannot reproduce
this error. Also Martin Hollmichel reported that he can print on Suse
8.1 with OO.org 1.0.3. This issue appears to be specific to RH6.2,
downgrading priority as per guidelines. Setting target milestone to 1.0.4.
Comment 2 Martin Hollmichel 2003-04-04 14:52:01 UTC
joost reported this running on a Redhat 6.2 system, so I would like to
declare this is a non stopper, nonetheless reassigning to robert for
further investigation.
Comment 3 robert.kinsella 2003-04-07 12:01:49 UTC
after configuring the generic printer properties using spadmin, found
that OO.org 1.0.3 successfully prints a document, when using the
generic printer choice. If the user uses any other listed printers,
OO.org hangs.  
Comment 4 Joost Andrae 2003-04-08 10:53:47 UTC
JA: old title: cannot print files using non generic printer
JA: changed priority from P3 to P2
JA: If I configure two printers and set one printer as default printer
but print on the printer which is not configured as default printer
then the application hangs. This was reproducible by me on RedHat 6.2
with OOo 1.03. With OOo 1.02 this wasn't reproducible.
JA->PL: you can find a RH 6.2 installation at MRU. Reassigned this
issue to you
Comment 5 Unknown 2003-04-11 15:40:04 UTC
This also happens under windows (tom@alterworld.net) in 1.0.3
Comment 6 richard.holt 2003-04-13 03:01:14 UTC
I see the same behavior on Mdk 8.2, kernel 2.4.18. 

Printing to non-generic printer locks the app. 

Printing to generic printer doesn't lock but neither does it print. 

I think this should be a blocking issue. 
Comment 7 Martin Hollmichel 2003-04-13 08:16:26 UTC
mh->ja: do we have similar behaviour in SO ?
Comment 8 andreschnabel 2003-04-14 21:44:25 UTC
I'm just about to test the german 1.0.3 rc for windows (XP).

OOo crashes with an unrecoverable error, when I try to print to any
printer that is not the system's default printer!

Can you verify if this is the same issue and set OS to all?

Andre
Comment 9 christof.pintaske 2003-04-15 09:15:48 UTC
can someone provide a stacktrace of the hanging application ?
Comment 10 Joost Andrae 2003-04-15 11:27:18 UTC
JA: here you are...

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (runnable)]
0x405b12b0 in rtl_freeMemory () from
/home/qs1/OpenOffice.org1.0.3/program/libsal.so.3
(gdb) where
#0  0x405b12b0 in rtl_freeMemory () from
/home/qs1/OpenOffice.org1.0.3/program/libsal.so.3
#1  0x4029788f in Printer::ImplInit(SalPrinterQueueInfo*) ()
   from /home/qs1/OpenOffice.org1.0.3/program/libvcl641li.so
#2  0x40299cbf in Printer::SetPrinterProps(Printer const*) ()
   from /home/qs1/OpenOffice.org1.0.3/program/libvcl641li.so
#3  0x431260d6 in PrintDialog::Execute() () from
/home/qs1/OpenOffice.org1.0.3/program/libsvt641li.so
#4  0x429a0680 in SfxViewShell::ExecPrint_Impl(SfxRequest&) ()
   from /home/qs1/OpenOffice.org1.0.3/program/libsfx641li.so
#5  0x4299ae0d in SfxStubSfxViewShellExecPrint_Impl(SfxShell*,
SfxRequest&) ()
   from /home/qs1/OpenOffice.org1.0.3/program/libsfx641li.so
#6  0x429d281b in SfxShell::ExecuteSlot(SfxRequest&, SfxInterface
const*) ()
   from /home/qs1/OpenOffice.org1.0.3/program/libsfx641li.so
#7  0x44868855 in SwView::ExecutePrint(SfxRequest&) ()
   from /home/qs1/OpenOffice.org1.0.3/program/libsw641li.so
#8  0x448460cd in SfxStubSwViewExecutePrint(SfxShell*, SfxRequest&) ()
   from /home/qs1/OpenOffice.org1.0.3/program/libsw641li.so
#9  0x429c5670 in SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&,
SfxRequest&, unsigned char) ()
   from /home/qs1/OpenOffice.org1.0.3/program/libsfx641li.so
#10 0x429c7dea in SfxDispatcher::PostMsgHandler(SfxRequest*) ()
   from /home/qs1/OpenOffice.org1.0.3/program/libsfx641li.so
#11 0x429c7d1d in SfxDispatcher::LinkStubPostMsgHandler(void*, void*) ()
   from /home/qs1/OpenOffice.org1.0.3/program/libsfx641li.so
#12 0x429e389f in SfxHintPoster::Event(SfxHint*) ()
   from /home/qs1/OpenOffice.org1.0.3/program/libsfx641li.so
#13 0x429e3843 in SfxHintPoster::LinkStubDoEvent_Impl(void*, void*) ()
   from /home/qs1/OpenOffice.org1.0.3/program/libsfx641li.so
#14 0x402f8612 in ImplHandleUserEvent(ImplSVEvent*) ()
   from /home/qs1/OpenOffice.org1.0.3/program/libvcl641li.so
#15 0x402f8d69 in ImplWindowFrameProc(void*, SalFrame*, unsigned
short, void const*) ()
   from /home/qs1/OpenOffice.org1.0.3/program/libvcl641li.so
#16 0x4034cd53 in
SalFrameData::HandleClientMessage(XClientMessageEvent*) ()
   from /home/qs1/OpenOffice.org1.0.3/program/libvcl641li.so
#17 0x4034d44a in SalFrameData::Dispatch(_XEvent*) ()
   from /home/qs1/OpenOffice.org1.0.3/program/libvcl641li.so
#18 0x40370341 in SalDisplay::Dispatch(_XEvent*) ()
   from /home/qs1/OpenOffice.org1.0.3/program/libvcl641li.so
#19 0x4037009f in SalDisplay::Yield(unsigned char) ()
   from /home/qs1/OpenOffice.org1.0.3/program/libvcl641li.so
#20 0x4036bec5 in DisplayYield(int, SalDisplay*) ()
   from /home/qs1/OpenOffice.org1.0.3/program/libvcl641li.so
#21 0x4036a779 in SalXLib::Yield(unsigned char) ()
   from /home/qs1/OpenOffice.org1.0.3/program/libvcl641li.so
#22 0x4037333c in SalInstance::Yield(unsigned char) ()
   from /home/qs1/OpenOffice.org1.0.3/program/libvcl641li.so
#23 0x402064dd in Application::Yield() () from
/home/qs1/OpenOffice.org1.0.3/program/libvcl641li.so
#24 0x40206415 in Application::Execute() () from
/home/qs1/OpenOffice.org1.0.3/program/libvcl641li.so
#25 0x080600b7 in Desktop::Main() ()
#26 0x40208b17 in SVMain() () from
/home/qs1/OpenOffice.org1.0.3/program/libvcl641li.so
#27 0x403696ca in main () from
/home/qs1/OpenOffice.org1.0.3/program/libvcl641li.so
#28 0x40b289cb in __libc_start_main (main=0x8059b2c <main>, argc=1,
argv=0xbffff5b4, 
    init=0x8058c0c <_init>, fini=0x8077ce4 <_fini>,
rtld_fini=0x4000ae60 <_dl_fini>, 
    stack_end=0xbffff5ac) at ../sysdeps/generic/libc-start.c:92


(gdb) info threads
  10 Thread 8201 (runnable)  0x00000000 in ?? ()
  9 Thread 7176 (runnable)  0x00000000 in ?? ()
  8 Thread 6151 (runnable)  0x40bbbf50 in __poll (fds=0xbedffbf4,
nfds=1, timeout=1000)
    at ../sysdeps/unix/sysv/linux/poll.c:45
  7 Thread 5126 (runnable)  0x40ba1c61 in __libc_nanosleep () from
/lib/libc.so.6
  6 Thread 4101 (runnable)  0x40b2edeb in __sigsuspend (set=0xbf1ffc18)
    at ../sysdeps/unix/sysv/linux/sigsuspend.c:48
  5 Thread 3076 (runnable)  0x40bc2a02 in __libc_accept () from
/lib/libc.so.6
  4 Thread 2051 (runnable)  0x40ba1c61 in __libc_nanosleep () from
/lib/libc.so.6
  3 Thread 1026 (runnable)  0x40bbbf50 in __poll (fds=0x40d22e78,
nfds=1, timeout=400)
    at ../sysdeps/unix/sysv/linux/poll.c:45
  2 Thread 2049 (runnable)  0x40bbbf50 in __poll (fds=0x8091014,
nfds=1, timeout=2000)
    at ../sysdeps/unix/sysv/linux/poll.c:45
* 1 Thread 1024 (runnable)  0x405b12b0 in rtl_freeMemory ()
   from /home/qs1/OpenOffice.org1.0.3/program/libsal.so.3
Comment 11 khendricks 2003-04-15 14:34:59 UTC
Hi, 
 
We seem to be using free on an address that could be created by new? 
 
Is that right? 
 
From vcl/source/gdi/jobset.cxx here we use new to create a Byte Array for the  
mpDriverData field. 
 
ImplJobSetup::ImplJobSetup( const ImplJobSetup& rJobSetup ) : 
        maPrinterName( rJobSetup.maPrinterName ), 
        maDriver( rJobSetup.maDriver ) 
{ 
        mnRefCount                      = 1; 
        mnSystem                        = rJobSetup.mnSystem; 
        meOrientation           = rJobSetup.meOrientation; 
        mnPaperBin                      = rJobSetup.mnPaperBin; 
        mePaperFormat           = rJobSetup.mePaperFormat; 
        mnPaperWidth            = rJobSetup.mnPaperWidth; 
        mnPaperHeight           = rJobSetup.mnPaperHeight; 
        mnDriverDataLen         = rJobSetup.mnDriverDataLen; 
        if ( rJobSetup.mpDriverData ) 
        { 
                mpDriverData = new BYTE[mnDriverDataLen]; 
                memcpy( mpDriverData, rJobSetup.mpDriverData, mnDriverDataLen ); 
        } 
        else 
                mpDriverData = NULL; 
 
 
But in vcl/source/gdi/print.cxx  in Printer::ImplInit we do the following: 
 
       // Testen, ob Treiber ueberhaupt mit dem JobSetup uebereinstimmt 
        ImplJobSetup* pJobSetup = maJobSetup.ImplGetData(); 
 
        if ( pJobSetup->mpDriverData ) 
        { 
                if ( (pJobSetup->maPrinterName != pInfo->maPrinterName) || 
                         (pJobSetup->maDriver != pInfo->maDriver) ) 
                { 
                        rtl_freeMemory( pJobSetup->mpDriverData ); 
                        pJobSetup->mpDriverData = NULL; 
                        pJobSetup->mnDriverDataLen = 0; 
                } 
        } 
 
 
So aren't we mixing new and free and should we be using an array delete[] here? 
 
What am I missing? 
 
Kevin 
 
 
 
Comment 12 philipp.lohmann 2003-04-15 15:03:44 UTC
fixed an allocator/deallocator mismatch
Comment 13 philipp.lohmann 2003-04-15 15:07:12 UTC
pl->rkinsella: there is a new version of gsl/vcl/source/gdi/print.cxx
on OOO_STABLE_1 (rev 1.24.4.5), please update

pl->kevin: you nailed it
Comment 14 philipp.lohmann 2003-04-15 15:08:53 UTC
sorry, the revision is of course 1.24.4.6; i'm an idiot
Comment 15 dnwilson 2003-04-16 01:13:18 UTC
will you be able to release the updated program component or will have to wait for 
1.0.4 ? 
Comment 16 wouter 2003-04-17 00:34:19 UTC
Just FYI - same crash, complete freeze with 'OK' button pressed down
in printing dialog, on a slackware linux 8.0 system.

Is this worthy of a re-release? When is 1.0.4 due?
Comment 17 fa 2003-04-17 00:41:51 UTC
I fixed this issue in PORTS a _long_ time ago as it was crashing the OS X builds as far
back as October 2002.  Has it just appeared for Linux, or did something regress?

http://porting.openoffice.org/issues/show_bug.cgi?id=7453

We had discussed this in the mailing list too and someone said that a bunch of
allocator/deallocator mismatches had been fixed but I guess this one slipped
through.

Dan
Comment 18 fa 2003-04-17 00:46:14 UTC
Further comments in this issue.  We've been here before.

http://porting.openoffice.org/issues/show_bug.cgi?id=8012

Dan
Comment 19 philipp.lohmann 2003-04-17 14:05:06 UTC
*** Issue 13547 has been marked as a duplicate of this issue. ***
Comment 20 philipp.lohmann 2003-04-17 14:06:18 UTC
*** Issue 13547 has been marked as a duplicate of this issue. ***
Comment 21 lohmaier 2003-04-18 22:13:50 UTC
*** Issue 13364 has been marked as a duplicate of this issue. ***
Comment 22 lohmaier 2003-04-18 22:16:52 UTC
*** Issue 13403 has been marked as a duplicate of this issue. ***
Comment 23 lohmaier 2003-04-18 22:20:29 UTC
*** Issue 13438 has been marked as a duplicate of this issue. ***
Comment 24 lohmaier 2003-04-18 22:26:56 UTC
*** Issue 13490 has been marked as a duplicate of this issue. ***
Comment 25 lohmaier 2003-04-18 22:37:30 UTC
*** Issue 13526 has been marked as a duplicate of this issue. ***
Comment 26 lohmaier 2003-04-18 22:38:58 UTC
*** Issue 13559 has been marked as a duplicate of this issue. ***
Comment 27 robert.kinsella 2003-04-28 10:58:41 UTC
fixed in build 1.0.3.1 - tested on Solaris, RH6.2 and windows2000
Comment 28 robert.kinsella 2003-04-28 10:59:20 UTC
verified fixed
Comment 29 christof.pintaske 2003-04-28 16:27:32 UTC
*** Issue 13513 has been marked as a duplicate of this issue. ***
Comment 30 christof.pintaske 2003-04-28 16:29:08 UTC
*** Issue 8627 has been marked as a duplicate of this issue. ***
Comment 31 christof.pintaske 2003-04-28 16:30:09 UTC
*** Issue 8627 has been marked as a duplicate of this issue. ***
Comment 32 christof.pintaske 2003-04-28 17:01:03 UTC
*** Issue 13668 has been marked as a duplicate of this issue. ***
Comment 33 Unknown 2003-05-07 19:15:14 UTC
*** Issue 13525 has been marked as a duplicate of this issue. ***
Comment 34 lohmaier 2003-05-10 19:48:15 UTC
*** Issue 13855 has been marked as a duplicate of this issue. ***
Comment 35 lohmaier 2003-05-10 19:57:39 UTC
*** Issue 13646 has been marked as a duplicate of this issue. ***
Comment 36 philipp.lohmann 2003-06-23 09:45:47 UTC
*** Issue 15817 has been marked as a duplicate of this issue. ***
Comment 37 robert.kinsella 2003-06-30 11:52:12 UTC
verified fixed - closing issue