Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2878 closed defect (fixed)

[PATCH] Valgrind warnings on game startup: inotify_event_loop_process_events()

Reported by: Echelon9 Owned by: leper
Priority: Should Have Milestone: Alpha 18
Component: Core engine Keywords: patch
Cc: Patch:

Description

Valgrind reports the following conditional jump or move depends on uninitialised value(s) in game startup code.

Note: valgrind was run with the --smc-check=all argument to silence the Javascript engine false positives.

==23603== Thread 7:
==23603== Conditional jump or move depends on uninitialised value(s)
==23603==    at 0x4C2DB69: strlen (vg_replace_strmem.c:412)
==23603==    by 0x8C65CD3: std::string::operator=(char const*) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19)
==23603==    by 0xAF8D2E: inotify_event_loop_process_events() (dir_watch_inotify.cpp:128)
==23603==    by 0xAF8FFE: inotify_event_loop(void*) (dir_watch_inotify.cpp:171)
==23603==    by 0x93D3181: start_thread (pthread_create.c:312)
==23603==    by 0x96E3FBC: clone (clone.S:111)
==23603==  Uninitialised value was created by a stack allocation
==23603==    at 0xAF8C6D: inotify_event_loop_process_events() (dir_watch_inotify.cpp:102)
==23603==

System details:

$ uname -msr
Linux 3.13.0-37-generic x86_64

The relevant variable is buffer, which is used in read() call then cast to a inotify_event struct.

Attachments (1)

fix2878-uninitialised-buffer.patch (462 bytes ) - added by Echelon9 10 years ago.
Proposed patch

Download all attachments as: .zip

Change History (4)

comment:1 by Echelon9, 10 years ago

Keywords: review patch added
Summary: Valgrind warnings on game startup: inotify_event_loop_process_events()[PATCH] Valgrind warnings on game startup: inotify_event_loop_process_events()

by Echelon9, 10 years ago

Proposed patch

comment:2 by leper, 10 years ago

Owner: set to leper
Resolution: fixed
Status: newclosed

In 15936:

Fix valgrind warning about uninitialized variable. Patch by Echelon9. Fixes #2878.

comment:3 by leper, 10 years ago

Keywords: review removed

Thanks for the patch.

Note: See TracTickets for help on using tickets.