g1mv / density

Superfast compression library
Apache License 2.0
1.02k stars 48 forks source link

Memory leaks in dev branch #19

Closed nemequ closed 9 years ago

nemequ commented 9 years ago

During compression:

==32661== 4,096 bytes in 1 blocks are definitely lost in loss record 21 of 22
==32661==    at 0x482E364: malloc (vg_replace_malloc.c:292)
==32661==    by 0x4D8F63F: density_memory_teleport_allocate (memory_teleport.c:40)
==32661==    by 0x4D8FD93: density_stream_create (stream.c:40)
==32661==    by 0x4D8095F: squash_density_create_stream (squash-density.c:213)
==32661==    by 0x486264F: squash_codec_create_stream_with_options (codec.c:507)
==32661==    by 0x4862F4B: squash_codec_process_file_with_options (codec.c:1064)
==32661==    by 0x486308D: squash_codec_compress_file_with_options (codec.c:1137)
==32661==    by 0x9879: main (squash.c:290)
==32661== 
==32661== 262,172 bytes in 1 blocks are possibly lost in loss record 22 of 22
==32661==    at 0x482E364: malloc (vg_replace_malloc.c:292)
==32661==    by 0x4D8F35D: density_encode_init (main_encode.c:87)
==32661==    by 0x4D8FE81: density_stream_compress_init (stream.c:98)
==32661==    by 0x4D805F1: squash_density_process_stream (squash-density.c:406)
==32661==    by 0x4866125: squash_stream_process_internal (stream.c:515)
==32661==    by 0x48662CF: squash_stream_process (stream.c:621)
==32661==    by 0x4862FC5: squash_codec_process_file_with_options (codec.c:1087)
==32661==    by 0x486308D: squash_codec_compress_file_with_options (codec.c:1137)
==32661==    by 0x9879: main (squash.c:290)

And decompression:

==629== 4,096 bytes in 1 blocks are definitely lost in loss record 21 of 21
==629==    at 0x482E364: malloc (vg_replace_malloc.c:292)
==629==    by 0x4D8F63F: density_memory_teleport_allocate (memory_teleport.c:40)
==629==    by 0x4D8FD93: density_stream_create (stream.c:40)
==629==    by 0x4D8095F: squash_density_create_stream (squash-density.c:213)
==629==    by 0x486264F: squash_codec_create_stream_with_options (codec.c:507)
==629==    by 0x4862F4B: squash_codec_process_file_with_options (codec.c:1064)
==629==    by 0x48630B9: squash_codec_decompress_file_with_options (codec.c:1162)
==629==    by 0x988D: main (squash.c:292)
g1mv commented 9 years ago

Fixed in 43f09a98a52d03dbb7264baf301f1b18367bbf8e

nemequ commented 9 years ago

With this applied I am able to successfully compress and decompress all the files in squash-benchmark, as well as all the unit tests in squash, on my ODROID C1.

g1mv commented 9 years ago

Ok I've done testing on my side so unless you fall on something unwanted on your side with the latest dev branch, it's a go ! Thanks

nemequ commented 9 years ago

Ok I've done testing on my side so unless you fall on something unwanted on your side with the latest dev branch, it's a go ! Thanks

I've done all the testing I have ready to go (unit tests and squash-benchmark are pretty much it, though those are often enough to reveal problems). The only other thing I really want to do is run it through a fuzzer, but I don't plan on doing that until I get a squash release out the door.

g1mv commented 9 years ago

Released 0.12.0 beta. I linked to Squash here http://encode.ru/threads/2155-Density-0-12-0-beta, I hope that's ok for you !