Merge lp:~widelands-dev/widelands/valgrind into lp:widelands

Proposed by GunChleoc
Status: Merged
Merged at revision: 9013
Proposed branch: lp:~widelands-dev/widelands/valgrind
Merge into: lp:widelands
Diff against target: 99 lines (+56/-0)
3 files modified
src/ai/defaultai.cc (+1/-0)
src/wui/building_statistics_menu.cc (+5/-0)
valgrind.supp (+50/-0)
To merge this branch: bzr merge lp:~widelands-dev/widelands/valgrind
Reviewer Review Type Date Requested Status
Klaus Halfmann code review Approve
Review via email: mp+364213@code.launchpad.net

Commit message

Update Valgrind suppressions and fix uninitialized variables reported by Valgrind Memcheck
- Uninitialized variable in default AI
- Uninitialized variables in Building Statistics
- Exclude more errors from zip filesystem, Eris and graphics drivers

Description of the change

I used Valgrind to have a look at memory errors caused by Widelands code. Found a few uninitialized variables. Our code seems to be pretty clean already thanks to ASan :)

To post a comment you must log in.
Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

Code looks fine, will not do any further tests.

review: Approve (code review)
Revision history for this message
GunChleoc (gunchleoc) wrote :

I think I have tested this sufficiently. Thanks for the review

@bunnybot merge

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 4576. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/504273300.
Appveyor build 4363. State: failed. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_valgrind-4363.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/ai/defaultai.cc'
2--- src/ai/defaultai.cc 2019-02-23 11:00:49 +0000
3+++ src/ai/defaultai.cc 2019-03-10 11:45:59 +0000
4@@ -113,6 +113,7 @@
5 ts_in_const_count_(0),
6 ts_without_trainers_(0),
7 enemysites_check_delay_(30),
8+ spots_(0),
9 resource_necessity_water_needed_(false),
10 highest_nonmil_prio_(0),
11 expedition_ship_(kNoShip) {
12
13=== modified file 'src/wui/building_statistics_menu.cc'
14--- src/wui/building_statistics_menu.cc 2019-02-23 11:00:49 +0000
15+++ src/wui/building_statistics_menu.cc 2019-03-10 11:45:59 +0000
16@@ -111,6 +111,11 @@
17 kButtonHeight,
18 "",
19 UI::Align::kRight),
20+ current_building_type_(INVALID_INDEX),
21+ last_building_index_(0),
22+ last_building_type_(INVALID_INDEX),
23+ lastupdate_(0),
24+ was_minimized_(false),
25 low_production_(33),
26 has_selection_(false),
27 nr_building_types_(parent.egbase().tribes().nrbuildings()) {
28
29=== modified file 'valgrind.supp'
30--- valgrind.supp 2019-03-10 09:07:24 +0000
31+++ valgrind.supp 2019-03-10 11:45:59 +0000
32@@ -48,6 +48,13 @@
33 ...
34 }
35 {
36+ driver1
37+ Memcheck:Addr1
38+ ...
39+ obj:*965_dri.so
40+ ...
41+}
42+{
43 driver2
44 Memcheck:Addr2
45 ...
46@@ -69,6 +76,13 @@
47 ...
48 }
49 {
50+ driver16
51+ Memcheck:Addr16
52+ ...
53+ obj:*i965_dri.so
54+ ...
55+}
56+{
57 SDL2Leak
58 Memcheck:Leak
59 ...
60@@ -95,3 +109,39 @@
61 obj:*linux-gnu/lib*
62 ...
63 }
64+{
65+ ZipWriteValue8
66+ Memcheck:Value8
67+ ...
68+ fun:zipWriteInFileInZip
69+ ...
70+}
71+{
72+ ZipWriteCond
73+ Memcheck:Cond
74+ ...
75+ fun:zipWriteInFileInZip
76+ ...
77+}
78+{
79+ ZipCloseCond
80+ Memcheck:Cond
81+ ...
82+ fun:zipCloseFileInZip
83+ ...
84+}
85+{
86+ ZipCloseParam
87+ Memcheck:Param
88+ write(buf)
89+ ...
90+ fun:zipCloseFileInZip
91+ ...
92+}
93+{
94+ ErisLeak
95+ Memcheck:Leak
96+ ...
97+ fun:l_alloc
98+ ...
99+}

Subscribers

People subscribed via source and target branches

to status/vote changes: