*** glibc detected *** ./test: free(): invalid pointer: 0x000000000146f070 *** ======= Backtrace: ========= /lib64/libc.so.6(+0x76156)[0x7f0cad321156] /lib64/libc.so.6(cfree+0x6c)[0x7f0cad325fdc] ./test[0x4d47e0] ./test[0x4d5f42] ./test[0x4a7636] ./test[0x4a78c4] ./test[0x440e05] ======= Memory map: ======== 00400000-0050f000 r-xp 00000000 08:03 1326389 /home/elliot/test 0070e000-0070f000 r-xp 0010e000 08:03 1326389 /home/elliot/test 0070f000-00723000 rwxp 0010f000 08:03 1326389 /home/elliot/test 00723000-0072c000 rwxp 00000000 00:00 0 0146f000-014d5000 rwxp 00000000 00:00 0 [heap] 7f0ca0000000-7f0ca0021000 rwxp 00000000 00:00 0 7f0ca0021000-7f0ca4000000 ---p 00000000 00:00 0 7f0ca4fea000-7f0ca4fff000 r-xp 00000000 08:03 130827 /lib64/libgcc_s.so.1 7f0ca4fff000-7f0ca51fe000 ---p 00015000 08:03 130827 /lib64/libgcc_s.so.1 7f0ca51fe000-7f0ca51ff000 r-xp 00014000 08:03 130827 /lib64/libgcc_s.so.1 7f0ca51ff000-7f0ca5200000 rwxp 00015000 08:03 130827 /lib64/libgcc_s.so.1 7f0ca5200000-7f0cab500000 rwxp 00000000 00:00 0 7f0cab5fb000-7f0cab5fc000 ---p 00000000 00:00 0 7f0cab5fc000-7f0cabdfc000 rwxp 00000000 00:00 0 7f0cabdfc000-7f0cabdfe000 r-xp 00000000 08:03 655749 /usr/lib64/gconv/UTF-32.so 7f0cabdfe000-7f0cabffd000 ---p 00002000 08:03 655749 /usr/lib64/gconv/UTF-32.so 7f0cabffd000-7f0cabffe000 r-xp 00001000 08:03 655749 /usr/lib64/gconv/UTF-32.so 7f0cabffe000-7f0cabfff000 rwxp 00002000 08:03 655749 /usr/lib64/gconv/UTF-32.so 7f0cabfff000-7f0cac000000 ---p 00000000 00:00 0 7f0cac000000-7f0caca00000 rwxp 00000000 00:00 0 7f0cacaaa000-7f0cacaab000 ---p 00000000 00:00 0 7f0cacaab000-7f0cad2ab000 rwxp 00000000 00:00 0 7f0cad2ab000-7f0cad42d000 r-xp 00000000 08:03 130903 /lib64/libc-2.13.so 7f0cad42d000-7f0cad62d000 ---p 00182000 08:03 130903 /lib64/libc-2.13.so 7f0cad62d000-7f0cad631000 r-xp 00182000 08:03 130903 /lib64/libc-2.13.so 7f0cad631000-7f0cad632000 rwxp 00186000 08:03 130903 /lib64/libc-2.13.so 7f0cad632000-7f0cad637000 rwxp 00000000 00:00 0 7f0cad637000-7f0cad64f000 r-xp 00000000 08:03 130820 /lib64/libpthread-2.13.so 7f0cad64f000-7f0cad84e000 ---p 00018000 08:03 130820 /lib64/libpthread-2.13.so 7f0cad84e000-7f0cad84f000 r-xp 00017000 08:03 130820 /lib64/libpthread-2.13.so 7f0cad84f000-7f0cad850000 rwxp 00018000 08:03 130820 /lib64/libpthread-2.13.so 7f0cad850000-7f0cad854000 rwxp 00000000 00:00 0 7f0cad854000-7f0cad8d6000 r-xp 00000000 08:03 131123 /lib64/libm-2.13.so 7f0cad8d6000-7f0cadad5000 ---p 00082000 08:03 131123 /lib64/libm-2.13.so 7f0cadad5000-7f0cadad6000 r-xp 00081000 08:03 131123 /lib64/libm-2.13.so 7f0cadad6000-7f0cadad7000 rwxp 00082000 08:03 131123 /lib64/libm-2.13.so 7f0cadad7000-7f0cadb3d000 r-xp 00000000 08:03 394652 /usr/lib64/libgmp.so.10.0.2 7f0cadb3d000-7f0cadd3c000 ---p 00066000 08:03 394652 /usr/lib64/libgmp.so.10.0.2 7f0cadd3c000-7f0cadd3d000 r-xp 00065000 08:03 394652 /usr/lib64/libgmp.so.10.0.2 7f0cadd3d000-7f0cadd46000 rwxp 00066000 08:03 394652 /usr/lib64/libgmp.so.10.0.2 7f0cadd46000-7f0cadd48000 r-xp 00000000 08:03 131126 /lib64/libdl-2.13.so 7f0cadd48000-7f0cadf48000 ---p 00002000 08:03 131126 /lib64/libdl-2.13.so 7f0cadf48000-7f0cadf49000 r-xp 00002000 08:03 131126 /lib64/libdl-2.13.so 7f0cadf49000-7f0cadf4a000 rwxp 00003000 08:03 131126 /lib64/libdl-2.13.so 7f0cadf4a000-7f0cadf4c000 r-xp 00000000 08:03 130905 /lib64/libutil-2.13.so 7f0cadf4c000-7f0cae14b000 ---p 00002000 08:03 130905 /lib64/libutil-2.13.so 7f0cae14b000-7f0cae14c000 r-xp 00001000 08:03 130905 /lib64/libutil-2.13.so 7f0cae14c000-7f0cae14d000 rwxp 00002000 08:03 130905 /lib64/libutil-2.13.so 7f0cae14d000-7f0cae155000 r-xp 00000000 08:03 131097 /lib64/librt-2.13.so 7f0cae155000-7f0cae354000 ---p 00008000 08:03 131097 /lib64/librt-2.13.so 7f0cae354000-7f0cae355000 r-xp 00007000 08:03 131097 /lib64/librt-2.13.so 7f0cae355000-7f0cae356000 rwxp 00008000 08:03 131097 /lib64/librt-2.13.so 7f0cae356000-7f0cae375000 r-xp 00000000 08:03 130842 /lib64/ld-2.13.so 7f0cae559000-7f0cae55e000 rwxp 00000000 00:00 0 7f0cae56d000-7f0cae574000 r-xs 00000000 08:03 655767 /usr/lib64/gconv/gconv-modules.cache 7f0cae574000-7f0cae575000 rwxp 00000000 00:00 0 7f0cae575000-7f0cae576000 r-xp 0001f000 08:03 130842 /lib64/ld-2.13.so 7f0cae576000-7f0cae577000 rwxp 00020000 08:03 130842 /lib64/ld-2.13.so 7f0cae577000-7f0cae578000 rwxp 00000000 00:00 0 7fffc02aa000-7fffc02cb000 rwxp 00000000 00:00 0 [stack] 7fffc03ff000-7fffc0400000 r-xp 00000000 00:00 0 [vdso] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] Aborted