On Mon, Jan 09, 2006 at 09:47:59AM -0600, Gunnar Wolf wrote:
> tag 323996 + help
> thanks
> 
> Hi,
> 
> Thanks for your report - which, I must admit, has spent too much time
> waiting for my attention.


> I understand the problems caused by using uninitialized values - but
> am completely unfamiliar with the valgrind tool
valgrind is great!  You can use it to help find the source of known
bugs, rather than just the problem as it is ultimately experienced,
and helps to find memory leaks.

> and cannot get much
> sense out of your report - Could you help me get some insight out of
> it? Where should I start looking for uninitialized values?
First you will want to compile with debugging symbols:

  CFLAGS=-g DEB_BUILD_OPTIONS=nostrip apt-get -b source xosview

Then run valgrind on the result:

  valgrind ./xosview-1.8.2/xosview

I get output like the following:

==7439== Conditional jump or move depends on uninitialised value(s)
==7439==    at 0x805CA06: DiskMeter::updateinfo(unsigned long, unsigned long, 
int) (in /tmp/xosview-1.8.2/xosview)
==7439==    by 0x805D050: DiskMeter::getvmdiskinfo() (in 
/tmp/xosview-1.8.2/xosview)
==7439==    by 0x805D2D9: DiskMeter::DiskMeter(XOSView*, float) (in 
/tmp/xosview-1.8.2/xosview)
==7439==    by 0x805482F: MeterMaker::makeMeters() (in 
/tmp/xosview-1.8.2/xosview)
==7439==    by 0x8053DD2: XOSView::XOSView(char*, int, char**) (in 
/tmp/xosview-1.8.2/xosview)
==7439==    by 0x8054087: main (in /tmp/xosview-1.8.2/xosview)

==7439== Conditional jump or move depends on uninitialised value(s)
==7439==    at 0x8050944: FieldMeterGraph::drawfields(int) (in 
/tmp/xosview-1.8.2/xosview)
==7439==    by 0x804F901: FieldMeter::draw() (in /tmp/xosview-1.8.2/xosview)
==7439==    by 0x80530CA: XOSView::reallydraw() (in /tmp/xosview-1.8.2/xosview)
==7439==    by 0x804CBA0: XWin::checkevent() (in /tmp/xosview-1.8.2/xosview)
==7439==    by 0x8052DAC: XOSView::run() (in /tmp/xosview-1.8.2/xosview)
==7439==    by 0x805408F: main (in /tmp/xosview-1.8.2/xosview)

This seems to imply that updateinfo() and drawfields() are passed
pointers to information which isn't fully initialized.

The following options are particularly useful:

  --db-attach=yes
  --leak-check=full    (not needed here)
  --show-reachable=yes (not needed here)

If you use db-attache, then you can get a backtrace:

0x0805ca06 in DiskMeter::updateinfo (this=0x4392128, one=387445, two=122796, 
    fudgeFactor=4) at diskmeter.cc:92
92          if (fields_[0] < 0.0)

So it appears that fields_[0] is never initialized.

(gdb) info address fields_
Symbol "fields_" is a field of the local class variable `this'

Which seems, despite my total lack of understanding of OO design, to
be defined in ./fieldmeter.{h,cc}.

fields *seems* to be zerod at fieldmeter.cc:306.

Hope that was useful.

-- 
Clear skies,
Justin


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to