Am 26.11.2016 um 23:19 schrieb Alexey Kulentsov:

Hi!

I have memory leak in my vibe.d application so I installed valgring and start to debug. I have a lot messages like this:

==15579== Conditional jump or move depends on uninitialised value(s)
==15579==    at 0xCD594E: _D4vibe5utils6memory9Allocator4freeMFNbAvZ9__requireMFNbZv (../../.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/utils/memory.d:133)
==15579==    by 0xCD60AB: _D4vibe5utils6memory13LockAllocator4freeMFNbAvZv (../../.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/utils/memory.d:166)
==15579==    by 0xBF11C4: _D4vibe5utils6memory152__T9freeArrayTS4vibe5utils7hashmap91__T7HashMapTAmTmTS4vibe5utils7hashmap29__T20DefaultHashMapTraitsTAmZ20DefaultHashMapTraitsZ7HashMap10TableEntryVbi1Z9freeArrayFNbC4vibe5utils6memory9AllocatorKAS4vibe5utils7hashmap91__T7HashMapTAmTmTS4vibe5utils7hashmap29__T20DefaultHashMapTraitsTAmZ20DefaultHashMapTraitsZ7HashMap10TableEntrybZv (../../.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/utils/memory.d:111)
==15579==    by 0xBF0237: _D4vibe5utils7hashmap91__T7HashMapTAmTmTS4vibe5utils7hashmap29__T20DefaultHashMapTraitsTAmZ20DefaultHashMapTraitsZ7HashMap6__dtorMFNbZv (../../.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/utils/memory.d:101)
==15579==    by 0xBE5FAB: _D4vibe4http6router17MatchGraphBuilder12disambiguateMFZv (../../.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/http/router.d:863)
==15579==    by 0xBB5E3E: _D4vibe4http6router39__T9MatchTreeTS4vibe4http6router5RouteZ9MatchTree12rebuildGraphMFZv (../../.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/http/router.d:669)
==15579==    by 0xBB5140: _D4vibe4http6router39__T9MatchTreeTS4vibe4http6router5RouteZ9MatchTree5matchMFAyaMDFmMAAyaZbZb (../../.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/http/router.d:526)
==15579==    by 0xBB47CD: _D4vibe4http6router9URLRouter13handleRequestMFC4vibe4http6server17HTTPServerRequestC4vibe4http6server18HTTPServerResponseZv (../../.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/http/router.d:261)
==15579==    by 0xBEA5C0: _D4vibe4http6server13handleRequestFC4vibe4core6stream6StreamC4vibe4core3net13TCPConnectionC4vibe4http6server14HTTPListenInfoKC4vibe4http6server18HTTPServerSettingsKbZb (../../.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/http/server.d:1906)
==15579==    by 0xBE8C0C: _D4vibe4http6server20handleHTTPConnectionFC4vibe4core3net13TCPConnectionC4vibe4http6server14HTTPListenInfoZv (../../.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/http/server.d:1662)
==15579==    by 0xBE85B4: _D4vibe4http6server15listenHTTPPlainFC4vibe4http6server18HTTPServerSettingsZ8doListenFC4vibe4http6server14HTTPListenInfobbZ9__lambda4MFC4vibe4core3net13TCPConnectionZv (../../.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/http/server.d:1543)
==15579==    by 0xCA4C5A: _D4vibe4core7drivers13libevent2_tcp10ClientTask7executeMFZv (../../.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/core/drivers/libevent2_tcp.d:618)
==15579==  Uninitialised value was created by a stack allocation
==15579==    at 0xCD6258: _TMP212 (../../.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/utils/memory.d:167)

I have no experience with valgrind, so my question: is this really bug of just warning, can be ignored?

Hi, thanks for sharing the results. I've observed this issue in a
different context a while ago and there seems to be a code generation
issue for contracts in interface definitions. Accessing the parameters
yields garbage coming somewhere from the stack, but not from their real
address. These contracts currently have no effect anyway due to the way
contracts are inherited, so I'll just remove them for now.