Closed Bug 78645 Opened 23 years ago Closed 23 years ago

[console] gfx/gfx2 must not print to console in opt builds

Categories

(Core :: Layout, defect, P4)

defect

Tracking

()

VERIFIED FIXED
mozilla0.9.2

People

(Reporter: cls, Assigned: jtaylor)

References

Details

(Whiteboard: critical for 0.9.2)

Attachments

(10 files)

<formletter>It has been decreed (or requested at any rate) that our release
(read non-debug) builds must not print anything to the console when the app is
running.  See bug 76720 for details.  I have done a preliminary tree scouring
and created mini-patches for each module that has bare printfs.   These patches
are not all inclusive as I didn't even think about xul/js output until post
scour so module owners & peers will still need to scour their modules themselves
as well as make sure the preliminary patches do not break anything.</formletter>
Blocks: 76720
Keywords: mozilla0.9.1
Priority: -- → P2
Attached patch prelim gfx patchSplinter Review
Sorry about the additional spammage but I should clear up a couple of things
before everyone starts replying.

1) I'm just the messenger.  Discussions outside of the specific module/patches
should be discussed in the parent bug ( bug 76720).
2) I have no intention of checking in the patches as is; that's why the bugs are
assigned to someone else ;).
3) The patches are the result of a far & wide-reaching grep across the entire
tree.  They may affect some cases that are not even used and they are far from
optimal.
4) Some platforms/ports will not need the printfs shutoff as they use other
mechanisms to stop the printfs.  That's fine.  Note it in the bug and close it
as invalid(?).  Depending upon the platform/port some people may still be
interested in removing the overhead from the printfs.
for the gfx patch, r=pavlov.

for the gfx2 patch, all of the places where it printfs should be assertions. 
I'll post a new patch for gfx2 shortly...
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.1
Priority: P2 → P4
Keywords: patch
Per PDT Triage effort: changing the targeted milestone to "mozilla0.9.2".
Please feel free to renominate/address bug if time is available AFTER all
currently targeted 0.9.1 bugs are resolved.
.Angela...
Target Milestone: mozilla0.9.1 → mozilla0.9.2
76720 is targetted for 0.9.1.  can this be moved up?
lets keep dribbling these [console] bugs into the tree as quick as we
can, but they shouldn't hold up or block 0.9.1 so moving the target milestone
to 0.9.2.
in the gfx2 patch, the printfs should be changed to asserts.  intern want this?

r=pavlov
Assignee: pavlov → gagan
Status: ASSIGNED → NEW
Whiteboard: [intern]
->jtaylor
Assignee: gagan → jtaylor
Whiteboard: [intern]
Attached patch New gfx patchSplinter Review
Attached patch New gfx2 patchSplinter Review
John: The review comments from bug 78665 also apply here. Additionally I noticed 
that you have converted some code in gfxImageFrame.cpp to an assertion but have 
left out the return statement--

-  if (aWidth <= 0 || aHeight <= 0) {
-    printf("error - negative image size\n");
-    return NS_ERROR_FAILURE;
-  }
+  NS_ASSERTION(aWidth <= 0 || aHeight <= 0,"error - negative image size\n");

Assertion is good but you still need a return NS_ERROR_FAILURE. I'd probably 
consider writing this as--

   if (aWidth <= 0 || aHeight <= 0) {
       NS_ASSERTION(0, "error - negative image size\n");
       return NS_ERROR_FAILURE;
   }


What's wrong in this patch--

Index: xlibrgb/xlibrgb.c
===================================================================
RCS file: /cvsroot/mozilla/gfx/src/xlibrgb/xlibrgb.c,v
retrieving revision 1.15
diff -u -r1.15 xlibrgb.c
--- xlibrgb.c   2001/01/14 00:58:06     1.15
+++ xlibrgb.c   2001/06/11 18:44:19
@@ -585,6 +585,7 @@
   pseudo = (visual->class == PseudoColor || visual->class == TrueColor);
 
   if (xlib_rgb_verbose)
+#ifdef DEBUG
     printf ("Visual 0x%x, type = %s, depth = %d, %ld:%ld:%ld%s; score=%x\n",
            (int)visual->visualid,
            visual_names[visual->class],
@@ -594,7 +595,7 @@
            visual->blue_mask,
            sys ? " (system)" : "",
            (quality << 12) | (speed << 8) | (sys << 4) | pseudo);
-  
+#endif
   return (quality << 12) | (speed << 8) | (sys << 4) | pseudo;
 }
 
Here is what's wrong-- the if (xlib_rgb_verbose) should be inside the DEBUG 
check as well. Since you have built this on DEBUG versions you wouldn't have 
caught the problem. Try building on release and you'll see the problem!

Fix that and also keep the indentations/spaces consistent. Not sure if that's 
you or cvs diff... but I'm hoping that we avoid changes in style. 
Attached patch GFX patchSplinter Review
Wrt attach 37986:

When the else case only contains a printf, I think that you should wrap the
entire else clause in the ifdef DEBUG.  I'm not sure if all compilers support an
empty else clause.  gcc seems to handle the | else {} | case alright but I'm sur
e it and every other compiler will barf on the | else | case. (the xlib portion
of the patch).

Attached patch Fix for gfxSplinter Review
A big chunk of that patch appears to be whitespace changes across whole files. 
It makes it hard to review the relevant parts.  Can you create the diff with -uw
?  Thanks.
There are conflicts in gfx/src/xlib/nsFontMetricsXlib.cpp.  Clean those up and r=cls


Attached patch New fix for gfxSplinter Review
r=cls
rs=blizzard
a=blizzard on behalf of drivers for 0.9.2
Whiteboard: critical for 0.9.2
Fix in.
Status: NEW → ASSIGNED
...checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Marking verified per last comments.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: