Closed Bug 220452 Opened 22 years ago Closed 22 years ago

print preview hangs [@nsStrPrivate::GrowCapacity]

Categories

(Core Graveyard :: GFX: Gtk, defect)

x86
Linux
defect
Not set
critical

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 219060

People

(Reporter: mcsmurf, Assigned: blizzard)

Details

(Keywords: hang)

I know there many bugs like this, but i couldn't find a bug which is really like this one (no stacktrace made this also difficult). When i go to a webpage (doesn't matter how long) and i go to print preview Mozilla hangs. The pref user_pref("font.FreeType2.enable", true); seems to cause this. My .mozconfig is: ac_add_options --enable-xft ac_add_options --enable-crypto ac_add_options --disable-tests ac_add_options --disable-debug ac_add_options --enable-freetype2 ac_add_options --enable-default-toolkit=gtk ac_add_options --enable-optimize=-g When i removed this pref, print preview works fine. Stacktrace follows: #0 0x0807dcf4 in nsStrPrivate::GrowCapacity(nsStr&, unsigned) (aDest=@0xbfffc920, aNewLength=4294967290) at /mozilla2/mozilla/xpcom/string/obsolete/nsStr.cpp:149 #1 0x080771c2 in nsCString::SetCapacity(unsigned) (this=0xbfffc91c, aNewCapacity=4294967290) at /mozilla2/mozilla/xpcom/string/obsolete/nsString.cpp:174 #2 0x08077163 in nsCString::SetLength(unsigned) (this=0xbfffc91c, anIndex=4294967290) at /mozilla2/mozilla/xpcom/string/obsolete/nsString.cpp:154 #3 0x0806c4a1 in nsACString::UncheckedAppendFromReadable(nsACString const&) (this=0xbfffc91c, aReadable=@0xbfffc8dc) at /mozilla2/mozilla/xpcom/string/src/nsAString.cpp:846 #4 0x0806c357 in nsACString::do_AppendFromReadable(nsACString const&) (this=0xbfffc91c, aReadable=@0xbfffc8dc) at /mozilla2/mozilla/xpcom/string/src/nsAString.cpp:825 #5 0x4216cbc3 in nsACString::Append(nsACString const&) (this=0xbfffc91c, aReadable=@0xbfffc8dc) at ../../../dist/include/string/nsAString.h:529 #6 0x42168421 in nsFontPSFreeType::CSSFontEnumCallback(nsString const&, int, void*) (aFamily=@0xbfffc9cc, aGeneric=1, aFpi=0xbfffcc3c) at /mozilla2/mozilla/gfx/src/ps/nsFontMetricsPS.cpp:721 #7 0x4070f89a in nsFont::EnumerateFamilies(int (*)(nsString const&, int, void*), void*) const (this=0xa6d4b04, aFunc=0x4216816a <nsFontPSFreeType::CSSFontEnumCallback(nsString const&, int, void*)>, aData=0xbfffcc3c) at /mozilla2/mozilla/gfx/src/nsFont.cpp:187 #8 0x4216938c in nsFontPSFreeType::FindFont(unsigned short, nsFont const&, nsFontMetricsPS*) (aChar=97, aFont=@0xa6d4b04, aFontMetrics=0x91a88d8) at /mozilla2/mozilla/gfx/src/ps/nsFontMetricsPS.cpp:904 #9 0x421673d7 in nsFontPS::FindFont(unsigned short, nsFont const&, nsFontMetricsPS*) (aChar=97, aFont=@0xa6d4b04, aFontMetrics=0x91a88d8) at /mozilla2/mozilla/gfx/src/ps/nsFontMetricsPS.cpp:471 #10 0x42167375 in nsFontPS::FindFont(char, nsFont const&, nsFontMetricsPS*) (aChar=97 'a', aFont=@0xa6d4b04, aFontMetrics=0x91a88d8) at /mozilla2/mozilla/gfx/src/ps/nsFontMetricsPS.cpp:457 #11 0x42166d8b in nsFontMetricsPS::Init(nsFont const&, nsIAtom*, nsIDeviceContext*) (this=0x91a88d8, aFont=@0xa6d4b04, aLangGroup=0x830c448, aContext=0x9e72ce0) at /mozilla2/mozilla/gfx/src/ps/nsFontMetricsPS.cpp:135 #12 0x4070d737 in nsFontCache::GetMetricsFor(nsFont const&, nsIAtom*, nsIFontMetrics*&) (this=0x88ae828, aFont=@0xa6d4b04, aLangGroup=0x830c448, aMetrics=@0xbfffceac) at /mozilla2/mozilla/gfx/src/nsDeviceContext.cpp:666 #13 0x4070c807 in DeviceContextImpl::GetMetricsFor(nsFont const&, nsIAtom*, nsIFontMetrics*&) (this=0x9e72ce0, aFont=@0xa6d4b04, aLangGroup=0x830c448, aMetrics=@0xbfffceac) at /mozilla2/mozilla/gfx/src/nsDeviceContext.cpp:341 #14 0x4097c082 in ComputeLineHeight (aPresContext=0xabba978, aRenderingContext=0x8ef2ab0, aStyleContext=0xaba284c) at /mozilla2/mozilla/layout/html/base/src/nsHTMLReflowState.cpp:2316 #15 0x4097c1b5 in nsHTMLReflowState::CalcLineHeight(nsIPresContext*, nsIRenderingContext*, nsIFrame*) (aPresContext=0xabba978, aRenderingContext=0x8ef2ab0, aFrame=0xaba2878) at /mozilla2/mozilla/layout/html/base/src/nsHTMLReflowState.cpp:2352 #16 0x4095317c in nsBlockReflowState (this=0xbfffd03c, aReflowState=@0xbfffd2cc, aPresContext=0xabba978, aFrame=0xaba2878, aMetrics=@0xbfffd7bc, aBlockMarginRoot=4194304) at /mozilla2/mozilla/layout/html/base/src/nsBlockReflowState.cpp:176 #17 0x40944766 in nsBlockFrame::Reflow(nsIPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned&) (this=0xaba2878, aPresContext=0xabba978, aMetrics=@0xbfffd7bc, aReflowState=@0xbfffd2cc, aStatus=@0xbfffd6a8) at /mozilla2/mozilla/layout/html/base/src/nsBlockFrame.cpp:714 #18 0x4095b3ff in nsContainerFrame::ReflowChild(nsIFrame*, nsIPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, int, int, unsigned, unsigned&) (this=0xaba26fc, aKidFrame=0xaba2878, aPresContext=0xabba978, aDesiredSize=@0xbfffd7bc, aReflowState=@0xbfffd2cc, aX=0, aY=0, aFlags=0, aStatus=@0xbfffd6a8) at /mozilla2/mozilla/layout/html/base/src/nsContainerFrame.cpp:924
> aNewCapacity=4294967290 This is the problem... Since you have this in a debugger, what is "endFamily" in frame 6? Is it -1 or something? What is the string in value.get()?
very weird this problem. I now can't get it hanging there, but it now hangs here (or is this no hang and this stacktrace is caused by gdb?!), because gdb doesn't load any sourcefile it stays at apprunner): #0 0x40490ae2 in sigsuspend () from /lib/libc.so.6 #1 0x400fbf35 in __pthread_wait_for_restart_signal () from /lib/libpthread.so.0 #2 0x400f8f05 in pthread_cond_wait () from /lib/libpthread.so.0 #3 0x400d22b4 in PR_WaitCondVar (cvar=0x815b868, timeout=4294967295) at /mozilla2/mozilla/nsprpub/pr/src/pthreads/ptsynch.c:389 #4 0x40946642 in nsThreadPool::GetRequest(nsIThread*) (this=0x815b780, currentThread=0x82784a0) at /mozilla2/mozilla/xpcom/threads/nsThread.cpp:662 #5 0x409470c9 in nsThreadPoolRunnable::Run() (this=0x87f1748) at /mozilla2/mozilla/xpcom/threads/nsThread.cpp:891 #6 0x4094517f in nsThread::Main(void*) (arg=0x82784a0) at /mozilla2/mozilla/xpcom/threads/nsThread.cpp:118 #7 0x400d890a in _pt_root (arg=0x82788c8) at /mozilla2/mozilla/nsprpub/pr/src/pthreads/ptthread.c:214 #8 0x400f9d53 in pthread_start_thread () from /lib/libpthread.so.0 #9 0x400f9d99 in pthread_start_thread_event () from /lib/libpthread.so.0
Ok, got a stacktrace again. I only seem to get a good stacktrace when i start mozilla normal and then attach gdb to it (error of the debugger?). (gdb) print endFamily $1 = 4294967295 (gdb) print value.get() $3 = 0x8711ff8 "sans-serif" (gdb)
OK. I see. This is not an xpcom bug but a bug in the freetype code (note that the string in question only has _one_ '-' char, while the code assumes that there are two).
Assignee: dougt → blizzard
Component: XPCOM → GFX: Gtk
QA Contact: scc → ian
dupe of bug 219060 the patch for which was just landed. *** This bug has been marked as a duplicate of 219060 ***
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.