I've already ran the following command and killed all the leaks and errors reported to it, but I am still getting some random free(): invalid pointer AFTER the program finished executing.
valgrind -v --tool=memcheck --leak-check=full --track-origins=yes --show-reachable=yes ./blah
Here is the output after I fixed "everything":
--31313-- Discarding syms at 0x883f1f0-0x8847648 in /lib64/libnss_files-2.12.so due to munmap()
--31313-- Discarding syms at 0x8a4c000-0x8a4f328 in /lib64/libnss_dns-2.12.so due to munmap()
--31313-- Discarding syms at 0x8c54930-0x8c63938 in /lib64/libresolv-2.12.so due to munmap()
==31313==
==31313== HEAP SUMMARY:
==31313== in use at exit: 0 bytes in 0 blocks
==31313== total heap usage: 9,190 allocs, 9,190 frees, 1,286,890 bytes allocated
==31313==
==31313== All heap blocks were freed -- no leaks are possible
==31313==
==31313== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 8 from 6)
--31313--
--31313-- used_suppression: 6 U1004-ARM-_dl_relocate_object
--31313-- used_suppression: 2 glibc-2.5.x-on-SUSE-10.2-(PPC)-2a
==31313==
==31313== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 8 from 6)
What else can I try to track this random + AFTER my program executed, mysterious invalid free?
EDIT:
The last 2 lines before it exit...
applog("GODDAMN IT");
return final_rc;
}
Here is the "notification" that I get for the free: invalid pointer:
GODDAMN IT
*** glibc detected *** ./scvpc: free(): invalid pointer: 0x00007f7975fbd6d0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x373e876166)[0x7f7974134166]
/home/svn/trunk/packages/wvstreams/libwvbase.so.5.2.0(_ZN12WvFastString6unlinkEv+0x1e)[0x7f7975d725be]
/home/svn/trunk/packages/wvstreams/libwvbase.so.5.2.0(_ZN8WvStreamD1Ev+0x491)[0x7f7975d81481]
/lib64/libc.so.6(__cxa_finalize+0x9d)[0x7f79740f41bd]
/home/svn/trunk/packages/wvstreams/libwvbase.so.5.2.0(+0x31e56)[0x7f7975d69e56]
======= Memory map: ========
7f796c000000-7f796c021000 rw-p 00000000 00:00 0
7f796c021000-7f7970000000 ---p 00000000 00:00 0
7f7972180000-7f7972196000 r-xp 00000000 fd:00 406206 /lib64/libresolv-2.12.so
7f7972196000-7f7972396000 ---p 00016000 fd:00 406206 /lib64/libresolv-2.12.so
7f7972396000-7f7972397000 r--p 00016000 fd:00 406206 /lib64/libresolv-2.12.so
7f7972397000-7f7972398000 rw-p 00017000 fd:00 406206 /lib64/libresolv-2.12.so
7f7972398000-7f797239a000 rw-p 00000000 00:00 0
7f797239a000-7f797239f000 r-xp 00000000 fd:00 390955 /lib64/libnss_dns-2.12.so
7f797239f000-7f797259e000 ---p 00005000 fd:00 390955 /lib64/libnss_dns-2.12.so
7f797259e000-7f797259f000 r--p 00004000 fd:00 390955 /lib64/libnss_dns-2.12.so
7f797259f000-7f79725a0000 rw-p 00005000 fd:00 390955 /lib64/libnss_dns-2.12.so
7f79725a0000-7f79725ac000 r-xp 00000000 fd:00 390957 /lib64/libnss_files-2.12.so
7f79725ac000-7f79727ac000 ---p 0000c000 fd:00 390957 /lib64/libnss_files-2.12.so
7f79727ac000-7f79727ad000 r--p 0000c000 fd:00 390957 /lib64/libnss_files-2.12.so
7f79727ad000-7f79727ae000 rw-p 0000d000 fd:00 390957 /lib64/libnss_files-2.12.so
7f79727ae000-7f79727af000 ---p 00000000 00:00 0
7f79727af000-7f79731af000 rw-p 00000000 00:00 0
7f79731af000-7f7973220000 r-xp 00000000 fd:00 392042 /lib64/libfreebl3.so
7f7973220000-7f797341f000 ---p 00071000 fd:00 392042 /lib64/libfreebl3.so
7f797341f000-7f7973421000 r--p 00070000 fd:00 392042 /lib64/libfreebl3.so
7f7973421000-7f7973422000 rw-p 00072000 fd:00 392042 /lib64/libfreebl3.so
7f7973422000-7f7973426000 rw-p 00000000 00:00 0
7f7973426000-7f797343d000 r-xp 00000000 fd:00 392038 /lib64/libaudit.so.1.0.0
7f797343d000-7f797363c000 ---p 00017000 fd:00 392038 /lib64/libaudit.so.1.0.0
7f797363c000-7f797363d000 r--p 00016000 fd:00 392038 /lib64/libaudit.so.1.0.0
7f797363d000-7f7973642000 rw-p 00017000 fd:00 392038 /lib64/libaudit.so.1.0.0
7f7973642000-7f7973644000 r-xp 00000000 fd:00 392041 /lib64/libdl-2.12.so
7f7973644000-7f7973844000 ---p 00002000 fd:00 392041 /lib64/libdl-2.12.so
7f7973844000-7f7973845000 r--p 00002000 fd:00 392041 /lib64/libdl-2.12.so
7f7973845000-7f7973846000 rw-p 00003000 fd:00 392041 /lib64/libdl-2.12.so
7f7973846000-7f797384d000 r-xp 00000000 fd:00 392043 /lib64/libcrypt-2.12.so
7f797384d000-7f7973a4d000 ---p 00007000 fd:00 392043 /lib64/libcrypt-2.12.so
7f7973a4d000-7f7973a4e000 r--p 00007000 fd:00 392043 /lib64/libcrypt-2.12.so
7f7973a4e000-7f7973a4f000 rw-p 00008000 fd:00 392043 /lib64/libcrypt-2.12.so
7f7973a4f000-7f7973a7d000 rw-p 00000000 00:00 0
7f7973a7d000-7f7973a89000 r-xp 00000000 fd:00 392044 /lib64/libpam.so.0.82.2
7f7973a89000-7f7973c89000 ---p 0000c000 fd:00 392044 /lib64/libpam.so.0.82.2
7f7973c89000-7f7973c8a000 r--p 0000c000 fd:00 392044 /lib64/libpam.so.0.82.2
7f7973c8a000-7f7973c8b000 rw-p 0000d000 fd:00 392044 /lib64/libpam.so.0.82.2
7f7973c8b000-7f7973ca2000 r-xp 00000000 fd:00 392046 /lib64/libpthread-2.12.so
7f7973ca2000-7f7973ea2000 ---p 00017000 fd:00 392046 /lib64/libpthread-2.12.so
7f7973ea2000-7f7973ea3000 r--p 00017000 fd:00 392046 /lib64/libpthread-2.12.so
7f7973ea3000-7f7973ea4000 rw-p 00018000 fd:00 392046 /lib64/libpthread-2.12.so
7f7973ea4000-7f7973ea8000 rw-p 00000000 00:00 0
7f7973ea8000-7f7973ebd000 r-xp 00000000 fd:00 392051 /lib64/libz.so.1.2.3
7f7973ebd000-7f79740bc000 ---p 00015000 fd:00 392051 /lib64/libz.so.1.2.3
7f79740bc000-7f79740bd000 r--p 00014000 fd:00 392051 /lib64/libz.so.1.2.3
7f79740bd000-7f79740be000 rw-p 00015000 fd:00 392051 /lib64/libz.so.1.2.3
7f79740be000-7f7974249000 r-xp 00000000 fd:00 391773 /lib64/libc-2.12.so
7f7974249000-7f7974448000 ---p 0018b000 fd:00 391773 /lib64/libc-2.12.so
7f7974448000-7f797444c000 r--p 0018a000 fd:00 391773 /lib64/libc-2.12.so
7f797444c000-7f797444d000 rw-p 0018e000 fd:00 391773 /lib64/libc-2.12.so
7f797444d000-7f7974452000 rw-p 00000000 00:00 0
7f7974452000-7f7974468000 r-xp 00000000 fd:00 392058 /lib64/libgcc_s-4.4.7-20120601.so.1
7f7974468000-7f7974667000 ---p 00016000 fd:00 392058 /lib64/libgcc_s-4.4.7-20120601.so.1
7f7974667000-7f7974668000 rw-p 00015000 fd:00 392058 /lib64/libgcc_s-4.4.7-20120601.so.1
7f7974668000-7f79746eb000 r-xp 00000000 fd:00 392052 /lib64/libm-2.12.so
7f79746eb000-7f79748ea000 ---p 00083000 fd:00 392052 /lib64/libm-2.12.so
7f79748ea000-7f79748eb000 r--p 00082000 fd:00 392052 /lib64/libm-2.12.so
7f79748eb000-7f79748ec000 rw-p 00083000 fd:00 392052 /lib64/libm-2.12.so
7f79748ec000-7f79749d4000 r-xp 00000000 fd:00 922734 /usr/lib64/libstdc++.so.6.0.13
7f79749d4000-7f7974bd4000 ---p 000e8000 fd:00 922734 /usr/lib64/libstdc++.so.6.0.13
7f7974bd4000-7f7974bdb000 r--p 000e8000 fd:00 922734 /usr/lib64/libstdc++.so.6.0.13
7f7974bdb000-7f7974bdd000 rw-p 000ef000 fd:00 922734 /usr/lib64/libstdc++.so.6.0.13
7f7974bdd000-7f7974bf2000 rw-p 00000000 00:00 0
7f7975084000-7f79750f3000 r-xp 00000000 fd:00 8662332 /home/svn/trunk/packages/openssl/libssl.so.1.0.1
7f79750f3000-7f79752f2000 ---p 0006f000 fd:00 8662332 /home/svn/trunk/packages/openssl/libssl.so.1.0.1
7f79752f2000-7f79752fb000 rw-p 0006e000 fd:00 8662332 /home/svn/trunk/packages/openssl/libssl.so.1.0.1
7f79752fb000-7f79754f2000 r-xp 00000000 fd:00 8662328 /home/svn/trunk/packages/openssl/libcrypto.so.1.0.1
7f79754f2000-7f79756f2000 ---p 001f7000 fd:00 8662328 /home/svn/trunk/packages/openssl/libcrypto.so.1.0.1
7f79756f2000-7f7975718000 rw-p 001f7000 fd:00 8662328 /home/svn/trunk/packages/openssl/libcrypto.so.1.0.1
7f7975718000-7f797571b000 rw-p 00000000 00:00 0
7f797571b000-7f7975742000 r-xp 00000000 fd:00 8867973 /home/svn/trunk/packages/wvstreams/libwvutils.so
7f7975742000-7f7975942000 ---p 00027000 fd:00 8867973 /home/svn/trunk/packages/wvstreams/libwvutils.so
7f7975942000-7f7975944000 rw-p 00027000 fd:00 8867973 /home/svn/trunk/packages/wvstreams/libwvutils.so
7f7975944000-7f7975a46000 rw-p 00000000 00:00 0
7f7975a46000-7f7975b2d000 r-xp 00000000 fd:00 8873068 /home/svn/trunk/packages/wvstreams/libwvstreams.so
7f7975b2d000-7f7975d2d000 ---p 000e7000 fd:00 8873068 /home/svn/trunk/packages/wvstreams/libwvstreams.so
7f7975d2d000-7f7975d38000 rw-p 000e7000 fd:00 8873068 /home/svn/trunk/packages/wvstreams/libwvstreams.so
7f7975d38000-7f7975db7000 r-xp 00000000 fd:00 8865320 /home/svn/trunk/packages/wvstreams/libwvbase.so
7f7975db7000-7f7975fb7000 ---p 0007f000 fd:00 8865320 /home/svn/trunk/packages/wvstreams/libwvbase.so
7f7975fb7000-7f7975fbe000 rw-p 0007f000 fd:00 8865320 /home/svn/trunk/packages/wvstreams/libwvbase.so
7f7975fbe000-7f7975fc2000 rw-p 00000000 00:00 0
7f7975fc2000-7f7975fe2000 r-xp 00000000 fd:00 391164 /lib64/ld-2.12.so
7f79761c6000-7f79761cf000 rw-p 00000000 00:00 0
7f79761dd000-7f79761e1000 rw-p 00000000 00:00 0
7f79761e1000-7f79761e2000 r--p 0001f000 fd:00 391164 /lib64/ld-2.12.so
7f79761e2000-7f79761e3000 rw-p 00020000 fd:00 391164 /lib64/ld-2.12.so
7f79761e3000-7f79761e4000 rw-p 00000000 00:00 0
7f79761e4000-7f797623c000 r-xp 00000000 fd:00 4301625 /home/svn/trunk/test
7f797643b000-7f797643f000 r--p 00057000 fd:00 4301625 /home/svn/trunk/test
7f797643f000-7f7976441000 rw-p 0005b000 fd:00 4301625 /home/svn/trunk/test
7f7977c9d000-7f7977d25000 rw-p 00000000 00:00 0 [heap]
7fffabf43000-7fffabf58000 rw-p 00000000 00:00 0 [stack]
7fffabfff000-7fffac000000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Usually that happens, when you accidentally delete an object, that is owned by a static, or global object, that will try to release it after main() has finished.
Prefer to use std::shared_ptr<> or std::unique_ptr<> depending on the ownership for owning pointers, and raw pointers for non owning pointers. Then any explicit delete in your code is a code smell. delete needs a raw pointer, which can only be a non owning pointer, so another part of the code owns this object and should take care of deleting it.
Related
I'm trying to execute a very basic C++ program that interacts with MySQL. I implemented the very beginning of the tutorial for MySQL Connector/C++, but I keep getting a segfault when I try to execute that code. Here is the code that I'm trying to execute:
try
{
sql::mysql::MySQL_Driver *driver = NULL;
sql::Connection *conn = NULL;
driver = sql::mysql::get_mysql_driver_instance();
if (driver != NULL)
{
conn = driver->connect("127.0.0.1:3306", "root", "root");
cout << "Test" << endl;
}
delete conn;
conn = NULL;
}
When I execute this code, "Test" gets printed, but I get the following error:
*** Error in `./test': free(): invalid pointer: 0x00007f0a9a292158 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f0a999a87e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f0a999b137a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f0a999b553c]
./test(_ZN3sql9SQLStringD1Ev+0x18)[0x401296]
/lib/x86_64-linux-gnu/libc.so.6(+0x39ff8)[0x7f0a9996aff8]
/lib/x86_64-linux-gnu/libc.so.6(+0x3a045)[0x7f0a9996b045]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf7)[0x7f0a99951837]
./test[0x400e79]
======= Memory map: ========
00400000-00402000 r-xp 00000000 08:01 6167619
/home/lichtsb1/local/src/ddsWork/mysqlTest/test
00601000-00602000 r--p 00001000 08:01 6167619
/home/lichtsb1/local/src/ddsWork/mysqlTest/test
00602000-00603000 rw-p 00002000 08:01 6167619
/home/lichtsb1/local/src/ddsWork/mysqlTest/test
02357000-023aa000 rw-p 00000000 00:00 0
[heap]
7f0a94000000-7f0a94021000 rw-p 00000000 00:00 0
7f0a94021000-7f0a98000000 ---p 00000000 00:00 0
7f0a989a8000-7f0a98ab0000 r-xp 00000000 08:01 43253857
/lib/x86_64-linux-gnu/libm-2.23.so
7f0a98ab0000-7f0a98caf000 ---p 00108000 08:01 43253857
/lib/x86_64-linux-gnu/libm-2.23.so
7f0a98caf000-7f0a98cb0000 r--p 00107000 08:01 43253857
/lib/x86_64-linux-gnu/libm-2.23.so
7f0a98cb0000-7f0a98cb1000 rw-p 00108000 08:01 43253857
/lib/x86_64-linux-gnu/libm-2.23.so
7f0a98cb1000-7f0a98cb4000 r-xp 00000000 08:01 43254080
/lib/x86_64-linux-gnu/libdl-2.23.so
7f0a98cb4000-7f0a98eb3000 ---p 00003000 08:01 43254080
/lib/x86_64-linux-gnu/libdl-2.23.so
7f0a98eb3000-7f0a98eb4000 r--p 00002000 08:01 43254080
/lib/x86_64-linux-gnu/libdl-2.23.so
7f0a98eb4000-7f0a98eb5000 rw-p 00003000 08:01 43254080
/lib/x86_64-linux-gnu/libdl-2.23.so
7f0a98eb5000-7f0a99074000 r-xp 00000000 08:01 7733609
/home/lichtsb1/local/src/ddsWork/mysqlTest/mysql-connector-c++-8.0.13-linux-glibc2.12-x86-64bit/lib64/libcrypto.so.1.0.0
7f0a99074000-7f0a99273000 ---p 001bf000 08:01 7733609
/home/lichtsb1/local/src/ddsWork/mysqlTest/mysql-connector-c++-8.0.13-linux-glibc2.12-x86-64bit/lib64/libcrypto.so.1.0.0
7f0a99273000-7f0a9929a000 rw-p 001be000 08:01 7733609
/home/lichtsb1/local/src/ddsWork/mysqlTest/mysql-connector-c++-8.0.13-linux-glibc2.12-x86-64bit/lib64/libcrypto.so.1.0.0
7f0a9929a000-7f0a9929d000 rw-p 00000000 00:00 0
7f0a9929d000-7f0a99302000 r-xp 00000000 08:01 7733606
/home/lichtsb1/local/src/ddsWork/mysqlTest/mysql-connector-c++-8.0.13-linux-glibc2.12-x86-64bit/lib64/libssl.so.1.0.0
7f0a99302000-7f0a99502000 ---p 00065000 08:01 7733606
/home/lichtsb1/local/src/ddsWork/mysqlTest/mysql-connector-c++-8.0.13-linux-glibc2.12-x86-64bit/lib64/libssl.so.1.0.0
7f0a99502000-7f0a9950c000 rw-p 00065000 08:01 7733606
/home/lichtsb1/local/src/ddsWork/mysqlTest/mysql-connector-c++-8.0.13-linux-glibc2.12-x86-64bit/lib64/libssl.so.1.0.0
7f0a9950c000-7f0a99513000 r-xp 00000000 08:01 43254289
/lib/x86_64-linux-gnu/librt-2.23.so
7f0a99513000-7f0a99712000 ---p 00007000 08:01 43254289
/lib/x86_64-linux-gnu/librt-2.23.so
7f0a99712000-7f0a99713000 r--p 00006000 08:01 43254289
/lib/x86_64-linux-gnu/librt-2.23.so
7f0a99713000-7f0a99714000 rw-p 00007000 08:01 43254289
/lib/x86_64-linux-gnu/librt-2.23.so
7f0a99714000-7f0a9972c000 r-xp 00000000 08:01 43253992
/lib/x86_64-linux-gnu/libpthread-2.23.so
7f0a9972c000-7f0a9992b000 ---p 00018000 08:01 43253992
/lib/x86_64-linux-gnu/libpthread-2.23.so
7f0a9992b000-7f0a9992c000 r--p 00017000 08:01 43253992
/lib/x86_64-linux-gnu/libpthread-2.23.so
7f0a9992c000-7f0a9992d000 rw-p 00018000 08:01 43253992
/lib/x86_64-linux-gnu/libpthread-2.23.so
7f0a9992d000-7f0a99931000 rw-p 00000000 00:00 0
7f0a99931000-7f0a99af1000 r-xp 00000000 08:01 43254051
/lib/x86_64-linux-gnu/libc-2.23.so
7f0a99af1000-7f0a99cf1000 ---p 001c0000 08:01 43254051
/lib/x86_64-linux-gnu/libc-2.23.so
7f0a99cf1000-7f0a99cf5000 r--p 001c0000 08:01 43254051
/lib/x86_64-linux-gnu/libc-2.23.so
7f0a99cf5000-7f0a99cf7000 rw-p 001c4000 08:01 43254051
/lib/x86_64-linux-gnu/libc-2.23.so
7f0a99cf7000-7f0a99cfb000 rw-p 00000000 00:00 0
7f0a99cfb000-7f0a99d11000 r-xp 00000000 08:01 43254905
/lib/x86_64-linux-gnu/libgcc_s.so.1
7f0a99d11000-7f0a99f10000 ---p 00016000 08:01 43254905
/lib/x86_64-linux-gnu/libgcc_s.so.1
7f0a99f10000-7f0a99f11000 rw-p 00015000 08:01 43254905
/lib/x86_64-linux-gnu/libgcc_s.so.1
7f0a99f11000-7f0a9a083000 r-xp 00000000 08:01 20972156
/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f0a9a083000-7f0a9a283000 ---p 00172000 08:01 20972156
/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f0a9a283000-7f0a9a28d000 r--p 00172000 08:01 20972156
/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f0a9a28d000-7f0a9a28f000 rw-p 0017c000 08:01 20972156
/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f0a9a28f000-7f0a9a293000 rw-p 00000000 00:00 0
7f0a9a293000-7f0a9a6ed000 r-xp 00000000 08:01 7733614
/home/lichtsb1/local/src/ddsWork/mysqlTest/mysql-connector-c++-8.0.13-linux-glibc2.12-x86-64bit/lib64/libmysqlcppconn.so.7.8.0.13
7f0a9a6ed000-7f0a9a8ed000 ---p 0045a000 08:01 7733614
/home/lichtsb1/local/src/ddsWork/mysqlTest/mysql-connector-c++-8.0.13-linux-glibc2.12-x86-64bit/lib64/libmysqlcppconn.so.7.8.0.13
7f0a9a8ed000-7f0a9a8f8000 r--p 0045a000 08:01 7733614
/home/lichtsb1/local/src/ddsWork/mysqlTest/mysql-connector-c++-8.0.13-linux-glibc2.12-x86-64bit/lib64/libmysqlcppconn.so.7.8.0.13
7f0a9a8f8000-7f0a9aab7000 rw-p 00465000 08:01 7733614
/home/lichtsb1/local/src/ddsWork/mysqlTest/mysql-connector-c++-8.0.13-linux-glibc2.12-x86-64bit/lib64/libmysqlcppconn.so.7.8.0.13
7f0a9aab7000-7f0a9aabd000 rw-p 00000000 00:00 0
7f0a9aabd000-7f0a9aae3000 r-xp 00000000 08:01 43253979
/lib/x86_64-linux-gnu/ld-2.23.so
7f0a9ac7b000-7f0a9acb7000 r--s 00000000 08:01 16523805
/var/cache/nscd/services
7f0a9acb7000-7f0a9acbe000 rw-p 00000000 00:00 0
7f0a9ace0000-7f0a9ace2000 rw-p 00000000 00:00 0
7f0a9ace2000-7f0a9ace3000 r--p 00025000 08:01 43253979
/lib/x86_64-linux-gnu/ld-2.23.so
7f0a9ace3000-7f0a9ace4000 rw-p 00026000 08:01 43253979
/lib/x86_64-linux-gnu/ld-2.23.so
7f0a9ace4000-7f0a9ace5000 rw-p 00000000 00:00 0
7ffe3b05c000-7ffe3b07e000 rw-p 00000000 00:00 0
[stack]
7ffe3b0dd000-7ffe3b0e0000 r--p 00000000 00:00 0
[vvar]
7ffe3b0e0000-7ffe3b0e2000 r-xp 00000000 00:00 0
[vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0
[vsyscall]
Aborted (core dumped)
This is so basic - what am I doing wrong?
Thank you very much for any help.
I was working on aqua-sim that is based on ns2 for my ubuntu and i'm getting a buffer overflow error and i can't figure out how to trace this kind of error.
i tried to debug using gdb but with no luck as i don't know how to trace the error, can someone please let me know where should i look based on the following error segment:
num_nodes is set 10
INITIALIZE THE LIST xListHead
Starting Simulation...
GOD: the old file name istest.data
GOD: the new file name isunderwater.data
*** buffer overflow detected ***: ns terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f57d8e347e5]
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x7f57d8ed611c]
/lib/x86_64-linux-gnu/libc.so.6(+0x117120)[0x7f57d8ed4120]
/lib/x86_64-linux-gnu/libc.so.6(+0x116689)[0x7f57d8ed3689]
/lib/x86_64-linux-gnu/libc.so.6(_IO_default_xsputn+0x80)[0x7f57d8e386b0]
/lib/x86_64-linux-gnu/libc.so.6(_IO_vfprintf+0xc90)[0x7f57d8e0ae00]
/lib/x86_64-linux-gnu/libc.so.6(__vsprintf_chk+0x84)[0x7f57d8ed3714]
/lib/x86_64-linux-gnu/libc.so.6(__sprintf_chk+0x7d)[0x7f57d8ed366d]
ns[0x57ea03]
ns[0x57eb44]
ns[0x415367]
ns[0x4162e6]
ns[0x416d8c]
ns[0x5b3894]
ns[0x5b85d5]
ns[0x5bdf12]
ns[0x5c0372]
ns[0x5e7de9]
ns[0x5ec6c0]
ns[0x5e7e99]
ns[0x5ec6c0]
ns[0x613615]
ns[0x613803]
ns[0x5b8705]
ns[0x5bdf12]
ns[0x5c0372]
ns[0x5e7de9]
ns[0x5ec6c0]
ns[0x613615]
ns[0x613803]
ns[0x5b85d5]
ns[0x5bdf12]
ns[0x5c0372]
ns[0x5c1c37]
ns[0x603321]
ns[0x606936]
ns[0x405abe]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f57d8ddd830]
ns[0x410f59]
======= Memory map: ========
00400000-00766000 r-xp 00000000 08:06 2491295 /home/me/Aqua-Sim/Aqua-Sim-1.0/ns-2.30/ns
00965000-00967000 r--p 00365000 08:06 2491295 /home/me/Aqua-Sim/Aqua-Sim-1.0/ns-2.30/ns
00967000-009f2000 rw-p 00367000 08:06 2491295 /home/me/Aqua-Sim/Aqua-Sim-1.0/ns-2.30/ns
009f2000-00a00000 rw-p 00000000 00:00 0
00c2e000-01085000 rw-p 00000000 00:00 0 [heap]
7f57d8ad0000-7f57d8dbd000 r--p 00000000 08:06 2627421 /usr/lib/locale/locale-archive
7f57d8dbd000-7f57d8f7d000 r-xp 00000000 08:06 1179887 /lib/x86_64-linux-gnu/libc-2.23.so
7f57d8f7d000-7f57d917d000 ---p 001c0000 08:06 1179887 /lib/x86_64-linux-gnu/libc-2.23.so
7f57d917d000-7f57d9181000 r--p 001c0000 08:06 1179887 /lib/x86_64-linux-gnu/libc-2.23.so
7f57d9181000-7f57d9183000 rw-p 001c4000 08:06 1179887 /lib/x86_64-linux-gnu/libc-2.23.so
7f57d9183000-7f57d9187000 rw-p 00000000 00:00 0
7f57d9187000-7f57d919d000 r-xp 00000000 08:06 1184430 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f57d919d000-7f57d939c000 ---p 00016000 08:06 1184430 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f57d939c000-7f57d939d000 rw-p 00015000 08:06 1184430 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f57d939d000-7f57d9517000 r-xp 00000000 08:06 2621627 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24
7f57d9517000-7f57d9716000 ---p 0017a000 08:06 2621627 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24
7f57d9716000-7f57d9720000 r--p 00179000 08:06 2621627 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24
7f57d9720000-7f57d9722000 rw-p 00183000 08:06 2621627 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24
7f57d9722000-7f57d9725000 rw-p 00000000 00:00 0
7f57d9725000-7f57d982d000 r-xp 00000000 08:06 1179880 /lib/x86_64-linux-gnu/libm-2.23.so
7f57d982d000-7f57d9a2c000 ---p 00108000 08:06 1179880 /lib/x86_64-linux-gnu/libm-2.23.so
7f57d9a2c000-7f57d9a2d000 r--p 00107000 08:06 1179880 /lib/x86_64-linux-gnu/libm-2.23.so
7f57d9a2d000-7f57d9a2e000 rw-p 00108000 08:06 1179880 /lib/x86_64-linux-gnu/libm-2.23.so
7f57d9a2e000-7f57d9a31000 r-xp 00000000 08:06 1179868 /lib/x86_64-linux-gnu/libdl-2.23.so
7f57d9a31000-7f57d9c30000 ---p 00003000 08:06 1179868 /lib/x86_64-linux-gnu/libdl-2.23.so
7f57d9c30000-7f57d9c31000 r--p 00002000 08:06 1179868 /lib/x86_64-linux-gnu/libdl-2.23.so
7f57d9c31000-7f57d9c32000 rw-p 00003000 08:06 1179868 /lib/x86_64-linux-gnu/libdl-2.23.so
7f57d9c32000-7f57d9c58000 r-xp 00000000 08:06 1179846 /lib/x86_64-linux-gnu/ld-2.23.so
7f57d9e37000-7f57d9e3d000 rw-p 00000000 00:00 0
7f57d9e54000-7f57d9e57000 rw-p 00000000 00:00 0
7f57d9e57000-7f57d9e58000 r--p 00025000 08:06 1179846 /lib/x86_64-linux-gnu/ld-2.23.so
7f57d9e58000-7f57d9e59000 rw-p 00026000 08:06 1179846 /lib/x86_64-linux-gnu/ld-2.23.so
7f57d9e59000-7f57d9e5a000 rw-p 00000000 00:00 0
7ffeddbfa000-7ffeddc1c000 rw-p 00000000 00:00 0 [stack]
7ffeddc4b000-7ffeddc4d000 r--p 00000000 00:00 0 [vvar]
7ffeddc4d000-7ffeddc4f000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted (core dumped)
my gcc is 4.9,on ns-2.30, and ubuntu 16.04
I have a very small piece of MPI code in Fortran 90 that I found online to test my cluster with heterogeneous nodes. The code likes like this
program MPI
include "mpif.h"
integer :: myrank,size,ierr
integer :: resultlen
character (len=8) :: name
call MPI_Init(ierr)
call MPI_Comm_rank(MPI_COMM_WORLD,myrank,ierr)
call MPI_Comm_size(MPI_COMM_WORLD,size,ierr)
call mpi_get_processor_name(name, resultlen, ierr)
write(*,*) "Processor ",myrank," of ",size,"on ",name,": Hello World!"
call MPI_Finalize(ierr)
end program
It was successfully compiled with the default mpif90 from the mpich package on CentOS 7.
> which mpif90
/usr/lib64/mpich/bin/mpif90
> mpif90 hello_mpi.f90 -o hello_mpi.exe
This code ran perfectly fine on one node.
> mpirun -host node1 -np 2 ./hello_mpi.exe
Processor 0 of 2 on node1: Hello World!
Processor 1 of 2 on node1: Hello World!
>
But on the other node, it crashed every time. These two nodes are very similar in hardware (both AMD Opteron processors, 64-core vs 48-core, and memory size are different), but identical on the software side (both CentOS7 with exactly the same packages). Here is what I got when running the code on node2
> mpirun -host node2 -np 2 ./hello_mpi.exe
Processor 0 of 2 on node2: Hello World!
Processor 1 of 2 on node2: Hello World!
*** stack smashing detected ***: ./hello_mpi.exe terminated
======= Backtrace: =========
*** stack smashing detected ***: ./hello_mpi.exe terminated
/lib64/libc.so.6(__fortify_fail+0x37)[0x7fc61aee3597]
/lib64/libc.so.6(__fortify_fail+0x0)[0x7fc61aee3560]
./hello_mpi.exe[0x400e66]
./hello_mpi.exe[0x400bff]
======= Backtrace: =========
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7fc61adf6b15]
./hello_mpi.exe[0x400c31]
======= Memory map: ========
/lib64/libc.so.6(__fortify_fail+0x37)[0x7f394c8c3597]
00400000-00402000 r-xp 00000000 00:2e 493967 /home/user/tmp/hello_mpi.exe
00601000-00602000 r--p 00001000 00:2e 493967 /home/user/tmp/hello_mpi.exe
00602000-00603000 rw-p 00002000 00:2e 493967 /home/user/tmp/hello_mpi.exe
01e96000-01eb7000 rw-p 00000000 00:00 0 [heap]
7fc61a395000-7fc61a3a1000 r-xp 00000000 fd:00 201382493 /usr/lib64/libnss_files-2.17.so
7fc61a3a1000-7fc61a5a0000 ---p 0000c000 fd:00 201382493 /usr/lib64/libnss_files-2.17.so
7fc61a5a0000-7fc61a5a1000 r--p 0000b000 fd:00 201382493 /usr/lib64/libnss_files-2.17.so
7fc61a5a1000-7fc61a5a2000 rw-p 0000c000 fd:00 201382493 /usr/lib64/libnss_files-2.17.so
7fc61a5a2000-7fc61a5a8000 rw-p 00000000 00:00 0
7fc61add5000-7fc61af8c000 r-xp 00000000 fd:00 201382897 /usr/lib64/libc-2.17.so
7fc61af8c000-7fc61b18c000 ---p 001b7000 fd:00 201382897 /u/lib64/libc.so.6(__fortify_fail+0x0)[0x7f394c8c3560]
./hello_mpi.exe[0x400e66]
./hello_mpi.exe[0x400bff]
sr/lib64/libc-2.17.so
7fc61b18c000-7fc61b190000 r--p 001b7000 fd:00 201382897 /usr/lib64/libc-2.17.so
7fc61b190000-7fc61b192000 rw-p 001bb000 fd:00 201382897 /usr/lib64/libc-2.17.so
7fc61b192000-7fc61b197000 rw-p 00000000 00:00 0
7fc61b19d000-7fc61b1d8000 r-xp 00000000 fd:00 202328431 /usr/lib64/libquadmath.so.0.0.0
7fc61b1d8000-7fc61b3d7000 ---p 0003b000 fd:00 202328431 /usr/lib64/libquadmath.so.0.0.0
7fc61b3d7000-7fc61b3d8000 r--p 0003a000 fd:00 202328431 /usr/lib64/libquadmath.so.0.0.0
7fc61b3d8000-7fc61b3d9000 rw-p 0003b000 fd:00 202328431 /usr/lib64/libquadmath.so.0.0.0
7fc61b3dd000-7fc61b3f2000 r-xp 00000000 fd:00 201326729 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7fc61b3f2000-7fc61b5f1000 ---p 00015000 fd:00 201326729 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7fc61b5f1000-7fc61b5f2000 r--p 00014000 fd:00 201326729 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7fc61b5f2000-7fc61b5f3000 rw-p 00015000 fd:00 201326729 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7fc61b5f5000-7fc61b6f6000 r-xp 00000000 fd:00 201382905 /usr/lib64/libm-2.17.so
7fc61b6f6000-7fc61b8f5000 ---p 00101000 fd:00 201382905 /usr/lib64/libm-2.17.so
7fc61b8f5000-7fc61b8f6000 r--p 00100000 fd:00 201382905 /usr/lib64/libm-2.17.so
7fc61b8f6000-7fc61b8f7000 rw-p 00101000 fd:00 201382905 /usr/lib64/libm-2.17.so
7fc61b8fd000-7fc61ba1c000 r-xp 00000000 fd:00 202328443 /usr/lib64/libgfortran.so.3.0.0
7fc61ba1c000-7fc61bc1c000 ---p 0011f000 fd:00 202328443 /usr/lib64/libgfortran.so.3.0.0
7fc61bc1c000-7fc61bc1d000 r--p 0011f000 fd:00 202328443 /usr/lib64/libgfortran.so.3.0.0
7fc61bc1d000-7fc61bc1f000 rw-p 00120000 fd:00 202328443 /usr/lib64/libgfortran.so.3.0.0
7fc61bc25000-7fc61bc3b000 r-xp 00000000 fd:00 201382505 /usr/lib64/libpthread-2.17.so
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f394c7d6b15]
./hello_mpi.exe[0x400c31]
======= Memory map: ========
7fc61bc3b000-7fc61be3b000 ---p 00016000 fd:00 201382505 /usr/lib64/libpthread-2.17.so
7fc61be3b000-7fc61be3c000 r--p 00016000 fd:00 201382505 /usr/lib64/libpthread-2.17.so
7fc61be3c000-7fc61be3d000 rw-p 00017000 fd:00 201382505 /usr/lib64/libpthread-2.17.so
7fc61be3d000-7fc61be41000 rw-p 00000000 00:00 0
7fc61be45000-7fc61be4c000 r-xp 00000000 fd:00 201382510 /usr/lib64/librt-2.17.so
7fc61be4c000-7fc61c04b000 ---p 00007000 fd:00 201382510 /usr/lib64/librt-2.17.so
7fc61c04b000-7fc61c04c000 r--p 00006000 fd:00 201382510 /usr/lib64/librt-2.17.so
7fc61c04c000-7fc61c04d000 rw-p 00007000 fd:00 201382510 /usr/lib64/librt-2.17.so
7fc61c04d000-7fc61c052000 r-xp 00000000 fd:00 136205960 /usr/lib64/mpich/lib/libmpl.so.1.0.0
7fc61c052000-7fc61c251000 ---p 00005000 fd:00 136205960 /usr/lib64/mpich/lib/libmpl.so.1.0.0
7fc61c251000-7fc61c252000 r--p 00004000 fd:00 1362059600400000-00402000 r-xp 00000000 00:2e 493967 /home/user/tmp/hello_mpi.exe
00601000-00602000 r--p 00001000 00:2e 493967 /home/user/tmp/hello_mpi.exe
00602000-00603000 rw-p 00002000 00:2e 493967 /home/user/tmp/hello_mpi.exe
01ca0000-01cc1000 rw-p 00000000 00:00 0 [heap]
7f394bd75000-7f394bd81000 r-xp 00000000 fd:00 201382493 /usr/lib64/libnss_files-2.17.so
7f394bd81000-7f394bf80000 ---p 0000c000 fd:00 201382493 /usr/lib64/libnss_files-2.17.so
7f394bf80000-7f394bf81000 r--p 0000b000 fd:00 201382493 /usr/lib64/libnss_files-2.17.so
7f394bf81000-7f394bf82000 rw-p 0000c000 fd:00 201382493 /usr/lib64/libnss_files-2.17.so
7f394bf82000-7f394bf88000 rw-p 00000000 00:00 0
7f394c7b5000-7f394c96c000 r-xp 00000000 fd:00 201382897 /usr/lib64/libc-2.17.so
7f394c96c000-7f394cb6c000 ---p 001b7000 fd:00 201382897 /u0 /usr/lib64/mpich/lib/libmpl.so.1.0.0
7fc61c252000-7fc61c253000 rw-p 00005000 fd:00 136205960 /usr/lib64/mpich/lib/libmpl.so.1.0.0
7fc61c255000-7fc61c256000 r-xp 00000000 fd:00 136205962 /usr/lib64/mpich/lib/libopa.so.1.0.0
7fc61c256000-7fc61c455000 ---p 00001000 fd:00 136205962 /usr/lib64/mpich/lib/libopa.so.1.0.0
7fc61c455000-7fc61c456000 r--p 00000000 fd:00 136205962 /usr/lib64/mpich/lib/libopa.so.1.0.0
7fc61c456000-7fc61c457000 rw-p 00001000 fd:00 136205962 /usr/lib64/mpich/lib/libopa.so.1.0.0
7fc61c45d000-7fc61c67e000 r-xp 00000000 fd:00 136205954 /usr/lib64/mpich/lib/libmpich.so.10.0.4
7fc61c67e000-7fc61c87d000 ---p 00221000 fd:00 136205954 /usr/lib64/mpich/lib/libmpich.so.10.0.4
7fc61c87d000-7fc61c88a000 r--p 00220000 fd:00 136205954 /usr/lib64/mpich/lib/libmpich.so.10.0.4
7fc61c88a000-7fc61c88f000 rw-p 0022d000 fd:00 136205954 /usr/lib64/mpich/lib/libmpich.so.10.0.4
7fc61c88f000-7fc61c8c8000 rw-p 00000000 00:00 0
7fc61c8cd000-7fc61c8cf000 r-xp 00000000 fd:00 136205958 /usr/lib64/mpich/lib/libmpichf90.so.10.0.4
7fc61c8cf000-7fc61cace000 ---p 00002000 fd:00 136205958 /usr/lib64/mpich/lib/libmpichf90.so.10.0.4
7fc61cace000-7fc61cacf000 r--p 00001000 fd:00 136205958 /usr/lib64/mpich/lib/libmpichf90.so.10.0.4
7fc61cacf000-7fc61cad0000 rw-p 00002000 fd:00 136205958 /usr/lib64/mpich/lib/libmpichf90.so.10.0.4
7fc61cad5000-7fc61caf6000 r-xp 00000000 fd:00 201382890 /usr/lib64/ld-2.17.so
7fc61cce1000-7fc61cce5000 rw-p 00000000 00:00 0
7fc61ccf5000-7fc61ccf6000 rw-p 00000000 00:00 0
7fc61ccf6000-7fc61ccf7000 r--p 00021000 fd:00 201382890 /usr/lib64/ld-2.17.so
7fc61ccf7000-7fc61ccf8000 rw-p 00022000 fd:00 201382890 /usr/lib64/ld-2.17.so
7fc61ccf8000-7fc61ccfa000 rw-p 00000000 00:00 0
7fc61ccfa000-7fc61ccfd000 rw-p 00000000 00:00sr/lib64/libc-2.17.so
7f394cb6c000-7f394cb70000 r--p 001b7000 fd:00 201382897 /usr/lib64/libc-2.17.so
7f394cb70000-7f394cb72000 rw-p 001bb000 fd:00 201382897 /usr/lib64/libc-2.17.so
7f394cb72000-7f394cb77000 rw-p 00000000 00:00 0
7f394cb7d000-7f394cbb8000 r-xp 00000000 fd:00 202328431 /usr/lib64/libquadmath.so.0.0.0
7f394cbb8000-7f394cdb7000 ---p 0003b000 fd:00 202328431 /usr/lib64/libquadmath.so.0.0.0
7f394cdb7000-7f394cdb8000 r--p 0003a000 fd:00 202328431 /usr/lib64/libquadmath.so.0.0.0
7f394cdb8000-7f394cdb9000 rw-p 0003b000 fd:00 202328431 /usr/lib64/libquadmath.so.0.0.0
7f394cdbd000-7f394cdd2000 r-xp 00000000 fd:00 201326729 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7f394cdd2000-7f394cfd1000 ---p 00015000 fd:00 201326729 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7f394cfd1000-7f394cfd2000 r--p 00014000 fd:00 201326729 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
0
7ffcdf655000-7ffcdf676000 rw-p 00000000 00:00 0 [stack]
7ffcdf70d000-7ffcdf70f000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
7f394cfd2000-7f394cfd3000 rw-p 00015000 fd:00 201326729 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7f394cfd5000-7f394d0d6000 r-xp 00000000 fd:00 201382905 /usr/lib64/libm-2.17.so
7f394d0d6000-7f394d2d5000 ---p 00101000 fd:00 201382905 /usr/lib64/libm-2.17.so
7f394d2d5000-7f394d2d6000 r--p 00100000 fd:00 201382905 /usr/lib64/libm-2.17.so
7f394d2d6000-7f394d2d7000 rw-p 00101000 fd:00 201382905 /usr/lib64/libm-2.17.so
7f394d2dd000-7f394d3fc000 r-xp 00000000 fd:00 202328443 /usr/lib64/libgfortran.so.3.0.0
7f394d3fc000-7f394d5fc000 ---p 0011f000 fd:00 202328443 /usr/lib64/libgfortran.so.3.0.0
7f394d5fc000-7f394d5fd000 r--p 0011f000 fd:00 202328443 /usr/lib64/libgfortran.so.3.0.0
7f394d5fd000-7f394d5ff000 rw-p 00120000 fd:00 202328443 /usr/lib64/libgfortran.so.3.0.0
7f394d605000-7f394d61b000 r-xp 00000000 fd:00 201382505 /usr/lib64/libpthread-2.17.so
Program received signal SIGABRT: Process abort signal.
Backtrace for this error:
7f394d61b000-7f394d81b000 ---p 00016000 fd:00 201382505 /usr/lib64/libpthread-2.17.so
7f394d81b000-7f394d81c000 r--p 00016000 fd:00 201382505 /usr/lib64/libpthread-2.17.so
7f394d81c000-7f394d81d000 rw-p 00017000 fd:00 201382505 /usr/lib64/libpthread-2.17.so
7f394d81d000-7f394d821000 rw-p 00000000 00:00 0
7f394d825000-7f394d82c000 r-xp 00000000 fd:00 201382510 /usr/lib64/librt-2.17.so
7f394d82c000-7f394da2b000 ---p 00007000 fd:00 201382510 /usr/lib64/librt-2.17.so
7f394da2b000-7f394da2c000 r--p 00006000 fd:00 201382510 /usr/lib64/librt-2.17.so
7f394da2c000-7f394da2d000 rw-p 00007000 fd:00 201382510 /usr/lib64/librt-2.17.so
7f394da2d000-7f394da32000 r-xp 00000000 fd:00 136205960 /usr/lib64/mpich/lib/libmpl.so.1.0.0
7f394da32000-7f394dc31000 ---p 00005000 fd:00 136205960 /usr/lib64/mpich/lib/libmpl.so.1.0.0
7f394dc31000-7f394dc32000 r--p 00004000 fd:00 136205960 /usr/lib64/mpich/lib/libmpl.so.1.0.0
7f394dc32000-7f394dc33000 rw-p 00005000 fd:00 136205960 /usr/lib64/mpich/lib/libmpl.so.1.0.0
7f394dc35000-7f394dc36000 r-xp 00000000 fd:00 136205962 /usr/lib64/mpich/lib/libopa.so.1.0.0
7f394dc36000-7f394de35000 ---p 00001000 fd:00 136205962 /usr/lib64/mpich/lib/libopa.so.1.0.0
7f394de35000-7f394de36000 r--p 00000000 fd:00 136205962 /usr/lib64/mpich/lib/libopa.so.1.0.0
7f394de36000-7f394de37000 rw-p 00001000 fd:00 136205962 /usr/lib64/mpich/lib/libopa.so.1.0.0
7f394de3d000-7f394e05e000 r-xp 00000000 fd:00 136205954 /usr/lib64/mpich/lib/libmpich.so.10.0.4
7f394e05e000-7f394e25d000 ---p 00221000 fd:00 136205954 /usr/lib64/mpich/lib/libmpich.so.10.0.4
7f394e25d000-7f394e26a000 r--p 00220000 fd:00 136205954 /usr/lib64/mpich/lib/libmpich.so.10.0.4
7f394e26a000-7f394e26f000 rw-p 0022d000 fd:00 136205954 /usr/lib64/mpich/lib/libmpich.so.10.0.4
7f394e26f000-7f394e2a8000 rw-p 00000000 00:00 0
7f394e2ad000-7f394e2af000 r-xp 00000000 fd:00 136205958 /usr/lib64/mpich/lib/libmpichf90.so.10.0.4
7f394e2af000-7f394e4ae000 ---p 00002000 fd:00 136205958 /usr/lib64/mpich/lib/libmpichf90.so.10.0.4
7f394e4ae000-7f394e4af000 r--p 00001000 fd:00 136205958 /usr/lib64/mpich/lib/libmpichf90.so.10.0.4
7f394e4af000-7f394e4b0000 rw-p 00002000 fd:00 136205958 /usr/lib64/mpich/lib/libmpichf90.so.10.0.4
7f394e4b5000-7f394e4d6000 r-xp 00000000 fd:00 201382890 /usr/lib64/ld-2.17.so
7f394e6ce000-7f394e6d6000 rw-p 00000000 00:00 0
7f394e6d6000-7f394e6d7000 r--p 00021000 fd:00 201382890 /usr/lib64/ld-2.17.so
7f394e6d7000-7f394e6d8000 rw-p 00022000 fd:00 201382890 /usr/lib64/ld-2.17.so
7f394e6d8000-7f394e6da000 rw-p 00000000 00:00 0
7fffabb37000-7fffabb58000 rw-p 00000000 00:00 0 [stack]
7fffabbed000-7fffabbef000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Program received signal SIGABRT: Process abort signal.
Backtrace for this error:
#0 0x7FC61B916467
#1 0x7FC61B916AAE
#2 0x7FC61AE0A66F
#3 0x7FC61AE0A5F7
#4 0x7FC61AE0BCE7
#0 0x7F394D2F6467
#1 0x#5 0x7FC61AE4A326
#6 0x7FC61AEE3596
#7 0x7FC61AEE355F
7F394D2F6AAE
#2 0x7F394C7EA66F
#3 0x7F394C7EA5F7
#4 0x7F394C7EBCE7
#5 0x7F394C82A326
#6 0x7F394C8C3596
#7 0x7F394C8C355F
#8 0x400E65 in mpi at hello_mpi.f90:16
#8 0x400E65 in mpi at hello_mpi.f90:16
===================================================================================
= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= EXIT CODE: 6
= CLEANING UP REMAINING PROCESSES
= YOU CAN IGNORE THE BELOW CLEANUP MESSAGES
===================================================================================
YOUR APPLICATION TERMINATED WITH THE EXIT STRING: Aborted (signal 6)
This typically refers to a problem with your application.
Please see the FAQ page for debugging suggestions
So my question is, what could be causing this problem? The interesting thing is a similar piece of MPI code in C (shown below, obtained from the internet) worked just fine on both nodes without the above problem.
#include <mpi.h>
#include <stdio.h>
int main(int argc, char** argv) {
// Initialize the MPI environment
MPI_Init(NULL, NULL);
// Get the number of processes
int world_size;
MPI_Comm_size(MPI_COMM_WORLD, &world_size);
// Get the rank of the process
int world_rank;
MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);
// Get the name of the processor
char processor_name[MPI_MAX_PROCESSOR_NAME];
int name_len;
MPI_Get_processor_name(processor_name, &name_len);
// Print off a hello world message
printf("Hello world from processor %s, rank %d"
" out of %d processors\n",
processor_name, world_rank, world_size);
// Finalize the MPI environment.
MPI_Finalize();
}
Could this be hardware related? Or something else?
name is too short. The MPI specification states:
The argument name must represent storage that is at least
MPI_MAX_PROCESSOR_NAME characters long. MPI_GET_PROCESSOR_NAME may write up to this many characters into name.
If that does not fix the problem, then your MPI implementation might be broken.
I'm using boost program options for my project but I can't get program exit without crashing. It crashes after exiting main function.
*** glibc detected *** bin/poolserver: double free or corruption (fasttop): 0x0000000002562100 ***
======= Backtrace: =========
/lib/libc.so.6(+0x71e16)[0x7f64a7a3be16]
/lib/libc.so.6(cfree+0x6c)[0x7f64a7a40b8c]
/usr/lib/libstdc++.so.6(_ZNSsD1Ev+0x39)[0x7f64a826cee9]
/lib/libc.so.6(__cxa_finalize+0xa5)[0x7f64a7a00995]
/usr/local/lib/libboost_program_options.so.1.53.0(+0x2a6d6)[0x7f64a85026d6]
======= Memory map: ========
00400000-004a5000 r-xp 00000000 08:01 29687876 /var/coins/poolserver/cmake/build/bin/poolserver
006a4000-006a6000 rw-p 000a4000 08:01 29687876 /var/coins/poolserver/cmake/build/bin/poolserver
02562000-025a5000 rw-p 00000000 00:00 0 [heap]
7f64a0000000-7f64a0021000 rw-p 00000000 00:00 0
7f64a0021000-7f64a4000000 ---p 00000000 00:00 0
7f64a5b2e000-7f64a5b2f000 ---p 00000000 00:00 0
7f64a5b2f000-7f64a632f000 rw-p 00000000 00:00 0
7f64a632f000-7f64a633b000 r-xp 00000000 08:01 9166850 /lib/libnss_files-2.11.3.so
7f64a633b000-7f64a653a000 ---p 0000c000 08:01 9166850 /lib/libnss_files-2.11.3.so
7f64a653a000-7f64a653b000 r--p 0000b000 08:01 9166850 /lib/libnss_files-2.11.3.so
7f64a653b000-7f64a653c000 rw-p 0000c000 08:01 9166850 /lib/libnss_files-2.11.3.so
7f64a653c000-7f64a653d000 ---p 00000000 00:00 0
7f64a653d000-7f64a6d3d000 rw-p 00000000 00:00 0
7f64a6d3d000-7f64a6d44000 r-xp 00000000 08:01 9166856 /lib/librt-2.11.3.so
7f64a6d44000-7f64a6f43000 ---p 00007000 08:01 9166856 /lib/librt-2.11.3.so
7f64a6f43000-7f64a6f44000 r--p 00006000 08:01 9166856 /lib/librt-2.11.3.so
7f64a6f44000-7f64a6f45000 rw-p 00007000 08:01 9166856 /lib/librt-2.11.3.so
7f64a6f45000-7f64a6f5c000 r-xp 00000000 08:01 22677552 /usr/lib/libz.so.1.2.3.4
7f64a6f5c000-7f64a715b000 ---p 00017000 08:01 22677552 /usr/lib/libz.so.1.2.3.4
7f64a715b000-7f64a715c000 rw-p 00016000 08:01 22677552 /usr/lib/libz.so.1.2.3.4
7f64a715c000-7f64a7171000 r-xp 00000000 08:01 9166863 /lib/libnsl-2.11.3.so
7f64a7171000-7f64a7370000 ---p 00015000 08:01 9166863 /lib/libnsl-2.11.3.so
7f64a7370000-7f64a7371000 r--p 00014000 08:01 9166863 /lib/libnsl-2.11.3.so
7f64a7371000-7f64a7372000 rw-p 00015000 08:01 9166863 /lib/libnsl-2.11.3.so
7f64a7372000-7f64a7374000 rw-p 00000000 00:00 0
7f64a7374000-7f64a737c000 r-xp 00000000 08:01 9166865 /lib/libcrypt-2.11.3.so
7f64a737c000-7f64a757b000 ---p 00008000 08:01 9166865 /lib/libcrypt-2.11.3.so
7f64a757b000-7f64a757c000 r--p 00007000 08:01 9166865 /lib/libcrypt-2.11.3.so
7f64a757c000-7f64a757d000 rw-p 00008000 08:01 9166865 /lib/libcrypt-2.11.3.so
7f64a757d000-7f64a75ab000 rw-p 00000000 00:00 0
7f64a75ab000-7f64a75ae000 r-xp 00000000 08:01 12394545 /usr/local/lib/libboost_system.so.1.53.0
7f64a75ae000-7f64a77ad000 ---p 00003000 08:01 12394545 /usr/local/lib/libboost_system.so.1.53.0
7f64a77ad000-7f64a77ae000 rw-p 00002000 08:01 12394545 /usr/local/lib/libboost_system.so.1.53.0
7f64a77ae000-7f64a77c5000 r-xp 00000000 08:01 9166854 /lib/libpthread-2.11.3.so
7f64a77c5000-7f64a79c4000 ---p 00017000 08:01 9166854 /lib/libpthread-2.11.3.so
7f64a79c4000-7f64a79c5000 r--p 00016000 08:01 9166854 /lib/libpthread-2.11.3.so
7f64a79c5000-7f64a79c6000 rw-p 00017000 08:01 9166854 /lib/libpthread-2.11.3.so
7f64a79c6000-7f64a79ca000 rw-p 00000000 00:00 0
7f64a79ca000-7f64a7b23000 r-xp 00000000 08:01 9166859 /lib/libc-2.11.3.so
7f64a7b23000-7f64a7d22000 ---p 00159000 08:01 9166859 /lib/libc-2.11.3.so
7f64a7d22000-7f64a7d26000 r--p 00158000 08:01 9166859 /lib/libc-2.11.3.so
7f64a7d26000-7f64a7d27000 rw-p 0015c000 08:01 9166859 /lib/libc-2.11.3.so
7f64a7d27000-7f64a7d2c000 rw-p 00000000 00:00 0
7f64a7d2c000-7f64a7d42000 r-xp 00000000 08:01 9166851 /lib/libgcc_s.so.1
7f64a7d42000-7f64a7f41000 ---p 00016000 08:01 9166851 /lib/libgcc_s.so.1
7f64a7f41000-7f64a7f42000 rw-p 00015000 08:01 9166851 /lib/libgcc_s.so.1
7f64a7f42000-7f64a7fc2000 r-xp 00000000 08:01 9166872 /lib/libm-2.11.3.so
7f64a7fc2000-7f64a81c2000 ---p 00080000 08:01 9166872 /lib/libm-2.11.3.so
7f64a81c2000-7f64a81c3000 r--p 00080000 08:01 9166872 /lib/libm-2.11.3.so
7f64a81c3000-7f64a81c4000 rw-p 00081000 08:01 9166872 /lib/libm-2.11.3.so
7f64a81c4000-7f64a82ba000 r-xp 00000000 08:01 22677469 /usr/lib/libstdc++.so.6.0.13
7f64a82ba000-7f64a84ba000 ---p 000f6000 08:01 22677469 /usr/lib/libstdc++.so.6.0.13
7f64a84ba000-7f64a84c1000 r--p 000f6000 08:01 22677469 /usr/lib/libstdc++.so.6.0.13
7f64a84c1000-7f64a84c3000 rw-p 000fd000 08:01 22677469 /usr/lib/libstdc++.so.6.0.13
7f64a84c3000-7f64a84d8000 rw-p 00000000 00:00 0
7f64a84d8000-7f64a853c000 r-xp 00000000 08:01 12394575 /usr/local/lib/libboost_program_options.so.1.53.0
7f64a853c000-7f64a873b000 ---p 00064000 08:01 12394575 /usr/local/lib/libboost_program_options.so.1.53.0
7f64a873b000-7f64a8740000 rw-p 00063000 08:01 12394575 /usr/local/lib/libboost_program_options.so.1.53.0
7f64a8740000-7f64a8757000 r-xp 00000000 08:01 12394559 /usr/local/lib/libboost_thread.so.1.53.0
7f64a8757000-7f64a8956000 ---p 00017000 08:01 12394559 /usr/local/lib/libboost_thread.so.1.53.0
7f64a8956000-7f64a8958000 rw-p 00016000 08:01 12394559 /usr/local/lib/libboost_thread.so.1.53.0
7f64a8958000-7f64a8969000 r-xp 00000000 08:01 22682328 /usr/lib/libboost_date_time.so.1.42.0
7f64a8969000-7f64a8b68000 ---p 00011000 08:01 22682328 /usr/lib/libboost_date_time.so.1.42.0
7f64a8b68000-7f64a8b6a000 rw-p 00010000 08:01 22682328 /usr/lib/libboost_date_time.so.1.42.0Aborted
I'm using cmake with such options:
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
set(Boost_ALL_DYN_LINK ON)
I tried static linking and it worked for some time but now it crashes with any settings.
OS: Debian Squeeze
If it helps https://github.com/Intel/poolserver this is my source
Your question doesn't give us the code directly, but looking through github, I suspect the boost program options have nothing to do with it.
The error says
double free or corruption
I suspect it's this:
void DatabaseConnectionMySQL::Close()
{
delete this;
}
Problem was with boost package from debian. Compiling newest boost from source fixed crash.
I have a file that I am trying to use both cuComplex and std::complex in some functions.
When I run the softwar, I get a crash in this block of code, from a function trying to use std::complex and not cuComplex:
else
{ // data is 16 bit complex
offset rowLengthInBytes = numCols * sizeof(std::complex<unsigned short>);
std::complex<unsigned short> *buff16 = new std::complex<unsigned short>[(unsigned int)numCols];
//complex<unsigned short> *buff16 = (complex<unsigned short> *)malloc(numCols * sizeof(complex<unsigned short>));
//printf("Size of buff16: %i \n", sizeof(buff16));
offset startOfData = NitfFile.getSegmentDataOffset(cNitfReader::IMAGE, 0);
startOfData += (rowNum * rowLengthInBytes);
#ifdef _WIN32
_fseeki64(dataFile, startOfData, SEEK_SET);
#else
fseeko64(dataFile, startOfData, SEEK_SET);
#endif
fread((char*)buff16, 1, (size_t)rowLengthInBytes, dataFile);
for (size_t i = 0 ; i < numCols ; i++)
{
int re = buff16[i].real();
int im = buff16[i].imag();
#ifdef IDT_LITTLE_ENDIAN
endianSwap(&re, sizeof(re));
endianSwap(&im, sizeof(im));
#endif
buffer[i] = std::complex<float>((float)re, (float)im);
}
delete[] buff16; //program stops on this line
}
I cannot figure out why that delete[] is causing problems. I thoguht maybe there was a naming conflict, so I added std:: in front of all the complex types, but that didnt help.
Additionally, I made a test program to call these functions and it runs fine, however, the crash is happening whenever I instantiate some of these classes from QT. Using QT's debugger is how I got it to show me which line it is stopping at, beacuse normally it is just causing my program to end.
How can I figure out what is causing this crash?
edit:
I have verified that i is = numCols after the loop, which is how many spots were allocated for buffer.
Output from gdb:
*** glibc detected *** /work/ext/bin/TEST: double free or corruption (top): 0x00000000818dbd60 ***
======= Backtrace: =========
/lib64/libc.so.6[0x34eca7230f]
/lib64/libc.so.6(cfree+0x4b)[0x34eca7276b]
/work/ext/bin/TEST[0x415511]
/work/ext/bin/TEST[0x415543]
/work/ext/bin/TEST[0x415584]
/work/ext/bin/TEST[0x4155db]
/work/ext/bin/TEST[0x414927]
/work/ext/bin/TEST[0x423a5b]
/work/ext/bin/TEST[0x423d30]
/work/ext/bin/TEST[0x408742]
/work/ext/bin/TEST[0x407595]
/lib64/libc.so.6(__libc_start_main+0xf4)[0x34eca1d994]
/work/ext/bin/TEST(__gxx_personality_v0+0x229)[0x4062e9]
======= Memory map: ========
00400000-00466000 r-xp 00000000 fd:00 254345223 /work/ext/bin/TEST
00666000-00668000 rw-p 00066000 fd:00 254345223 /work/ext/bin/TEST
00668000-818f8000 rw-p 00668000 00:00 0 [heap]
343a400000-343a446000 r-xp 00000000 fd:00 49741877 /lib64/libssl.so.0.9.8e
343a446000-343a646000 ---p 00046000 fd:00 49741877 /lib64/libssl.so.0.9.8e
343a646000-343a64c000 rw-p 00046000 fd:00 49741877 /lib64/libssl.so.0.9.8e
343a800000-343a83b000 r-xp 00000000 fd:00 270302783 /usr/lib64/libcurl.so.3.0.0
343a83b000-343aa3b000 ---p 0003b000 fd:00 270302783 /usr/lib64/libcurl.so.3.0.0
343aa3b000-343aa3d000 rw-p 0003b000 fd:00 270302783 /usr/lib64/libcurl.so.3.0.0
34eba00000-34eba1c000 r-xp 00000000 fd:00 49741826 /lib64/ld-2.5.so
34ebc1b000-34ebc1c000 r--p 0001b000 fd:00 49741826 /lib64/ld-2.5.so
34ebc1c000-34ebc1d000 rw-p 0001c000 fd:00 49741826 /lib64/ld-2.5.so
34eca00000-34ecb4e000 r-xp 00000000 fd:00 49741833 /lib64/libc-2.5.so
34ecb4e000-34ecd4d000 ---p 0014e000 fd:00 49741833 /lib64/libc-2.5.so
34ecd4d000-34ecd51000 r--p 0014d000 fd:00 49741833 /lib64/libc-2.5.so
34ecd51000-34ecd52000 rw-p 00151000 fd:00 49741833 /lib64/libc-2.5.so
34ecd52000-34ecd57000 rw-p 34ecd52000 00:00 0
34ece00000-34ece82000 r-xp 00000000 fd:00 49741837 /lib64/libm-2.5.so
34ece82000-34ed081000 ---p 00082000 fd:00 49741837 /lib64/libm-2.5.so
34ed081000-34ed082000 r--p 00081000 fd:00 49741837 /lib64/libm-2.5.so
34ed082000-34ed083000 rw-p 00082000 fd:00 49741837 /lib64/libm-2.5.so
34ed200000-34ed202000 r-xp 00000000 fd:00 49741849 /lib64/libdl-2.5.so
34ed202000-34ed402000 ---p 00002000 fd:00 49741849 /lib64/libdl-2.5.so
34ed402000-34ed403000 r--p 00002000 fd:00 49741849 /lib64/libdl-2.5.so
34ed403000-34ed404000 rw-p 00003000 fd:00 49741849 /lib64/libdl-2.5.so
34ed600000-34ed616000 r-xp 00000000 fd:00 49741839 /lib64/libpthread-2.5.so
34ed616000-34ed815000 ---p 00016000 fd:00 49741839 /lib64/libpthread-2.5.so
34ed815000-34ed816000 r--p 00015000 fd:00 49741839 /lib64/libpthread-2.5.so
34ed816000-34ed817000 rw-p 00016000 fd:00 49741839 /lib64/libpthread-2.5.so
34ed817000-34ed81b000 rw-p 34ed817000 00:00 0
34eda00000-34eda14000 r-xp 00000000 fd:00 270295239 /usr/lib64/libz.so.1.2.3
34eda14000-34edc13000 ---p 00014000 fd:00 270295239 /usr/lib64/libz.so.1.2.3
34edc13000-34edc14000 rw-p 00013000 fd:00 270295239 /usr/lib64/libz.so.1.2.3
34ede00000-34ede07000 r-xp 00000000 fd:00 49741841 /lib64/librt-2.5.so
34ede07000-34ee007000 ---p 00007000 fd:00 49741841 /lib64/librt-2.5.so
34ee007000-34ee008000 r--p 00007000 fd:00 49741841 /lib64/librt-2.5.so
34ee008000-34ee009000 rw-p 00008000 fd:00 49741841 /lib64/librt-2.5.so
34f4800000-34f4815000 r-xp 00000000 fd:00 49742011 /lib64/libnsl-2.5.so
34f4815000-34f4a14000 ---p 00015000 fd:00 49742011 /lib64/libnsl-2.5.so
34f4a14000-34f4a15000 r--p 00014000 fd:00 49742011 /lib64/libnsl-2.5.so
34f4a15000-34f4a16000 rw-p 00015000 fd:00 49742011 /lib64/libnsl-2.5.so
34f4a16000-34f4a18000 rw-p 34f4a16000 00:00 0
34f6800000-34f692d000 r-xp 00000000 fd:00 49742042 /lib64/libcrypto.so.0.9.8e
34f692d000-34f6b2c000 ---p 0012d000 fd:00 49742042 /lib64/libcrypto.so.0.9.8e
34f6b2c000-34f6b4d000 rw-p 0012c000 fd:00 49742042 /lib64/libcrypto.so.0.9.8e
34f6b4d000-34f6b51000 rw-p 34f6b4d000 00:00 0
34f7000000-34f7011000 r-xp 00000000 fd:00 49742019 /lib64/libresolv-2.5.so
34f7011000-34f7211000 ---p 00011000 fd:00 49742019 /lib64/libresolv-2.5.so
34f7211000-34f7212000 r--p 00011000 fd:00 49742019 /lib64/libresolv-2.5.so
34f7212000-34f7213000 rw-p 00012000 fd:00 49742019 /lib64/libresolv-2.5.so
34f7213000-34f7215000 rw-p 34f7213000 00:00 0
34f7400000-34f7402000 r-xp 00000000 fd:00 49742018 /lib64/libkeyutils-1.2.so
34f7402000-34f7601000 ---p 00002000 fd:00 49742018 /lib64/libkeyutils-1.2.so
34f7601000-34f7602000 rw-p 00001000 fd:00 49742018 /lib64/libkeyutils-1.2.so
34f7800000-34f7802000 r-xp 00000000 fd:00 49742040 /lib64/libcom_err.so.2.1
34f7802000-34f7a01000 ---p 00002000 fd:00 49742040 /lib64/libcom_err.so.2.1
34f7a01000-34f7a02000 rw-p 00001000 fd:00 49742040 /lib64/libcom_err.so.2.1
34fdc00000-34fdc0d000 r-xp 00000000 fd:00 49742037 /lib64/libgcc_s-4.1.2-20080825.so.1
34fdc0d000-34fde0d000 ---p 0000d000 fd:00 49742037 /lib64/libgcc_s-4.1.2-20080825.so.1
34fde0d000-34fde0e000 rw-p 0000d000 fd:00 49742037 /lib64/libgcc_s-4.1.2-20080825.so.1
34ff000000-34ff0e6000 r-xp 00000000 fd:00 270284428 /usr/lib64/libstdc++.so.6.0.8
34ff0e6000-34ff2e5000 ---p 000e6000 fd:00 270284428 /usr/lib64/libstdc++.so.6.0.8
34ff2e5000-34ff2eb000 r--p 000e5000 fd:00 270284428 /usr/lib64/libstdc++.so.6.0.8
34ff2eb000-34ff2ee000 rw-p 000eb000 fd:00 270284428 /usr/lib64/libstdc++.so.6.0.8
34ff2ee000-34ff300000 rw-p 34ff2ee000 00:00 0
3bf9c00000-3bf9c31000 r-xp 00000000 fd:00 270298839 /usr/lib64/libidn.so.11.5.19
3bf9c31000-3bf9e30000 ---p 00031000 fd:00 270298839 /usr/lib64/libidn.so.11.5.19
3bf9e30000-3bf9e31000 rw-p 00030000 fd:00 270298839 /usr/lib64/libidn.so.11.5.19
3bfc800000-3bfc808000 r-xp 00000000 fd:00 270298915 /usr/lib64/libkrb5support.so.0.1
3bfc808000-3bfca07000 ---p 00008000 fd:00 270298915 /usr/lib64/libkrb5support.so.0.1
3bfca07000-3bfca08000 rw-p 00007000 fd:00 270298915 /usr/lib64/libkrb5support.so.0.1
3bfcc00000-3bfcc15000 r-xp 00000000 fd:00 25198595 /lib64/libselinux.so.1
3bfcc15000-3bfce15000 ---p 00015000 fd:00 25198595 /lib64/libselinux.so.1
3bfce15000-3bfce17000 rw-p 00015000 fd:00 25198595 /lib64/libselinux.so.1
3bfce17000-3bfce18000 rw-p 3bfce17000 00:00 0
3bfd000000-3bfd091000 r-xp 00000000 fd:00 270299139 /usr/lib64/libkrb5.so.3.3
3bfd091000-3bfd291000 ---p 00091000 fd:00 270299139 /usr/lib64/libkrb5.so.3.3
3bfd291000-3bfd295000 rw-p 00091000 fd:00 270299139 /usr/lib64/libkrb5.so.3.3
3bfd400000-3bfd424000 r-xp 00000000 fd:00 270299138 /usr/lib64/libk5crypto.so.3.1
3bfd424000-3bfd623000 ---p 00024000 fd:00 270299138 /usr/lib64/libk5crypto.so.3.1
3bfd623000-3bfd625000 rw-p 00023000 fd:00 270299138 /usr/lib64/libk5crypto.so.3.1
3bfd800000-3bfd83b000 r-xp 00000000 fd:00 25198594 /lib64/libsepol.so.1
3bfd83b000-3bfda3b000 ---p 0003b000 fd:00 25198594 /lib64/libsepol.so.1
3bfda3b000-3bfda3c000 rw-p 0003b000 fd:00 25198594 /lib64/libsepol.so.1
3bfda3c000-3bfda46000 rw-p 3bfda3c000 00:00 0
3bfdc00000-3bfdc2c000 r-xp 00000000 fd:00 270299140 /usr/lib64/libgssapi_krb5.so.2.2
3bfdc2c000-3bfde2c000 ---p 0002c000 fd:00 270299140 /usr/lib64/libgssapi_krb5.so.2.2
3bfde2c000-3bfde2e000 rw-p 0002c000 fd:00 270299140 /usr/lib64/libgssapi_krb5.so.2.2
2aaaaaaab000-2aaaaaaae000 rw-p 2aaaaaaab000 00:00 0
2aaaaaaae000-2aaaaaab5000 r--s 00000000 fd:00 147620082 /usr/lib64/gconv/gconv-modules.cache
2aaaaaacf000-2aaaaaad0000 rw-p 2aaaaaacf000 00:00 0
2aaaaaad0000-2aaaab25d000 r-xp 00000000 fd:00 270295189 /usr/lib64/libcuda.so.260.19.26
2aaaab25d000-2aaaab45c000 ---p 0078d000 fd:00 270295189 /usr/lib64/libcuda.so.260.19.26
2aaaab45c000-2aaaab528000 rw-p 0078c000 fd:00 270295189 /usr/lib64/libcuda.so.260.19.26
2aaaab528000-2aaaab54c000 rw-p 2aaaab528000 00:00 0
2aaaab54c000-2aaaab902000 r-xp 00000000 fd:00 254312453 /work/ext/lib/Linux/libxerces-c-3.1.so
2aaaab902000-2aaaabb02000 ---p 003b6000 fd:00 254312453 /work/ext/lib/Linux/libxerces-c-3.1.so
2aaaabb02000-2aaaabb43000 rw-p 003b6000 fd:00 254312453 /work/ext/lib/Linux/libxerces-c-3.1.so
2aaaabb43000-2aaaabba2000 r-xp 00000000 fd:00 271156027 /usr/local/cuda/lib64/libcudart.so.3.2.16
2aaaabba2000-2aaaabda2000 ---p 0005f000 fd:00 271156027 /usr/local/cuda/lib64/libcudart.so.3.2.16
2aaaabda2000-2aaaabda3000 rw-p 0005f000 fd:00 271156027 /usr/local/cuda/lib64/libcudart.so.3.2.16
2aaaabda3000-2aaaabdae000 rw-p 2aaaabda3000 00:00 0
2aaaabdae000-2aaaabdb0000 r-xp 00000000 fd:00 147620070 /usr/lib64/gconv/UTF-16.so
2aaaabdb0000-2aaaabfaf000 ---p 00002000 fd:00 147620070 /usr/lib64/gconv/UTF-16.so
2aaaabfaf000-2aaaabfb1000 rw-p 00001000 fd:00 147620070 /usr/lib64/gconv/UTF-16.so
2aaaabfb1000-2aaaabfb6000 rw-p 2aaaabfb1000 00:00 0
2aaaabfda000-2aaaabfdb000 rw-p 2aaaabfda000 00:00 0
7ffffffea000-7ffffffff000 rwxp 7ffffffe9000 00:00 0 [stack]
ffffffffff600000-ffffffffffe00000 ---p 00000000 00:00 0 [vdso]
Program received signal SIGABRT, Aborted.
0x00000034eca30265 in raise () from /lib64/libc.so.6
What you are trying to do is called serialization. You are strongly discouraged to do it by just reading/writing memory buffers in which your objects instances are stored. This way some unrelated internal data like memory pointers may get written to the file verbatim — and later, when read in, it won't be valid.
Consider using some existing serialization library for operating instances of vector<complex<float> >, for example Boost.Serialization.
You may look at this question for examples too.
The posted code seems valid to me, too (although it's impossible to be certain of the parts that we know only something of - like most variables). A bug that's showing up for no reason could indicate heap corruption - caused by something, elsewhere in the program.
However, there's no need for new[]/delete[] in a case like this. Why not just use std::vector - it's only better, and built for this purpose (among others).
{
std::vector<std::complex<unsigned short> > vector(numCols);
std::complex<unsigned short>* buff16 = &vector[0];
/* code */
}
Nothing obvious stands out, but the most likely problem is that buffer isn't big enough to hold numCols items and it's actually overflowing and overwriting buff16.