Help I get this ***glib detected*** double free or corruption

I'm getting this message when I run my code, but it happens really randomly, i have try with valgrind but it does not happens there for some reason I think that is because it uses single thread and that prevents it, how could I fix it??. Thanks.

the output of valgrind:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
                                                                                                                                                                                        
--918-- Reading syms from /home/alonsode/tmp/pagan/src/pagan (0x400000)         
--918-- Reading syms from /usr/lib64/valgrind/memcheck-amd64-linux (0x38000000) 
--918--    object doesn't have a dynamic symbol table                           
--918-- Reading syms from /lib64/ld-2.12.so (0x35aa200000)                      
--918-- Reading suppressions file: /usr/lib64/valgrind/default.supp             
--918-- REDIR: 0x35aa2173a0 (strlen) redirected to 0x38042ae7 (vgPlain_amd64_linux_REDIR_FOR_strlen)                                                            
--918-- Reading syms from /usr/lib64/valgrind/vgpreload_core-amd64-linux.so (0x4801000)                                                                         
--918-- Reading syms from /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so (0x4a02000)                                                                     
==918== WARNING: new redirection conflicts with existing -- ignoring it         
--918--     new: 0x35aa2173a0 (strlen              ) R-> 0x04a07830 strlen      
--918-- REDIR: 0x35aa217210 (index) redirected to 0x4a07470 (index)             
--918-- REDIR: 0x35aa217290 (strcmp) redirected to 0x4a07df0 (strcmp)           
--918-- Reading syms from /usr/lib64/libboost_program_options-mt.so.5 (0x35aca00000)                                                                            
--918--    object doesn't have a symbol table                                   
--918-- Reading syms from /usr/lib64/libboost_regex-mt.so.5 (0x4c2b000)         
--918--    object doesn't have a symbol table                                   
--918-- Reading syms from /usr/lib64/libboost_thread-mt.so.5 (0x4f1f000)        
--918--    object doesn't have a symbol table                                   
--918-- Reading syms from /usr/lib64/libstdc++.so.6.0.13 (0x35b1200000)         
--918--    object doesn't have a symbol table                                   
--918-- Reading syms from /lib64/libm-2.12.so (0x35aae00000)                    
--918-- Reading syms from /lib64/libgcc_s-4.4.5-20110214.so.1 (0x35b0e00000)    
--918--    object doesn't have a symbol table                                   
--918-- Reading syms from /lib64/libc-2.12.so (0x35aaa00000)                    
--918-- Reading syms from /lib64/libpthread-2.12.so (0x35ab600000)              
--918-- Reading syms from /lib64/librt-2.12.so (0x35abe00000)                   
--918-- Reading syms from /usr/lib64/libicuuc.so.42.1 (0x35b8e00000)            
--918--    object doesn't have a symbol table                                   
--918-- Reading syms from /usr/lib64/libicui18n.so.42.1 (0x35c0200000)          
--918--    object doesn't have a symbol table                                   
--918-- Reading syms from /usr/lib64/libicudata.so.42.1 (0x35bca00000)          
--918--    object doesn't have a symbol table                                   
--918-- REDIR: 0x35aaa83500 (strcasecmp) redirected to 0x4801560 (_vgnU_ifunc_wrapper)                                                                          
--918-- REDIR: 0x35aaa857c0 (strncasecmp) redirected to 0x4801560 (_vgnU_ifunc_wrapper)                                                                         
--918-- REDIR: 0x35aaa81470 (__GI_strrchr) redirected to 0x4a072f0 (__GI_strrchr)                                                                               
--918-- REDIR: 0x35aaa7fa20 (__GI_strlen) redirected to 0x4a077f0 (__GI_strlen) 
--918-- REDIR: 0x35aaa7dfb0 (strcmp) redirected to 0x4801560 (_vgnU_ifunc_wrapper)                                                                              
--918-- REDIR: 0x35aab246a0 (__strcmp_sse42) redirected to 0x4a07d50 (strcmp)   
--918-- REDIR: 0x35aaa7f9f0 (strlen) redirected to 0x4801560 (_vgnU_ifunc_wrapper)                                                                              
--918-- REDIR: 0x35aab25540 (__strlen_sse42) redirected to 0x4a077d0 (strlen)   
--918-- REDIR: 0x35b12bd0a0 (operator new(unsigned long)) redirected to 0x4a06bc0 (operator new(unsigned long))                                                 
--918-- REDIR: 0x35aaa87ea0 (memcpy) redirected to 0x4a07ec0 (memcpy)           
--918-- REDIR: 0x35aaa790e0 (calloc) redirected to 0x4a04900 (calloc)           
--918-- REDIR: 0x35aaa81b80 (memchr) redirected to 0x4a07e90 (memchr)           
--918-- REDIR: 0x35aaa82030 (memmove) redirected to 0x4a08ed0 (memmove)         
--918-- REDIR: 0x35b12bb310 (operator delete(void*)) redirected to 0x4a05390 (operator delete(void*))                                                           
--918-- REDIR: 0x35aaa89320 (strchrnul) redirected to 0x4a08f40 (strchrnul)     
--918-- REDIR: 0xffffffffff600400 (???) redirected to 0x38042add (vgPlain_amd64_linux_REDIR_FOR_vtime)                                                          
 running this many threads                                                      
 threads 5                                                                      
--918-- REDIR: 0x35aaa794a0 (malloc) redirected to 0x4a05f10 (malloc)           
--918-- REDIR: 0x35b12bd1d0 (operator new[](unsigned long)) redirected to 0x4a06680 (operator new[](unsigned long))                                             
--918-- REDIR: 0x35b12bb350 (operator delete[](void*)) redirected to 0x4a04d90 (operator delete[](void*))                                                       
--918-- REDIR: 0x35aaa7a220 (free) redirected to 0x4a05890 (free)               
--918-- REDIR: 0x35aaa82d30 (mempcpy) redirected to 0x4a08fb0 (mempcpy)         
                                                         
--918-- REDIR: 0x35aaa7f470 (__GI_strcpy) redirected to 0x4a07920 (__GI_strcpy) 
--918-- REDIR: 0x35aaa7dff0 (__GI_strcmp) redirected to 0x4a07da0 (__GI_strcmp) 
--918-- REDIR: 0x35aaa7fa70 (strnlen) redirected to 0x4a07770 (strnlen)         

--918-- REDIR: 0x35aaa81c00 (bcmp) redirected to 0x4801560 (_vgnU_ifunc_wrapper)
--918-- REDIR: 0x35aab3aa10 (__memcmp_sse4_1) redirected to 0x4a08a50 (bcmp)    
 this alignment done #1# Homo_sapiens_1 1 Pan_troglodytes_1 1                   
                                      
==918== HEAP SUMMARY:
==918==     in use at exit: 8 bytes in 1 blocks
==918==   total heap usage: 8,469 allocs, 8,468 frees, 6,135,988 bytes allocated
==918==
==918== Searching for pointers to 1 not-freed blocks
==918== Checked 422,568 bytes
==918==
==918== 8 bytes in 1 blocks are still reachable in loss record 1 of 1
==918==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
==918==    by 0x4F2EF29: boost::detail::get_once_per_thread_epoch() (in /usr/lib64/libboost_thread-mt.so.5)
==918==    by 0x4F2985F: ??? (in /usr/lib64/libboost_thread-mt.so.5)
==918==    by 0x4F29968: boost::detail::get_current_thread_data() (in /usr/lib64/libboost_thread-mt.so.5)
==918==    by 0x4F29AC8: boost::this_thread::interruption_enabled() (in /usr/lib64/libboost_thread-mt.so.5)
==918==    by 0x4F29AE8: boost::this_thread::disable_interruption::disable_interruption() (in /usr/lib64/libboost_thread-mt.so.5)
==918==    by 0x419750: boost::shared_mutex::lock() (shared_mutex.hpp:129)
==918==    by 0x420EC9: boost::lock_guard<boost::shared_mutex>::lock_guard(boost::shared_mutex&) (locks.hpp:194)
==918==    by 0x422365: boost::thread* boost::thread_group::create_thread<boost::_bi::bind_t<void, void (*)(ppa::Model_factory&), boost::_bi::list1<boost::reference_wrapper<ppa::Model_factory> > > >(boost::_bi::bind_t<void, void (*)(ppa::Model_factory&), boost::_bi::list1<boost::reference_wrapper<ppa::Model_factory> > >) (thread_group.hpp:38)
==918==    by 0x4146CA: main (main.cpp:600)
==918==
==918== LEAK SUMMARY:
==918==    definitely lost: 0 bytes in 0 blocks
==918==    indirectly lost: 0 bytes in 0 blocks
==918==      possibly lost: 0 bytes in 0 blocks
==918==    still reachable: 8 bytes in 1 blocks
==918==         suppressed: 0 bytes in 0 blocks
==918==
==918== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 6 from 6)
--918--
--918-- used_suppression:      6 dl-hack3-cond-1
==918==
==918== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 6 from 6) 
More data to see if this helps:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 running this many threads
 threads 9

PAGAN v.0.4 (4 June, 2012). (C) 2010-2012 by Ari Löytynoja <ari.loytynoja@gmail.com>.
 This program is provided "as-is", with NO WARRANTY whatsoever; this is a development version
 and may contain bugs.

The analysis started: Tue Aug  7 10:22:06 2012

*** glibc detected *** /home/alonsode/tmp/pagan/src/pagan: double free or corruption (fasttop): 0x00007fe55c000950 ***
======= Backtrace: =========
/lib64/libc.so.6[0x35aaa75146]
/home/alonsode/tmp/pagan/src/pagan[0x42fa9e]
/home/alonsode/tmp/pagan/src/pagan[0x42ecaa]
/home/alonsode/tmp/pagan/src/pagan(_ZNSt6vectorISsSaISsEE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPSsS1_EERKSs+0x263)[0x42e06f]
/home/alonsode/tmp/pagan/src/pagan(_ZNSt6vectorISsSaISsEE9push_backERKSs+0x78)[0x42d3d0]
/home/alonsode/tmp/pagan/src/pagan[0x452fa2]
/home/alonsode/tmp/pagan/src/pagan[0x4870e8]
/home/alonsode/tmp/pagan/src/pagan[0x4891c7]
/home/alonsode/tmp/pagan/src/pagan[0x41b093]
/home/alonsode/tmp/pagan/src/pagan[0x41af53]
/home/alonsode/tmp/pagan/src/pagan[0x41b29b]
/home/alonsode/tmp/pagan/src/pagan[0x41144b]
/home/alonsode/tmp/pagan/src/pagan[0x42b2be]
/home/alonsode/tmp/pagan/src/pagan[0x42b24b]
/home/alonsode/tmp/pagan/src/pagan[0x42b0b6]
/usr/lib64/libboost_thread-mt.so.5(thread_proxy+0x77)[0x7fe57fc3ed97]
/lib64/libpthread.so.0[0x35ab6077e1]
/lib64/libc.so.6(clone+0x6d)[0x35aaae577d]
======= Memory map: ========
00400000-00538000 r-xp 00000000 fd:03 5381445                            /home/alonsode/tmp/pagan/src/pagan
00738000-00739000 rw-p 00138000 fd:03 5381445                            /home/alonsode/tmp/pagan/src/pagan
00739000-0073a000 rw-p 00000000 00:00 0 
01959000-022dd000 rw-p 00000000 00:00 0 


etc...
Nvm I think I got it, (:
Topic archived. No new replies allowed.