c++ - Error message glibc detected Malloc(): memory corruption (fast) -


i got error. weird thing is, not getting error message...

*** glibc detected *** ./a.out: malloc(): memory corruption (fast): 0x0000000002134dc0 *** ======= backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x76a16)[0x7fa62b164a16] /lib/x86_64-linux-gnu/libc.so.6(+0x7a2f8)[0x7fa62b1682f8] /lib/x86_64-linux-gnu/libc.so.6(__libc_malloc+0x70)[0x7fa62b1698a0] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(_znwm+0x1d)[0x7fa62b97607d] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(_znss4_rep9_s_createemmrksaice+0x59)[0x7fa62b9d1999] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(_znss4_rep8_m_cloneerksaicem+0x28)[0x7fa62b9d2708] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(_znss7reserveem+0x30)[0x7fa62b9d27f0] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(_znss6appendepkcm+0xb5)[0x7fa62b9d2ab5] ./a.out[0x40758f] ./a.out[0x403279] ./a.out[0x405202] ./a.out[0x406332] ./a.out[0x406c90] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd)[0x7fa62b10cead] ./a.out[0x402189] ======= memory map: ======== 00400000-0040e000 r-xp 00000000 08:05 6166978                            /root/tradingbot/bot2/a.out 0060d000-0060e000 rw-p 0000d000 08:05 6166978                            /root/tradingbot/bot2/a.out 02132000-02153000 rw-p 00000000 00:00 0                                  [heap] 7fa624000000-7fa624021000 rw-p 00000000 00:00 0  7fa624021000-7fa628000000 ---p 00000000 00:00 0  7fa62b0ee000-7fa62b270000 r-xp 00000000 08:05 12715768                   /lib/x86_64-linux-gnu/libc-2.13.so 7fa62b270000-7fa62b470000 ---p 00182000 08:05 12715768                   /lib/x86_64-linux-gnu/libc-2.13.so 7fa62b470000-7fa62b474000 r--p 00182000 08:05 12715768                   /lib/x86_64-linux-gnu/libc-2.13.so 7fa62b474000-7fa62b475000 rw-p 00186000 08:05 12715768                   /lib/x86_64-linux-gnu/libc-2.13.so 7fa62b475000-7fa62b47a000 rw-p 00000000 00:00 0  7fa62b47a000-7fa62b48f000 r-xp 00000000 08:05 12715492                   /lib/x86_64-linux-gnu/libgcc_s.so.1 7fa62b48f000-7fa62b68f000 ---p 00015000 08:05 12715492                   /lib/x86_64-linux-gnu/libgcc_s.so.1 7fa62b68f000-7fa62b690000 rw-p 00015000 08:05 12715492                   /lib/x86_64-linux-gnu/libgcc_s.so.1 7fa62b690000-7fa62b711000 r-xp 00000000 08:05 12715766                   /lib/x86_64-linux-gnu/libm-2.13.so 7fa62b711000-7fa62b910000 ---p 00081000 08:05 12715766                   /lib/x86_64-linux-gnu/libm-2.13.so 7fa62b910000-7fa62b911000 r--p 00080000 08:05 12715766                   /lib/x86_64-linux-gnu/libm-2.13.so 7fa62b911000-7fa62b912000 rw-p 00081000 08:05 12715766                   /lib/x86_64-linux-gnu/libm-2.13.so 7fa62b912000-7fa62b9fa000 r-xp 00000000 08:05 7345862                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.17 7fa62b9fa000-7fa62bbfa000 ---p 000e8000 08:05 7345862                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.17 7fa62bbfa000-7fa62bc02000 r--p 000e8000 08:05 7345862                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.17 7fa62bc02000-7fa62bc04000 rw-p 000f0000 08:05 7345862                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.17 7fa62bc04000-7fa62bc19000 rw-p 00000000 00:00 0  7fa62bc19000-7fa62bc39000 r-xp 00000000 08:05 12715773                   /lib/x86_64-linux-gnu/ld-2.13.so 7fa62be10000-7fa62be15000 rw-p 00000000 00:00 0  7fa62be35000-7fa62be38000 rw-p 00000000 00:00 0  7fa62be38000-7fa62be39000 r--p 0001f000 08:05 12715773                   /lib/x86_64-linux-gnu/ld-2.13.so 7fa62be39000-7fa62be3a000 rw-p 00020000 08:05 12715773                   /lib/x86_64-linux-gnu/ld-2.13.so 7fa62be3a000-7fa62be3b000 rw-p 00000000 00:00 0  7fffb0149000-7fffb016a000 rw-p 00000000 00:00 0                          [stack] 7fffb019f000-7fffb01a1000 r-xp 00000000 00:00 0                          [vdso] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall] aborted 

here doing...

i creating n objects of class dynamically , storing them in vector (c++). iterator access each object, , deference access object's members. reading text files, edited them hand during runtime. don't know part of code should place here, crashed exactly:

if( last_op_number == 1 ){      = n_bots.end();// grabs iterator , go end of vector; last op1 bot located     bot *botop1 = &(*it); // dereference iterator have pointer specific bot      /* 3) set real buy , sell prices */     botop1->real_bpsp(price_ex1,price_ex2); }  // clear text files okc->clear_pos(); okc2->clear_pos(); updates_balance(); // updates balances  green_light = 1; // tell bot manager go! 

any ideas of what's going on?

thank you!

you should use n_bots.back() instead of n_bots.end().


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -