To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=116872
                 Issue #|116872
                 Summary|drawinglayer: BPixelRasterToBitmapEx causes false valg
                        |rind positive in rtl_crc32
               Component|Drawing
                 Version|DEV300m99
                Platform|All
                     URL|
              OS/Version|All
                  Status|NEW
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|code
             Assigned to|sb
             Reported by|sb





------- Additional comments from s...@openoffice.org Tue Feb  8 12:04:25 +0000 
2011 -------
At least on DEV300_m99 based CWS sb140, unxlngi6 non-pro, executing
chart2/qa/unoapi under valgrind reports

Use of uninitialised value of size 4
   at 0x40618A2: rtl_crc32 (in
/cws/sb140_m99/DEV300/unxlngi6/installation/opt/openoffice.org/ure/lib/libuno_sal.so.3)
   by 0x5B582DE: Bitmap::GetChecksum() const (in
/cws/sb140_m99/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)
   by 0x5B7192C: BitmapEx::GetChecksum() const (in
/cws/sb140_m99/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)
   by 0x5A5B63F: ImpGraphic::ImplGetChecksum() const (in
/cws/sb140_m99/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)
   by 0x5B9AF4B: Graphic::GetChecksum() const (in
/cws/sb140_m99/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)
   by 0x5179A72: GraphicID::GraphicID(GraphicObject const&) (in
/cws/sb140_m99/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libsvtli.so)
   by 0x5179CA5: GraphicCache::AddGraphicObject(GraphicObject const&, Graphic&,
ByteString const*, GraphicObject const*) (in
/cws/sb140_m99/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libsvtli.so)
   by 0x5185D5F: GraphicManager::ImplRegisterObj(GraphicObject const&, Graphic&,
ByteString const*, GraphicObject const*) (in
/cws/sb140_m99/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libsvtli.so)
   by 0x517C307: GraphicObject::ImplSetGraphicManager(GraphicManager const*,
ByteString const*, GraphicObject const*) (in
/cws/sb140_m99/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libsvtli.so)
   by 0x517D15D: GraphicObject::GraphicObject(Graphic const&, GraphicManager
const*) (in
/cws/sb140_m99/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libsvtli.so)
   by 0x13024693:
drawinglayer::RenderBitmapPrimitive2D_GraphicManager(OutputDevice&, BitmapEx
const&, basegfx::B2DHomMatrix const&) (in
/cws/sb140_m99/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libdrawinglayerli.so)
   by 0x1302AD95:
drawinglayer::processor2d::VclProcessor2D::RenderBitmapPrimitive2D(drawinglayer::primitive2d::BitmapPrimitive2D
const&) (in
/cws/sb140_m99/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libdrawinglayerli.so)

This appears to be something of a false positive:

- The BitmapEx in question has been produced by BPixelRasterToBitmapEx
(drawinglayer/source/processor3d/zbufferprocessor3d.cxx).  For any fully
transparent pixels, the underlying Bitmap color data are uninitialized, while
the corresponding AlphaMask value is 255.  (This full transparency causes the
color data to be effectively ignored, so that most of the time it is irrelevant
that it is uninitialized.)

- The calculated BitmapEx::GetChecksum apparently depends on the uninitialized
data, but it is unclear to me whether that is really important (i.e., whether it
is important that two instances of BitmapEx that only differ in color data for
fully transparent pixel produce the same checksum).  @ka: Please clarify.

I see three possible solutions for this:

1  Fix BPixelRasterToBitmapEx to initialize all color data.  As a proof of
concept, the below patch would silence valgrind.

2  Insert a VALGRIND_MAKE_MEM_DEFINED client request (see
<http://valgrind.org/docs/manual/mc-manual.html#mc-manual.clientreqs>) into
BPixelRasterToBitmapEx to make valgrind think all the color data *is* 
initialized.

3  Introduce a suppression file (see
<http://valgrind.org/docs/manual/manual-core.html#manual-core.suppress>) and use
that whenever running valgrind.

The patch for (1):

diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
--- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
@@ -107,6 +107,7 @@
                                                                        
(sal_uInt8)(nBlue / nDivisor)));
                                                                
pAlpha->SetPixel(y, x, BitmapColor(255 - (sal_uInt8)nOpacity));
                                                        }
+                            else pContent->SetPixel(y, x, BitmapColor(0, 0, 
0));
                                                }
                                        }
                                }
@@ -125,6 +126,7 @@
                                                                
pContent->SetPixel(y, x, BitmapColor(rPixel.getRed(),
rPixel.getGreen(), rPixel.getBlue()));
                                                                
pAlpha->SetPixel(y, x, BitmapColor(255 - rPixel.getOpacity()));
                                                        }
+                            else pContent->SetPixel(y, x, BitmapColor(0, 0, 
0));
                                                }
                                        }
                                }

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@graphics.openoffice.org
For additional commands, e-mail: issues-h...@graphics.openoffice.org


---------------------------------------------------------------------
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org

Reply via email to