Skip to content

double free or corruption (fasttop) #18

Description

@ChinaChenp

hi,i use you source code , but when i test many times, it will case a bug like this:

*** Error in `./../../build64_release/cplusutils/lrucache/lrucache_test': corrupted double-linked list: 0x00007f03c80008d0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7b9e3)[0x7f04bf1a69e3]
/lib64/libc.so.6(+0x7c4fe)[0x7f04bf1a74fe]
./../../build64_release/cplusutils/lrucache/lrucache_test[0x40d1a4]
/lib64/libstdc++.so.6(+0xb52b0)[0x7f04bfabb2b0]
/lib64/libpthread.so.0(+0x7e25)[0x7f04bfd15e25]
/lib64/libc.so.6(clone+0x6d)[0x7f04bf22334d]

I finnally find the two members define order is wrong:
Map cache_;
list_type keys_;

I think correct should be like this:
list_type keys_;
Map cache_;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions