2025-07-21 21:03 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002940Spring engineGeneralpublic2012-11-11 23:06
Reporterabma 
Assigned Toabma 
PrioritynormalSeveritycrashReproducibilityalways
StatusclosedResolutionunable to reproduce 
Product Version85.0 
Target Version86.0Fixed in Version 
Summary0002940: valgrind errors: Invalid read of size 8 (zero-k) (found because game desynced)
Descriptionfirst valgrind errors happens at frame 0: (at warmup)

http://pastebin.com/ub2yNTD8
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
related to 0002743resolvedabma Valgrind error: "Invalid read of size 8" + not initialized value 
parent of 0002942resolvedabma (headless) Conditional jump or move depends on uninitialised value, Camera.cpp:250 
parent of 0002943closedabma Conditional jump or move depends on uninitialised value (ConfigVariable.h:47) 
related to 0002889closed Some players desync, may be deformation related 
+Relationships

-Notes

~0008249

abma (administrator)

demo: http://zero-k.info/Battles/Detail/51982

first valgrind error happens early in the game.

~0008251

abma (administrator)

Last edited: 2012-02-03 19:52

here the invalid read is made: https://github.com/spring/spring/blob/master/rts/Sim/Projectiles/ExplosionGenerator.cpp#L624

~0008252

abma (administrator)

i guess it can be reproduced by running "Zero-K v0.9.9.2" + valgrind.

~0008254

abma (administrator)

see valgrind.log for more verbose output. (was created with --track-origins=yes, pastebin is without this valgrind switch)

~0008256

Kloot (developer)

Last edited: 2012-02-03 21:05

hmm, I suppose the problem might be that std::strings are not (always) NULL-terminated (while strtod&co expect C-style strings)

~0008258

abma (administrator)

Last edited: 2012-02-04 10:15

add an assertion:
assert(script[script.size()]==0);

or

assert(p<script.size());

?

~0008259

Kloot (developer)

assert(script[script.size()]==0); --> undefined if the std::string implementation does not carry a terminator

assert(p<script.size()); --> look at line 621, the problem is inside strtod itself

~0008260

abma (administrator)

relevant valgrind output of 85.0.1-170-g0acab62:

http://pastebin.com/L24bfFeD

~0008261

abma (administrator)

Last edited: 2012-02-04 14:20

hmm, related http://sourceware.org/bugzilla/show_bug.cgi?id=12424 ?

or this one? https://lists.launchpad.net/tarantool-developers/msg01024.html (valgrind bug)

~0008262

Kloot (developer)

Ok, _assuming_ this is just a false positive (and valgrind does not know enough about the optimized strncasecmp used by strtod), it should not be the cause of the desync and can be ignored/surpressed. Would need logging of the returned strtod values to be sure though.

~0009349

abma (administrator)

new valgrind run needed... (imo this one is to old, maybe its already fixed)
+Notes

-Issue History
Date Modified Username Field Change
2012-02-03 19:35 abma New Issue
2012-02-03 19:35 abma Product Version => 85.0
2012-02-03 19:35 abma Target Version => 86.0
2012-02-03 19:35 abma Summary valgrind errors: Invalid read of size 8 => valgrind errors: Invalid read of size 8 (zero-k)
2012-02-03 19:37 abma Note Added: 0008249
2012-02-03 19:38 abma Description Updated
2012-02-03 19:41 abma Relationship added related to 0002743
2012-02-03 19:43 abma Relationship added related to 0002889
2012-02-03 19:52 abma Note Added: 0008251
2012-02-03 19:52 abma Note Edited: 0008251
2012-02-03 20:00 abma Note Added: 0008252
2012-02-03 20:13 abma File Added: valgrind.log
2012-02-03 20:14 abma Note Added: 0008254
2012-02-03 20:33 abma File Deleted: valgrind.log
2012-02-03 20:33 abma File Added: valgrind.log
2012-02-03 20:43 abma Relationship added parent of 0002942
2012-02-03 20:46 abma Relationship added parent of 0002943
2012-02-03 20:50 Kloot Note Added: 0008256
2012-02-03 20:53 Kloot Note Edited: 0008256
2012-02-03 21:05 Kloot Note Edited: 0008256
2012-02-04 00:38 abma Summary valgrind errors: Invalid read of size 8 (zero-k) => valgrind errors: Invalid read of size 8 (zero-k) (found because game desynced)
2012-02-04 10:14 abma Note Added: 0008258
2012-02-04 10:15 abma Note Edited: 0008258
2012-02-04 12:08 Kloot Note Added: 0008259
2012-02-04 14:14 abma Note Added: 0008260
2012-02-04 14:17 abma Note Added: 0008261
2012-02-04 14:20 abma Note Edited: 0008261
2012-02-04 15:12 Kloot Note Added: 0008262
2012-11-11 23:06 abma Note Added: 0009349
2012-11-11 23:06 abma Status new => closed
2012-11-11 23:06 abma Assigned To => abma
2012-11-11 23:06 abma Resolution open => unable to reproduce
+Issue History