gperf - Patches: patch #9560, Fix use of unitialized variable in...
You are not allowed to post comments on this tracker with your current authentication level.
patch #9560: Fix use of unitialized variable in --debug mode
Submitter: | Frank Wojcik <fwojcik> | ||
Submitted: | Sat 10 Feb 2018 12:47:08 AM UTC | ||
Category: | None | Priority: | 5 - Normal |
Status: | Done | Privacy: | Public |
Assigned to: | haible | Open/Closed: | Closed |
Sat 08 Sep 2018 02:38:44 PM UTC, comment #1: |
Bruno Haible <haible> |
Sat 10 Feb 2018 12:47:08 AM UTC, original submission:
If --debug is set, then hash values of duplicate keywords are printed out without being initialized. This patch sets the hash of duplicate values in Search::compute_hash(). This makes that function more correct but less efficient since hashes are repeatedly recomputed during the search process, and hashes of duplicate keywords are not used there. Other fixes are obviously possible. |
Frank Wojcik <fwojcik> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 4 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2018-09-08 | haible | Status | None | Done | |
Assigned to | None | haible | |||
Open/Closed | Open | Closed | |||
2018-02-10 | fwojcik | Attached File | - | Added uninit.diff, #43223 |
Powered by Savane 3.13-d3ae.
Corresponding source code
Thanks for this report as well. I can reproduce it with valgrind:
cd tests
valgrind ../src/gperf --debug -k 1 --struct-type --readonly-table --enum --global -K field_name -N header_entry -D --ignore-case smtp.gperf
produces this output:
Conditional jump or move depends on uninitialised value(s)
at 0x5728B83: vfprintf (vfprintf.c:1631)
by 0x5730898: printf (printf.c:33)
by 0x40DD9F: output_keyword_entry(KeywordExt*, int, char const*) (output.cc:1209)
by 0x40E1D1: Output::output_keyword_table() const (output.cc:1314)
by 0x40EABD: Output::output_lookup_tables() const (output.cc:1511)
by 0x410CE2: Output::output() (output.cc:2194)
by 0x4115CD: main (main.cc:114)
Instead of setting the _hash_value in Search::compute_hash, one could also set it in Output::output_keyword_table. I find it even better to just output "duplicate" instead of the hash code.