Bug#384070: mozilla-browser: segfaults on printing webpage

Alexander Sack - Debian Bugmail asac at debian.org
Mon Aug 21 20:47:02 UTC 2006

tags 384070 + patch

patch attached, but more investigation is needed imo:

I could reproduce it with a debug build here by printing as file (i
have no printer). Its apparently a missing assertion. Anyway looking at
the output of the debug run, I get:

###!!! ASSERTION: no font available: 'font && font->entry', file
nsFontMetricsPS.cpp, line 166
Break: at file nsFontMetricsPS.cpp, line 166
###!!! ASSERTION: Cannot support translucent elements with
doublebuffering disabled: 'aRCSurface', file nsViewManager.cpp, line
Break: at file nsViewManager.cpp, line 1353

This looks a bit crazy. I see that devs have missed an assertion in
line 1361 .... (which the attached patch introduces). 

However, maybe its our fault that doublebuffering isn't enabled and
we should fix that bug first? Eric, Mike, any idea? What is about the
font issue printed to console? Maybe you can you take a look at the
site to find out what's special?

.... the backtrace of the crash.

#0  0xa760a99c in nanosleep () from /lib/tls/libc.so.6
#1  0xa760a7af in sleep () from /lib/tls/libc.so.6
#2  0x0806e026 in ah_crap_handler (signum=11) at nsSigHandlers.cpp:135
#3  0x0806ed10 in nsProfileLock::FatalSignalHandler (signo=11) at
#4  <signal handler called>
#5  0xa6888314 in nsCOMPtr<nsIRenderingContext>::get (this=0x4) at
#6  0xa68880c3 in nsCOMPtr<nsIRenderingContext>::operator
#nsDerivedSafe<nsIRenderingContext>* (
    this=0x4) at nsCOMPtr.h:705
#7  0xa6c5c779 in nsViewManager::RenderViews (this=0x8b59ac0,
aRootView=0x8acd2a8, aRC=@0x872a078,
    aRegion=@0xaf865040, aRCSurface=0x0, aDisplayList=@0xaf865070) at
#8  0xa6c61a6c in nsViewManager::Display (this=0x8b59ac0,
aView=0x8acd2a8, aX=0, aY=0,
    aClipRect=@0xaf865160) at nsViewManager.cpp:3284
#9  0xa687722f in nsSimplePageSequenceFrame::PrintNextPage
(this=0x8b6ff8c, aPresContext=0x8afe7d0)
    at nsSimplePageSequence.cpp:891
#10 0xa69c961f in nsPrintEngine::PrintPage (this=0x88cc860,
    aPrintSettings=0x8a40d18, aPO=0x8a469f8, aInRange=@0xaf86522c) at
#11 0xa69d22de in nsPagePrintTimer::Notify (this=0x8bb0150,
    at nsPagePrintTimer.cpp:91
#12 0xa7e2c4a9 in nsTimerImpl::Fire (this=0x8bb0180) at
#13 0xa7e2c68a in handleTimerEvent (event=0xa18004b8) at
#14 0xa7e244e7 in PL_HandleEvent (self=0xa18004b8) at plevent.c:673
#15 0xa7e2439c in PL_ProcessPendingEvents (self=0x80eade8) at
#16 0xa7e27696 in nsEventQueueImpl::ProcessPendingEvents
(this=0x80eada0) at nsEventQueue.cpp:398
#17 0xa602e52c in event_processor_callback (source=0x838c640,
condition=G_IO_IN, data=0x80eada0)
    at nsAppShell.cpp:67
#18 0xa788cdbf in g_io_unix_dispatch (source=0x8446688,
    callback=0xa602e508 <event_processor_callback>, user_data=0x4) at
#19 0xa7867582 in g_main_dispatch (context=0x80a8f90) at gmain.c:1933
#20 0xa78685f8 in IA__g_main_context_dispatch (context=0x80a8f90) at
#21 0xa7868930 in g_main_context_iterate (context=0x80a8f90, block=1,
dispatch=1, self=0x82a8a10)
    at gmain.c:2564
#22 0xa7868ed3 in IA__g_main_loop_run (loop=0x83b5af8) at gmain.c:2768
#23 0xa7b19bb3 in IA__gtk_main () at gtkmain.c:963
#24 0xa602ebd2 in nsAppShell::Run (this=0x826bd80) at
#25 0xa57dbbcc in nsAppShellService::Run (this=0x826bd20) at
#26 0x0805de93 in xre_main (argc=2, argv=0xaf865b64,
aAppData=0x807400c) at nsAppRunner.cpp:1907

 - Alexander

 p.s. please take care that the bug is listed as To: or CC: when 
      replying to this mail (e.g. /reply-all/). 
 GPG messages preferred.   |  .''`.  ** Debian GNU/Linux **
 Alexander Sack            | : :' :      The  universal
 asac at debian.org           | `. `'      Operating System
 http://www.asoftsite.org  |   `-    http://www.debian.org/
-------------- next part --------------
diff --git a/view/src/nsViewManager.cpp b/view/src/nsViewManager.cpp
index 131f7cd..bb060bb 100644
--- a/view/src/nsViewManager.cpp
+++ b/view/src/nsViewManager.cpp
@@ -1358,6 +1358,9 @@ #endif
       buffers = CreateBlendingBuffers(&aRC, PR_FALSE, nsnull,
                                       (element->mFlags & VIEW_TRANSPARENT) != 0,
+      NS_ASSERTION(buffers, "Failed to create rendering buffers 2");
+      if (!buffers)
+        return;
     if (element->mFlags & VIEW_RENDERED) {

More information about the pkg-mozilla-maintainers mailing list