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
=== modified file 'src/ai/defaultai.cc'
--- src/ai/defaultai.cc 2019-02-23 11:00:49 +0000
+++ src/ai/defaultai.cc 2019-03-10 11:45:59 +0000
@@ -113,6 +113,7 @@
113 ts_in_const_count_(0),113 ts_in_const_count_(0),
114 ts_without_trainers_(0),114 ts_without_trainers_(0),
115 enemysites_check_delay_(30),115 enemysites_check_delay_(30),
116 spots_(0),
116 resource_necessity_water_needed_(false),117 resource_necessity_water_needed_(false),
117 highest_nonmil_prio_(0),118 highest_nonmil_prio_(0),
118 expedition_ship_(kNoShip) {119 expedition_ship_(kNoShip) {
119120
=== modified file 'src/wui/building_statistics_menu.cc'
--- src/wui/building_statistics_menu.cc 2019-02-23 11:00:49 +0000
+++ src/wui/building_statistics_menu.cc 2019-03-10 11:45:59 +0000
@@ -111,6 +111,11 @@
111 kButtonHeight,111 kButtonHeight,
112 "",112 "",
113 UI::Align::kRight),113 UI::Align::kRight),
114 current_building_type_(INVALID_INDEX),
115 last_building_index_(0),
116 last_building_type_(INVALID_INDEX),
117 lastupdate_(0),
118 was_minimized_(false),
114 low_production_(33),119 low_production_(33),
115 has_selection_(false),120 has_selection_(false),
116 nr_building_types_(parent.egbase().tribes().nrbuildings()) {121 nr_building_types_(parent.egbase().tribes().nrbuildings()) {
117122
=== modified file 'valgrind.supp'
--- valgrind.supp 2019-03-10 09:07:24 +0000
+++ valgrind.supp 2019-03-10 11:45:59 +0000
@@ -48,6 +48,13 @@
48 ...48 ...
49}49}
50{50{
51 driver1
52 Memcheck:Addr1
53 ...
54 obj:*965_dri.so
55 ...
56}
57{
51 driver258 driver2
52 Memcheck:Addr259 Memcheck:Addr2
53 ...60 ...
@@ -69,6 +76,13 @@
69 ...76 ...
70}77}
71{78{
79 driver16
80 Memcheck:Addr16
81 ...
82 obj:*i965_dri.so
83 ...
84}
85{
72 SDL2Leak86 SDL2Leak
73 Memcheck:Leak87 Memcheck:Leak
74 ...88 ...
@@ -95,3 +109,39 @@
95 obj:*linux-gnu/lib*109 obj:*linux-gnu/lib*
96 ...110 ...
97}111}
112{
113 ZipWriteValue8
114 Memcheck:Value8
115 ...
116 fun:zipWriteInFileInZip
117 ...
118}
119{
120 ZipWriteCond
121 Memcheck:Cond
122 ...
123 fun:zipWriteInFileInZip
124 ...
125}
126{
127 ZipCloseCond
128 Memcheck:Cond
129 ...
130 fun:zipCloseFileInZip
131 ...
132}
133{
134 ZipCloseParam
135 Memcheck:Param
136 write(buf)
137 ...
138 fun:zipCloseFileInZip
139 ...
140}
141{
142 ErisLeak
143 Memcheck:Leak
144 ...
145 fun:l_alloc
146 ...
147}

Subscribers

People subscribed via source and target branches

to status/vote changes: