bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#9948: valgrind warning: Conditional jump or move depends on uninitia


From: Paul Eggert
Subject: bug#9948: valgrind warning: Conditional jump or move depends on uninitialised value(s) in redisplay_window
Date: Sun, 06 Nov 2011 21:04:40 -0800
User-agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1

--track-origins=yes should help, but in the meantime, valgrind's
bug report doesn't necessarily mean that no code ever set scrolling_up.

It could be that scrolling_up was set this way:

      scrolling_up = PT > margin_pos;

but that margin_pos wasn't properly initialized.  For example, suppose
margin_pos was set this way:

          margin_pos = IT_CHARPOS (it1);

This initialization would not be correct if IT_CHARPOS (it1) referenced
an uninitialized variable.

Unfortunately valgrind won't report any error in IT_CHARPOS (it1)
until scrolling_up is used.  That's because it does not report use
of uninitialized storage: it reports only when conditional branches
or syscalls or addresses depend on the contents of the uninitialized
storage.

It's too bad that valgrind works this way.  It'd be more convenient if it
reported use of uninitialized storage right away.  But it'd be hard for
valgrind to do better, without reporting lots of false positives for
structures that contain holes, so it is what it is.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]