Closed GoogleCodeExporter closed 8 years ago
Hello! Probably you are the first one trying redis on a 64-bit system... First
of all
thank you for the patch! I'll release beta-5 immediately with the only change
of this
fix and make beta-4 deprecated. Please, could you run the redis server under
'valgrind' in your system and run make test against to check if there are subtle
errors running Redis in a 64bit system? Thanks again.
I'll close the issue once beta-5 will be online.
Original comment by anti...@gmail.com
on 3 Mar 2009 at 6:42
valgrind shows no errors, with one "possibly lost" leak
==12996== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 8 from 1)
==12996== malloc/free: in use at exit: 661,072 bytes in 22,061 blocks.
==12996== malloc/free: 452,606 allocs, 430,545 frees, 25,289,432 bytes
allocated.
==12996== For counts of detected errors, rerun with: -v
==12996== searching for pointers to 22,061 not-freed blocks.
==12996== checked 553,752 bytes.
==12996==
==12996== 256 bytes in 12 blocks are possibly lost in loss record 7 of 10
==12996== at 0x4C265AE: malloc (vg_replace_malloc.c:207)
==12996== by 0x408A16: sdsnewlen (sds.c:43)
==12996== by 0x4066ED: main (redis.c:537)
==12996==
==12996== LEAK SUMMARY:
==12996== definitely lost: 0 bytes in 0 blocks.
==12996== possibly lost: 256 bytes in 12 blocks.
==12996== still reachable: 660,816 bytes in 22,049 blocks.
==12996== suppressed: 0 bytes in 0 blocks.
==12996== Reachable blocks (those to which a pointer was found) are not shown.
Original comment by brettben...@gmail.com
on 4 Mar 2009 at 9:06
Thanks brettbender! Actually this 'possibly lost' bytes are ok.
This is a problem due to the sds library, that is my own dynamically allocated
string
library. In my design I opted to have something like this in the allocation
structure
of every string:
+----------+--------...
| metadata | string data
+----------+--------...
The returned pointer is at the start of string data, so Sds strings even if are
able to do all the stuff a dynamic string library is able to do, they look like
a plain C string, and you can pass an Sds string to every plain C function
accepting a C string.
What's wrong with this design is that the actual address returned by malloc()
is not stored in the pointer, I just take pointers to the address +
sizeof(sdsheader). And valgrind think this bytes may be lost.
Thank you very much!
antirez
Original comment by anti...@gmail.com
on 4 Mar 2009 at 9:18
Original issue reported on code.google.com by
brettben...@gmail.com
on 3 Mar 2009 at 6:02Attachments: