RejectedSoftware Forums

Sign up

valgrind reports "Invalid write of size 4" in vibe/utils/memory.d

Hello,

I am running vibe.d 0.7.27 on linux mint 17.3 (x86_64), compiled with dmd 2.070 and "dub build".
On serving a static file via
router.get("foo", serveStaticFile("bar"));
valgrind reports:

==5411== Invalid write of size 4
==5411== at 0xC97B52: D4vibe5utils6memory110T11FreeListRefTS4vibe4core6stream12OutputStream12writeDefaultMFC4vibe4core6stream11InputStreammZ6BufferVbi0Z11FreeListRef11T6opCallZ6opCallFNbZS4vibe5utils6memory110T11FreeListRefTS4vibe4core6stream12OutputStream12writeDefaultMFC4vibe4core6stream11InputStreammZ6BufferVbi0Z11FreeListRef (../../.dub/packages/vibe-d-0.7.27/source/vibe/utils/memory.d:694)
==5411== Address 0x1899e270 is 0 bytes after a block of size 65,552 alloc'd
==5411== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload
memcheck-amd64-linux.so)
==5411==
==5411== Invalid read of size 4
==5411== at 0xC97AC2: D4vibe5utils6memory110T11FreeListRefTS4vibe4core6stream12OutputStream12writeDefaultMFC4vibe4core6stream11InputStreammZ6BufferVbi0Z11FreeListRef15checkInvariantsMxFNaNbNiZv (../../.dub/packages/vibe-d-0.7.27/source/vibe/utils/memory.d:753)
==5411== Address 0x1899e270 is 0 bytes after a block of size 65,552 alloc'd
==5411== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload
memcheck-amd64-linux.so)
==5411==
==5411== Invalid read of size 4
==5411== at 0xC97988: D4vibe5utils6memory110T11FreeListRefTS4vibe4core6stream12OutputStream12writeDefaultMFC4vibe4core6stream11InputStreammZ6BufferVbi0Z11FreeListRef5clearMFNbNiZv (../../.dub/packages/vibe-d-0.7.27/source/vibe/utils/memory.d:732)
==5411== Address 0x1899e270 is 0 bytes after a block of size 65,552 alloc'd
==5411== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload
memcheck-amd64-linux.so)
==5411==
==5411== Invalid read of size 4
==5411== at 0xC9798A: D4vibe5utils6memory110T11FreeListRefTS4vibe4core6stream12OutputStream12writeDefaultMFC4vibe4core6stream11InputStreammZ6BufferVbi0Z11FreeListRef5clearMFNbNiZv (../../.dub/packages/vibe-d-0.7.27/source/vibe/utils/memory.d:732)
==5411== Address 0x1899e270 is 0 bytes after a block of size 65,552 alloc'd
==5411== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload
memcheck-amd64-linux.so)

Question: is this a bug (found nothing in the bugtracker) or is it safe to add a rule to the suppression file?

Re: valgrind reports "Invalid write of size 4" in vibe/utils/memory.d

In cases anyone has the same questing and finds this thread: https://github.com/rejectedsoftware/vibe.d/issues/1432