STXXL fails at creating a map of strings in long numeric - c++11

With the code that follows, I want to create a map of type std::map. By using a debugger, I got that the exception was raised by stl_pair.h at line 368 (pair& operator=(typename conditional<__and_<is_copy_assignable<_T1>, is_copy_assignable<_T2>>::value, const pair&, const __wrap_nonesuch&>::type __p)), which was invoked by the map scanning of cur (*(cur + 1) = *cur;) in the leaf.h insert function of stxxl. I provide the code I used in the following source code:
#include <stxxl/map>
#include <fstream>
#include <string>
#include <cstdint>
typedef uint_fast64_t LONG_NUMERIC;
std::string random_string( size_t length )
{
auto randchar = []() -> char
{
const char charset[] =
"0123456789"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
const size_t max_index = (sizeof(charset) - 1);
return charset[ rand() % max_index ];
};
std::string str(length,0);
std::generate_n( str.begin(), length, randchar );
return str;
}
struct CompareGreater22
{
bool operator () (const std::string& a, const std::string& b) const
{ return a > b; }
static std::string max_value()
{ return std::string(); }
};
int main(int argc, char** argv) {
stxxl::config * cfg = stxxl::config::get_instance();
stxxl::disk_config disk1("/mnt/DEC4763AC47614CD/stxxl.tmp", 100 * 1024 * 1024, "syscall unlink");
disk1.direct = stxxl::disk_config::DIRECT_ON; // force O_DIRECT
// add disk to config
cfg->add_disk(disk1);
// template parameter <KeyType, DataType, CompareType, RawNodeSize, RawLeafSize, PDAllocStrategy (optional)>
typedef stxxl::map<std::string, LONG_NUMERIC, CompareGreater22, DATA_NODE_BLOCK_SIZE, DATA_LEAF_BLOCK_SIZE> map_type3;
// Constructor map(node_cache_size_in_bytes, leaf_cache_size_in_bytes)
map_type3 t((map_type3::node_block_type::raw_size)*3, (map_type3::leaf_block_type::raw_size)*3);
//vertex_conversion_map_type t{(vertex_conversion_map_type::node_block_type::raw_size)*3, (vertex_conversion_map_type::leaf_block_type::raw_size)*3};
for (LONG_NUMERIC i = 0; i< 2000; i++) {
t.insert(std::make_pair(random_string(10), i));
}
}
I also provide the dump result:
[STXXL-MSG] STXXL v1.4.99 (prerelease/Debug) (git 0a80a8c55993948f7f2f6c2c5a51ff45b403045b) + gnu parallel(20170406)
[STXXL-MSG] Disk '/mnt/DEC4763AC47614CD/stxxl.tmp' is allocated, space: 100 MiB, I/O implementation: syscall direct=on queue=0 devid=0 unlink_on_open
*** Error in `/anon/software/path': free(): invalid pointer: 0x000055c0cd7688d0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7908b)[0x7fd69ff1108b]
/lib/x86_64-linux-gnu/libc.so.6(+0x82c3a)[0x7fd69ff1ac3a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fd69ff1ed2c]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_assignERKS4_+0xaf)[0x7fd6a0ad0fcf]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_+0x9)[0x7fd6a0ad1339]
/anon/software/path(+0x19bfb)[0x55c0cc841bfb]
/anon/software/path(+0x15699)[0x55c0cc83d699]
/anon/software/path(+0x10dba)[0x55c0cc838dba]
/anon/software/path(+0xf6fc)[0x55c0cc8376fc]
/anon/software/path(+0xd46d)[0x55c0cc83546d]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0x7fd69feb83f1]
/anon/software/path(+0xd01a)[0x55c0cc83501a]
======= Memory map: ========
55c0cc828000-55c0cc9d8000 r-xp 00000000 08:02 509986 /anon/software/path
55c0ccbd7000-55c0ccbdc000 r--p 001af000 08:02 509986 /anon/software/path
55c0ccbdc000-55c0ccbdd000 rw-p 001b4000 08:02 509986 /anon/software/path
55c0ccbdd000-55c0ccbdf000 rw-p 00000000 00:00 0
55c0cd74a000-55c0cd78c000 rw-p 00000000 00:00 0 [heap]
7fd698000000-7fd698021000 rw-p 00000000 00:00 0
7fd698021000-7fd69c000000 ---p 00000000 00:00 0
7fd69f697000-7fd69f698000 ---p 00000000 00:00 0
7fd69f698000-7fd69fe98000 rw-p 00000000 00:00 0
7fd69fe98000-7fd6a0056000 r-xp 00000000 103:05 795936 /lib/x86_64-linux-gnu/libc-2.24.so
7fd6a0056000-7fd6a0255000 ---p 001be000 103:05 795936 /lib/x86_64-linux-gnu/libc-2.24.so
7fd6a0255000-7fd6a0259000 r--p 001bd000 103:05 795936 /lib/x86_64-linux-gnu/libc-2.24.so
7fd6a0259000-7fd6a025b000 rw-p 001c1000 103:05 795936 /lib/x86_64-linux-gnu/libc-2.24.so
7fd6a025b000-7fd6a025f000 rw-p 00000000 00:00 0
7fd6a025f000-7fd6a0275000 r-xp 00000000 103:05 791133 /lib/x86_64-linux-gnu/libgcc_s.so.1
7fd6a0275000-7fd6a0474000 ---p 00016000 103:05 791133 /lib/x86_64-linux-gnu/libgcc_s.so.1
7fd6a0474000-7fd6a0475000 r--p 00015000 103:05 791133 /lib/x86_64-linux-gnu/libgcc_s.so.1
7fd6a0475000-7fd6a0476000 rw-p 00016000 103:05 791133 /lib/x86_64-linux-gnu/libgcc_s.so.1
7fd6a0476000-7fd6a04a3000 r-xp 00000000 103:05 4335250 /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0
7fd6a04a3000-7fd6a06a2000 ---p 0002d000 103:05 4335250 /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0
7fd6a06a2000-7fd6a06a3000 r--p 0002c000 103:05 4335250 /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0
7fd6a06a3000-7fd6a06a4000 rw-p 0002d000 103:05 4335250 /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0
7fd6a06a4000-7fd6a07ac000 r-xp 00000000 103:05 795940 /lib/x86_64-linux-gnu/libm-2.24.so
7fd6a07ac000-7fd6a09ab000 ---p 00108000 103:05 795940 /lib/x86_64-linux-gnu/libm-2.24.so
7fd6a09ab000-7fd6a09ac000 r--p 00107000 103:05 795940 /lib/x86_64-linux-gnu/libm-2.24.so
7fd6a09ac000-7fd6a09ad000 rw-p 00108000 103:05 795940 /lib/x86_64-linux-gnu/libm-2.24.so
7fd6a09ad000-7fd6a0b26000 r-xp 00000000 103:05 4335931 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7fd6a0b26000-7fd6a0d25000 ---p 00179000 103:05 4335931 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7fd6a0d25000-7fd6a0d2f000 r--p 00178000 103:05 4335931 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7fd6a0d2f000-7fd6a0d31000 rw-p 00182000 103:05 4335931 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7fd6a0d31000-7fd6a0d35000 rw-p 00000000 00:00 0
7fd6a0d35000-7fd6a0d4d000 r-xp 00000000 103:05 795951 /lib/x86_64-linux-gnu/libpthread-2.24.so
7fd6a0d4d000-7fd6a0f4d000 ---p 00018000 103:05 795951 /lib/x86_64-linux-gnu/libpthread-2.24.so
7fd6a0f4d000-7fd6a0f4e000 r--p 00018000 103:05 795951 /lib/x86_64-linux-gnu/libpthread-2.24.so
7fd6a0f4e000-7fd6a0f4f000 rw-p 00019000 103:05 795951 /lib/x86_64-linux-gnu/libpthread-2.24.so
7fd6a0f4f000-7fd6a0f53000 rw-p 00000000 00:00 0
7fd6a0f53000-7fd6a0f79000 r-xp 00000000 103:05 795932 /lib/x86_64-linux-gnu/ld-2.24.so
7fd6a114b000-7fd6a1150000 rw-p 00000000 00:00 0
7fd6a1174000-7fd6a1178000 rw-p 00000000 00:00 0
7fd6a1178000-7fd6a1179000 r--p 00025000 103:05 795932 /lib/x86_64-linux-gnu/ld-2.24.so
7fd6a1179000-7fd6a117a000 rw-p 00026000 103:05 795932 /lib/x86_64-linux-gnu/ld-2.24.so
7fd6a117a000-7fd6a117b000 rw-p 00000000 00:00 0
7fff9e622000-7fff9e643000 rw-p 00000000 00:00 0 [stack]
7fff9e714000-7fff9e716000 r--p 00000000 00:00 0 [vvar]
7fff9e716000-7fff9e718000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]

TL;DR: Your KeyType is a std::string and consequently non-pod. The STXXL does not support this.
See section Parameterizing STXXL Containers in the official STXXL FAQ.
See How to use std::string as key in stxxl::map here, where somebody had the same issue. Answers below that question describe possible workarounds.

Related

Resque error: DirtyExit - Child process received unhandled signal

My background jobs are all failing with the following error Resque::DirtyExit Child process received unhandled signal. After I restart the server they work for some minutes and then start failing. If I run the single jobs from Resque-schedule, they work fine.
Below is a part of the output of the resque-pool.stderr.log:
I've tried reducing the number of jobs to only one that only logs to a file, but the error persists.
I've also tried rebuilding the AWS server instance and the redis instance but the error is still there.
System details:
- Server instance: AWS linux version ( 4.14.88-72.76.amzn1.x86_64)
- Resque version: 1.27.4
- Redis: AWS elastic cache
- ruby: 2.3.8
- rails: 4.2
* Process memory map:
5613e7788000-5613e7a77000 r-xp 00000000 ca:01 170946 /opt/rubies/ruby-2.3.8/bin/ruby
5613e7c76000-5613e7c7c000 rw-p 002ee000 ca:01 170946 /opt/rubies/ruby-2.3.8/bin/ruby
5613e7c7c000-5613e7c8e000 rw-p 00000000 00:00 0
5613e7e33000-5613e95ce000 rw-p 00000000 00:00 0 [heap]
5613e95ce000-5613f2de3000 rw-p 00000000 00:00 0 [heap]
5613f2de3000-5613f314a000 rw-p 00000000 00:00 0 [heap]
5613f314a000-5613f316b000 rw-p 00000000 00:00 0 [heap]
7faccc000000-7faccc021000 rw-p 00000000 00:00 0
7faccc021000-7facd0000000 ---p 00000000 00:00 0
7facd0000000-7facd0021000 rw-p 00000000 00:00 0
7facd0021000-7facd4000000 ---p 00000000 00:00 0
7facd4000000-7facd4021000 rw-p 00000000 00:00 0
7facd4021000-7facd8000000 ---p 00000000 00:00 0
7facd8000000-7facd8021000 rw-p 00000000 00:00 0
7facd8021000-7facdc000000 ---p 00000000 00:00 0
7facdc000000-7facdc13c000 rw-p 00000000 00:00 0
7facdc13c000-7face0000000 ---p 00000000 00:00 0
7face4000000-7face4021000 rw-p 00000000 00:00 0
7face4021000-7face421b000 rw-p 00000000 00:00 0
7face421b000-7face4222000 rw-p 00000000 00:00 0
7face4222000-7face8000000 ---p 00000000 00:00 0
7faceb144000-7facec000000 r--s 00000000 ca:01 170946 /opt/rubies/ruby-2.3.8/bin/ruby
7facec000000-7facec021000 rw-p 00000000 00:00 0
7facec021000-7facec508000 rw-p 00000000 00:00 0
7facec508000-7facf0000000 ---p 00000000 00:00 0
7facf0890000-7facf0aa3000 r--s 00000000 ca:01 262174 /lib64/libc-2.17.so
7facf0aa3000-7facf0d4c000 r--s 00000000 ca:01 929288 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/grpc-1.14.2-x86_64-linux/src/ruby/lib/grpc/2.3/grpc_c.so
7facf0d4c000-7facf1150000 rw-p 00000000 00:00 0
7facf1150000-7facf1151000 r-xp 00000000 ca:01 171207 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/thread.so
7facf1151000-7facf1350000 ---p 00001000 ca:01 171207
7facf1552000-7facf1553000 ---p 00000000 00:00 0
7facf1553000-7facf1d53000 rw-p 00000000 00:00 0
7facf1d53000-7facf1d54000 ---p 00000000 00:00 0
/opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/bootsnap-1.3.2/lib/bootsnap/bootsnap.so
7facf3067000-7facf3266000 ---p 00003000 ca:01 917677 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/bootsnap-1.3.2/lib/bootsnap/bootsnap.so
7facf3266000-7facf3267000 rw-p 00002000 ca:01 917677 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/bootsnap-1.3.2/lib/bootsnap/bootsnap.so
7facf32fd000-7facf3310000 r-xp 00000000 ca:01 917623 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/msgpack-1.2.4/lib/msgpack/msgpack.so
7facf3310000-7facf3510000 ---p 00013000 ca:01 917623 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/msgpack-1.2.4/lib/msgpack/msgpack.so
7facf3510000-7facf3511000 rw-p 00013000 ca:01 917623 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/msgpack-1.2.4/lib/msgpack/msgpack.so
7facf3511000-7facf3515000 r-xp 00000000 ca:01 171126 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/io/console.so
7facf3515000-7facf3715000 ---p 00004000 ca:01 171126 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/io/console.so
7facf3715000-7facf3716000 rw-p 00004000 ca:01 171126 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/io/console.so
7facf3716000-7facf376d000 r-xp 00000000 ca:01 929163 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/google-protobuf-3.6.1-x86_64-linux/lib/google/2.3/protobuf_c.so
7facf376d000-7facf396c000 ---p 00057000 ca:01 929163 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/google-protobuf-3.6.1-x86_64-linux/lib/google/2.3/protobuf_c.so
7facf396c000-7facf3974000 r--p 00056000 ca:01 929163 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/google-protobuf-3.6.1-x86_64-linux/lib/google/2.3/protobuf_c.so
7facf3974000-7facf3976000 rw-p 0005e000 ca:01 929163 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/google-protobuf-3.6.1-x86_64-linux/lib/google/2.3/protobuf_c.so
7facf3976000-7facf3bdd000 r-xp 00000000 ca:01 929288 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/grpc-1.14.2-x86_64-linux/src/ruby/lib/grpc/2.3/grpc_c.so
7facf3bdd000-7facf3ddd000 ---p 00267000 ca:01 929288 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/grpc-1.14.2-x86_64-linux/src/ruby/lib/grpc/2.3/grpc_c.so
7facf3ddd000-7facf3df2000 r--p 00267000 ca:01 929288 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/grpc-1.14.2-x86_64-linux/src/ruby/lib/grpc/2.3/grpc_c.so
7facf3df2000-7facf3df9000 rw-p 0027c000 ca:01 929288 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/grpc-1.14.2-x86_64-linux/src/ruby/lib/grpc/2.3/grpc_c.so
7facf3df9000-7facf3dfe000 rw-p 00000000 00:00 0
7facf3dfe000-7facf3e00000 r-xp 00000000 ca:01 804772 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/debug_inspector-0.0.3/lib/debug_inspector.so
7facf3e00000-7facf3fff000 ---p 00002000 ca:01 804772 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/debug_inspector-0.0.3/lib/debug_inspector.so
7facf3fff000-7facf4000000 rw-p 00001000 ca:01 804772 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/debug_inspector-0.0.3/lib/debug_inspector.so
7facf4000000-7facf4054000 rw-p 00000000 00:00 0
7facf4054000-7facf8000000 ---p 00000000 00:00 0
7facf800c000-7facf810d000 rw-p 00000000 00:00 0
7facf810d000-7facf8110000 r-xp 00000000 ca:01 929639 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/google-cloud-debugger-0.32.2/lib/google/cloud/debugger/debugger_c.so
7facf8110000-7facf8310000 ---p 00003000 ca:01 929639 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/google-cloud-debugger-0.32.2/lib/google/cloud/debugger/debugger_c.so
7facf8310000-7facf8311000 rw-p 00003000 ca:01 929639 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/google-cloud-debugger-0.32.2/lib/google/cloud/debugger/debugger_c.so
7facf8311000-7facf8313000 r-xp 00000000 ca:01 171173 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/enc/iso_8859_1.so
7facf8313000-7facf8512000 ---p 00002000 ca:01 171173 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/enc/iso_8859_1.so
7facf8512000-7facf8513000 rw-p 00001000 ca:01 171173 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/enc/iso_8859_1.so
7facf8513000-7facf851e000 r-xp 00000000 ca:01 171211 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/objspace.so
7facf851e000-7facf871e000 ---p 0000b000 ca:01 171211 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/objspace.so
7facf871e000-7facf871f000 rw-p 0000b000 ca:01 171211 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/objspace.so
7facf871f000-7facf8722000 r-xp 00000000 ca:01 171138 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/enc/windows_31j.so
7facf8722000-7facf8921000 ---p 00003000 ca:01 171138 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/enc/windows_31j.so
7facf8921000-7facf8922000 rw-p 00002000 ca:01 171138 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/enc/windows_31j.so
7facf8922000-7facf8f43000 r-xp 00000000 ca:01 1053096 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/therubyracer-0.12.3/lib/v8/init.so
7facf8f43000-7facf9143000 ---p 00621000 ca:01 1053096 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/therubyracer-0.12.3/lib/v8/init.so
7facf9143000-7facf917e000 rw-p 00621000 ca:01 1053096 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/therubyracer-0.12.3/lib/v8/init.so
7facf917e000-7facf9182000 rw-p 00000000 00:00 0
7facf9182000-7facf918c000 r-xp 00000000 ca:01 171123 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/json/ext/generator.so
7facf918c000-7facf938b000 ---p 0000a000 ca:01 171123 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/json/ext/generator.so
7facf938b000-7facf938c000 rw-p 00009000 ca:01 171123 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/json/ext/generator.so
7facf938c000-7facf9392000 r-xp 00000000 ca:01 171124 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/json/ext/parser.so
7facf9392000-7facf9591000 ---p 00006000 ca:01 171124 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/json/ext/parser.so
7facf9591000-7facf9592000 rw-p 00005000 ca:01 171124 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/json/ext/parser.so
7facf9592000-7facf9595000 r-xp 00000000 ca:01 171157 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/enc/trans/utf_16_32.so
7facf9595000-7facf9795000 ---p 00003000 ca:01 171157 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/enc/trans/utf_16_32.so
7facf9795000-7facf9796000 rw-p 00003000 ca:01 171157 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/enc/trans/utf_16_32.so
7facf9796000-7facf97a2000 r-xp 00000000 ca:01 262192 /lib64/libnss_files-2.17.so
7facf97a2000-7facf99a1000 ---p 0000c000 ca:01 262192 /lib64/libnss_files-2.17.so
7facf99a1000-7facf99a2000 r--p 0000b000 ca:01 262192 /lib64/libnss_files-2.17.so
7facf99a2000-7facf99a3000 rw-p 0000c000 ca:01 262192 /lib64/libnss_files-2.17.so
7facf99a3000-7facf99a9000 rw-p 00000000 00:00 0
7facf99a9000-7facf99aa000 ---p 00000000 00:00 0
7facf99aa000-7facfa1aa000 rw-p 00000000 00:00 0
7facfa1aa000-7facfa1c0000 r-xp 00000000 ca:01 262163 /lib64/libgcc_s-7-20170915.so.1
7facfa1c0000-7facfa3bf000 ---p 00016000 ca:01 262163 /lib64/libgcc_s-7-20170915.so.1
7facfa3bf000-7facfa3c0000 rw-p 00015000 ca:01 262163 /lib64/libgcc_s-7-20170915.so.1
7facfa3c0000-7facfa535000 r-xp 00000000 ca:01 3438 /usr/lib64/libstdc++.so.6.0.24
7facfa535000-7facfa735000 ---p 00175000 ca:01 3438 /usr/lib64/libstdc++.so.6.0.24
7facfa735000-7facfa73f000 r--p 00175000 ca:01 3438 /usr/lib64/libstdc++.so.6.0.24
7facfa73f000-7facfa741000 rw-p 0017f000 ca:01 3438 /usr/lib64/libstdc++.so.6.0.24
7facfa741000-7facfa745000 rw-p 00000000 00:00 0
7facfa745000-7facfa99d000 r-xp 00000000 ca:01 145026 /usr/lib64/mysql/libmysqlclient.so.18.0.0
7facfa99d000-7facfab9c000 ---p 00258000 ca:01 145026 /usr/lib64/mysql/libmysqlclient.so.18.0.0
7facfab9c000-7facfac1d000 rw-p 00257000 ca:01 145026 /usr/lib64/mysql/libmysqlclient.so.18.0.0
7facfac1d000-7facfac22000 rw-p 00000000 00:00 0
7facfac22000-7facfac32000 r-xp 00000000 ca:01 931802 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/mysql2-0.4.10/lib/mysql2/mysql2.so
7facfac32000-7facfae32000 ---p 00010000 ca:01 931802 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/mysql2-0.4.10/lib/mysql2/mysql2.so
7facfae32000-7facfae34000 rw-p 00010000 ca:01 931802 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/mysql2-0.4.10/lib/mysql2/mysql2.so
7facfae34000-7facfae4b000 r-xp 00000000 ca:01 3014 /usr/lib64/gconv/CP932.so
7facfae4b000-7facfb04a000 ---p 00017000 ca:01 3014 /usr/lib64/gconv/CP932.so
7facfb04a000-7facfb04b000 r--p 00016000 ca:01 3014 /usr/lib64/gconv/CP932.so
7facfb04b000-7facfb04c000 rw-p 00017000 ca:01 3014 /usr/lib64/gconv/CP932.so
7facfb04c000-7facfb050000 r-xp 00000000 ca:01 433559 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/racc/cparse.so
7facfb050000-7facfb24f000 ---p 00004000 ca:01 433559 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/racc/cparse.so
7facfb24f000-7facfb250000 rw-p 00003000 ca:01 433559 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/racc/cparse.so
7facfb250000-7facfb273000 r-xp 00000000 ca:01 3441 /usr/lib64/liblzma.so.5.0.99
7facfb273000-7facfb473000 ---p 00023000 ca:01 3441 /usr/lib64/liblzma.so.5.0.99
7facfb473000-7facfb474000 rw-p 00023000 ca:01 3441 /usr/lib64/liblzma.so.5.0.99
7facfb474000-7facfb695000 r-xp 00000000 ca:01 800452 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/nokogiri-1.8.5/lib/nokogiri/nokogiri.so
7facfb695000-7facfb895000 ---p 00221000 ca:01 800452 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/nokogiri-1.8.5/lib/nokogiri/nokogiri.so
7facfb895000-7facfb8a1000 rw-p 00221000 ca:01 800452 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/nokogiri-1.8.5/lib/nokogiri/nokogiri.so
7facfb8a1000-7facfb8a3000 rw-p 00000000 00:00 0
7facfb8a3000-7facfb8a4000 r-xp 00000000 ca:01 171133 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/digest/sha2.so
7facfb8a4000-7facfbaa4000 ---p 00001000 ca:01 171133 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/digest/sha2.so
7facfbaa4000-7facfbaa5000 rw-p 00001000 ca:01 171133 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/digest/sha2.so
7facfbaa5000-7facfbab9000 r-xp 00000000 ca:01 171196 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/bigdecimal.so
7facfbab9000-7facfbcb8000 ---p 00014000 ca:01 171196 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/bigdecimal.so
7facfbcb8000-7facfbcb9000 rw-p 00013000 ca:01 171196 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/bigdecimal.so
7facfbcb9000-7facfbcd8000 r-xp 00000000 ca:01 4202 /usr/lib64/libyaml-0.so.2.0.4
7facfbcd8000-7facfbed7000 ---p 0001f000 ca:01 4202 /usr/lib64/libyaml-0.so.2.0.4
7facfbed7000-7facfbed8000 rw-p 0001e000 ca:01 4202 /usr/lib64/libyaml-0.so.2.0.4
7facfbed8000-7facfbede000 r-xp 00000000 ca:01 171118 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/psych.so
7facfbede000-7facfc0de000 ---p 00006000 ca:01 171118 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/psych.so
7facfc0de000-7facfc0df000 rw-p 00006000 ca:01 171118 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/psych.so
7facfc0df000-7facfc0e0000 r-xp 00000000 ca:01 171122 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/fcntl.so
7facfc0e0000-7facfc2df000 ---p 00001000 ca:01 171122 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/fcntl.so
7facfc2df000-7facfc2e0000 rw-p 00000000 ca:01 171122 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/fcntl.so
7facfc2e0000-7facfc2e6000 r-xp 00000000 ca:01 171199 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/strscan.so
7facfc2e6000-7facfc4e6000 ---p 00006000 ca:01 171199 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/strscan.so
7facfc4e6000-7facfc4e7000 rw-p 00006000 ca:01 171199 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/strscan.so
7facfc4e7000-7facfc4e8000 r-xp 00000000 ca:01 171132 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/digest/md5.so
7facfc4e8000-7facfc6e7000 ---p 00001000 ca:01 171132 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/digest/md5.so
7facfc6e7000-7facfc6e8000 rw-p 00000000 ca:01 171132 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/digest/md5.so
7facfc6e8000-7facfc6f8000 r-xp 00000000 ca:01 171214 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/zlib.so
7facfc6f8000-7facfc8f7000 ---p 00010000 ca:01 171214 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/zlib.so
7facfc8f7000-7facfc8f8000 rw-p 0000f000 ca:01 171214 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/zlib.so
7facfc8f8000-7facfc92e000 r-xp 00000000 ca:01 171193 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/date_core.so
7facfc92e000-7facfcb2d000 ---p 00036000 ca:01 171193 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/date_core.so
7facfcb2d000-7facfcb2f000 rw-p 00035000 ca:01 171193 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/date_core.so
7facfcb2f000-7facfcb31000 rw-p 00000000 00:00 0
7facfcb31000-7facfcb3b000 r-xp 00000000 ca:01 930573 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/json-1.8.6/lib/json/ext/generator.so
7facfcb3b000-7facfcd3a000 ---p 0000a000 ca:01 930573 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/json-1.8.6/lib/json/ext/generator.so
7facfcd3a000-7facfcd3b000 rw-p 00009000 ca:01 930573 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/json-1.8.6/lib/json/ext/generator.so
7facfcd3b000-7facfcd3c000 r-xp 00000000 ca:01 171140 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/enc/utf_32le.so
7facfcd3c000-7facfcf3c000 ---p 00001000 ca:01 171140 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/enc/utf_32le.so
7facfcf3c000-7facfcf3d000 rw-p 00001000 ca:01 171140 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/enc/utf_32le.so
7facfcf3d000-7facfcf3e000 r-xp 00000000 ca:01 171188 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/enc/utf_32be.so
7facfcf3e000-7facfd13e000 ---p 00001000 ca:01 171188 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/enc/utf_32be.so
7facfd13e000-7facfd13f000 rw-p 00001000 ca:01 171188 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/enc/utf_32be.so
7facfd13f000-7facfd140000 r-xp 00000000 ca:01 171151 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/enc/utf_16le.so
7facfd140000-7facfd340000 ---p 00001000 ca:01 171151 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/enc/utf_16le.so
7facfd340000-7facfd341000 rw-p 00001000 ca:01 171151 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/enc/utf_16le.so
7facfd341000-7facfd342000 r-xp 00000000 ca:01 171192 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/enc/utf_16be.so
7facfd342000-7facfd542000 ---p 00001000 ca:01 171192 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/enc/utf_16be.so
7facfd542000-7facfd543000 rw-p 00001000 ca:01 171192 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/enc/utf_16be.so
7facfd543000-7facfd549000 r-xp 00000000 ca:01 930581 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/json-1.8.6/lib/json/ext/parser.so
7facfd549000-7facfd748000 ---p 00006000 ca:01 930581 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/json-1.8.6/lib/json/ext/parser.so
7facfd748000-7facfd749000 rw-p 00005000 ca:01 930581 /opt/rubies/ruby-2.3.8/lib/ruby/gems/2.3.0/gems/json-1.8.6/lib/json/ext/parser.so
7facfd749000-7facfd74a000 r-xp 00000000 ca:01 171127 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/io/nonblock.so
7facfd74a000-7facfd94a000 ---p 00001000 ca:01 171127 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/io/nonblock.so
7facfd94a000-7facfd94b000 rw-p 00001000 ca:01 171127 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/io/nonblock.so
7facfd94b000-7facfd99d000 r-xp 00000000 ca:01 171134 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/openssl.so
7facfd99d000-7facfdb9d000 ---p 00052000 ca:01 171134 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/openssl.so
7facfdb9d000-7facfdba1000 rw-p 00052000 ca:01 171134 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/openssl.so
7facfdba1000-7facfdba2000 r-xp 00000000 ca:01 171125 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/io/wait.so
7facfdba2000-7facfdda2000 ---p 00001000 ca:01 171125 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/io/wait.so
7facfdda2000-7facfdda3000 rw-p 00001000 ca:01 171125 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/io/wait.so
7facfdda3000-7facfddcd000 r-xp 00000000 ca:01 171212 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/socket.so
7facfddcd000-7facfdfcd000 ---p 0002a000 ca:01 171212 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/socket.so
7facfdfcd000-7facfdfce000 rw-p 0002a000 ca:01 171212 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/socket.so
7facfdfce000-7facfdfeb000 r-xp 00000000 ca:01 262220 /lib64/libtinfo.so.5.7
7facfdfeb000-7facfe1ea000 ---p 0001d000 ca:01 262220 /lib64/libtinfo.so.5.7
7facfe1ea000-7facfe1ef000 rw-p 0001c000 ca:01 262220 /lib64/libtinfo.so.5.7
7facfe1ef000-7facfe214000 r-xp 00000000 ca:01 262216 /lib64/libncurses.so.5.7
7facfe214000-7facfe414000 ---p 00025000 ca:01 262216 /lib64/libncurses.so.5.7
7facfe414000-7facfe415000 rw-p 00025000 ca:01 262216 /lib64/libncurses.so.5.7
7facfe415000-7facfe451000 r-xp 00000000 ca:01 262236 /lib64/libreadline.so.6.2
7facfe451000-7facfe651000 ---p 0003c000 ca:01 262236 /lib64/libreadline.so.6.2
7facfe651000-7facfe659000 rw-p 0003c000 ca:01 262236 /lib64/libreadline.so.6.2
7facfe659000-7facfe65a000 rw-p 00000000 00:00 0
7facfe65a000-7facfe661000 r-xp 00000000 ca:01 171128 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/readline.so
7facfe661000-7facfe861000 ---p 00007000 ca:01 171128 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/readline.so
7facfe861000-7facfe862000 rw-p 00007000 ca:01 171128 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/readline.so
7facfe862000-7facfe863000 r-xp 00000000 ca:01 171204 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/cgi/escape.so
7facfe863000-7facfea63000 ---p 00001000 ca:01 171204 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/cgi/escape.so
7facfea63000-7facfea64000 rw-p 00001000 ca:01 171204 /opt/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-linux/cgi/escape.so
7facfea64000-7facfea82000 r-xp 00000000 ca:01 3344 /usr/lib64/libselinux.so.1
7facfea82000-7facfec81000 ---p 0001e000 ca:01 3344 /usr/lib64/libselinux.so.1
7facfec81000-7facfec82000 r--p 0001d000 ca:01 3344 /usr/lib64/libselinux.so.1
7facfec82000-7facfec83000 rw-p 0001e000 ca:01 3344 /usr/lib64/libselinux.so.1
7facfec83000-7facfec85000 rw-p 00000000 00:00 0
7facfec85000-7facfec9b000 r-xp 00000000 ca:01 262202 /lib64/libresolv-2.17.so
7facfec9b000-7facfee9a000 ---p 00016000 ca:01 262202 /lib64/libresolv-2.17.so
7facfee9a000-7facfee9b000 r--p 00015000 ca:01 262202 /lib64/libresolv-2.17.so
7facfee9b000-7facfee9c000 rw-p 00016000 ca:01 262202 /lib64/libresolv-2.17.so
7facfee9c000-7facfee9e000 rw-p 00000000 00:00 0
7facfee9e000-7facfeea1000 r-xp 00000000 ca:01 262262 /lib64/libkeyutils.so.1.5
7facfeea1000-7facff0a0000 ---p 00003000 ca:01 262262 /lib64/libkeyutils.so.1.5
7facff0a0000-7facff0a1000 rw-p 00002000 ca:01 262262 /lib64/libkeyutils.so.1.5
7facff0a1000-7facff0ae000 r-xp 00000000 ca:01 7456 /usr/lib64/libkrb5support.so.0.1
7facff0ae000-7facff2ad000 ---p 0000d000 ca:01 7456 /usr/lib64/libkrb5support.so.0.1
7facff2ad000-7facff2ae000 r--p 0000c000 ca:01 7456 /usr/lib64/libkrb5support.so.0.1
7facff2ae000-7facff2af000 rw-p 0000d000 ca:01 7456 /usr/lib64/libkrb5support.so.0.1
7facff2af000-7facff2df000 r-xp 00000000 ca:01 7448 /usr/lib64/libk5crypto.so.3.1
7facff2df000-7facff4df000 ---p 00030000 ca:01 7448 /usr/lib64/libk5crypto.so.3.1
7facff4df000-7facff4e1000 r--p 00030000 ca:01 7448 /usr/lib64/libk5crypto.so.3.1
7facff4e1000-7facff4e2000 rw-p 00032000 ca:01 7448 /usr/lib64/libk5crypto.so.3.1
7facff4e2000-7facff4e5000 r-xp 00000000 ca:01 3357 /usr/lib64/libcom_err.so.2.1
7facff4e5000-7facff6e4000 ---p 00003000 ca:01 3357 /usr/lib64/libcom_err.so.2.1
7facff6e4000-7facff6e5000 rw-p 00002000 ca:01 3357 /usr/lib64/libcom_err.so.2.1
7facff6e5000-7facff7bd000 r-xp 00000000 ca:01 7454 /usr/lib64/libkrb5.so.3.3
7facff7bd000-7facff9bc000 ---p 000d8000 ca:01 7454 /usr/lib64/libkrb5.so.3.3
7facff9bc000-7facff9ca000 r--p 000d7000 ca:01 7454 /usr/lib64/libkrb5.so.3.3
7facff9ca000-7facff9cd000 rw-p 000e5000 ca:01 7454 /usr/lib64/libkrb5.so.3.3
7facff9cd000-7facffa17000 r-xp 00000000 ca:01 7444
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
E0910 10:33:49.859056505 26018 sync_posix.cc:47] assertion failed: pthread_mutex_lock(mu) == 0
E0910 10:33:55.198436313 26035 sync_posix.cc:47] assertion failed: pthread_mutex_lock(mu) == 0
E0910 10:34:00.233557356 26046 sync_posix.cc:47] assertion failed: pthread_mutex_lock(mu) == 0
E0910 10:34:05.286323933 26069 sync_posix.cc:47] assertion failed: pthread_mutex_lock(mu) == 0
E0910 10:34:05.310868135 26075 sync_posix.cc:47] assertion failed: pthread_mutex_lock(mu) == 0
Your workers might be running out of memory.
Run dmesg and look for any "out of memory" errors.

Redirection of crash output

I've found that some programs print Memory Maps and other diagnostic information to the terminal when they crash, even when I redirect file descriptors 1 and 2 (standard out and error, respectively) to files. How can I redirect the diagnostics to a file?
For example, this c++ program:
#include <iostream>
#include <assert.h>
#include <string>
int main(){
using namespace std;
cout<<"foo"<<endl;
cerr<<"bar"<<endl;
string s;
s = "asdf";
delete &s;
}
After compilation, it can be run, redirecting "all" output (g++ foo.cpp && ./a.out > /dev/null 2>&1) but still print the following to the terminal:
======*** Error in `./a.out': double free or corruption (out): 0x00007ffe389313d0 ***
======= Backtrace: =========
/usr/lib/libc.so.6(+0x722ab)[0x7fc7c053f2ab]
/usr/lib/libc.so.6(+0x7890e)[0x7fc7c054590e]
/usr/lib/libc.so.6(+0x7911e)[0x7fc7c054611e]
./a.out[0x400b41]
/usr/lib/libc.so.6(__libc_start_main+0xf1)[0x7fc7c04ed511]
./a.out[0x4009fa]
= Memory map: ========
00400000-00401000 r-xp 00000000 00:27 531373 /tmp/a.out
00601000-00602000 r--p 00001000 00:27 531373 /tmp/a.out
00602000-00603000 rw-p 00002000 00:27 531373 /tmp/a.out
01f1d000-01f4f000 rw-p 00000000 00:00 0 [heap]
7fc7bc000000-7fc7bc021000 rw-p 00000000 00:00 0
7fc7bc021000-7fc7c0000000 ---p 00000000 00:00 0
7fc7c04cd000-7fc7c0668000 r-xp 00000000 08:09 142916 /usr/lib/libc-2.25.so
7fc7c0668000-7fc7c0867000 ---p 0019b000 08:09 142916 /usr/lib/libc-2.25.so
7fc7c0867000-7fc7c086b000 r--p 0019a000 08:09 142916 /usr/lib/libc-2.25.so
7fc7c086b000-7fc7c086d000 rw-p 0019e000 08:09 142916 /usr/lib/libc-2.25.so
7fc7c086d000-7fc7c0871000 rw-p 00000000 00:00 0
7fc7c0871000-7fc7c0887000 r-xp 00000000 08:09 144514 /usr/lib/libgcc_s.so.1
7fc7c0887000-7fc7c0a86000 ---p 00016000 08:09 144514 /usr/lib/libgcc_s.so.1
7fc7c0a86000-7fc7c0a87000 r--p 00015000 08:09 144514 /usr/lib/libgcc_s.so.1
7fc7c0a87000-7fc7c0a88000 rw-p 00016000 08:09 144514 /usr/lib/libgcc_s.so.1
7fc7c0a88000-7fc7c0b9a000 r-xp 00000000 08:09 131998 /usr/lib/libm-2.25.so
7fc7c0b9a000-7fc7c0d99000 ---p 00112000 08:09 131998 /usr/lib/libm-2.25.so
7fc7c0d99000-7fc7c0d9a000 r--p 00111000 08:09 131998 /usr/lib/libm-2.25.so
7fc7c0d9a000-7fc7c0d9b000 rw-p 00112000 08:09 131998 /usr/lib/libm-2.25.so
7fc7c0d9b000-7fc7c0f13000 r-xp 00000000 08:09 141919 /usr/lib/libstdc++.so.6.0.22
7fc7c0f13000-7fc7c1113000 ---p 00178000 08:09 141919 /usr/lib/libstdc++.so.6.0.22
7fc7c1113000-7fc7c111d000 r--p 00178000 08:09 141919 /usr/lib/libstdc++.so.6.0.22
7fc7c111d000-7fc7c111f000 rw-p 00182000 08:09 141919 /usr/lib/libstdc++.so.6.0.22
7fc7c111f000-7fc7c1123000 rw-p 00000000 00:00 0
7fc7c1123000-7fc7c1146000 r-xp 00000000 08:09 142957 /usr/lib/ld-2.25.so
7fc7c1318000-7fc7c131e000 rw-p 00000000 00:00 0
7fc7c1344000-7fc7c1345000 rw-p 00000000 00:00 0
7fc7c1345000-7fc7c1346000 r--p 00022000 08:09 142957 /usr/lib/ld-2.25.so
7fc7c1346000-7fc7c1347000 rw-p 00023000 08:09 142957 /usr/lib/ld-2.25.so
7fc7c1347000-7fc7c1348000 rw-p 00000000 00:00 0
7ffe38911000-7ffe38932000 rw-p 00000000 00:00 0 [stack]
7ffe38945000-7ffe38947000 r--p 00000000 00:00 0 [vvar]
7ffe38947000-7ffe38949000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted (core dumped)
To redirrect output from /dev/tty to a file you can do:
script -q -c 'g++ foo.cpp && ./a.out' /dev/null > /tmp/bla.txt
Taken from here - How to redirect a program that writes to tty?

stack smash error occured in using a staic library

i developed a static library, and a test application to call its
functions.
Now, when i am executing the test application, it was able to get in to
the function and calculate the required values, but when the return is
called it is giving stack smash error
./test_app
USB Handle opened SUCCESSFULLY
*** stack smashing detected ***: /home/avinay/Documents/iProbe/Experiments/iProbe_linux_lib/test_app terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7ffff7b25807]
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x0)[0x7ffff7b257d0]
/home/avinay/Documents/iProbe/Experiments/iProbe_linux_lib/test_app[0x4008ec]
/home/avinay/Documents/iProbe/Experiments/iProbe_linux_lib/test_app[0x4006ed]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7ffff7a3c76d]
/home/avinay/Documents/iProbe/Experiments/iProbe_linux_lib/test_app[0x400619]
======= Memory map: ========
00400000-00402000 r-xp 00000000 08:08 1186 /home/avinay/Documents/iProbe/Experiments/iProbe_linux_lib/test_app
00601000-00602000 r--p 00001000 08:08 1186 /home/avinay/Documents/iProbe/Experiments/iProbe_linux_lib/test_app
00602000-00603000 rw-p 00002000 08:08 1186 /home/avinay/Documents/iProbe/Experiments/iProbe_linux_lib/test_app
00603000-00624000 rw-p 00000000 00:00 0 [heap]
7ffff7805000-7ffff781a000 r-xp 00000000 08:05 658720 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff781a000-7ffff7a19000 ---p 00015000 08:05 658720 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff7a19000-7ffff7a1a000 r--p 00014000 08:05 658720 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff7a1a000-7ffff7a1b000 rw-p 00015000 08:05 658720 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff7a1b000-7ffff7bd0000 r-xp 00000000 08:05 658699 /lib/x86_64-linux-gnu/libc-2.15.so
7ffff7bd0000-7ffff7dcf000 ---p 001b5000 08:05 658699 /lib/x86_64-linux-gnu/libc-2.15.so
7ffff7dcf000-7ffff7dd3000 r--p 001b4000 08:05 658699 /lib/x86_64-linux-gnu/libc-2.15.so
7ffff7dd3000-7ffff7dd5000 rw-p 001b8000 08:05 658699 /lib/x86_64-linux-gnu/libc-2.15.so
7ffff7dd5000-7ffff7dda000 rw-p 00000000 00:00 0
7ffff7dda000-7ffff7dfc000 r-xp 00000000 08:05 658679 /lib/x86_64-linux-gnu/ld-2.15.so
7ffff7fdd000-7ffff7fe0000 rw-p 00000000 00:00 0
7ffff7ff6000-7ffff7ffb000 rw-p 00000000 00:00 0
7ffff7ffb000-7ffff7ffc000 r-xp 00000000 00:00 0 [vdso]
7ffff7ffc000-7ffff7ffd000 r--p 00022000 08:05 658679 /lib/x86_64-linux-gnu/ld-2.15.so
7ffff7ffd000-7ffff7fff000 rw-p 00023000 08:05 658679 /lib/x86_64-linux-gnu/ld-2.15.so
7ffffffde000-7ffffffff000 rw-p 00000000 00:00 0 [stack]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Here is the test application
#include <stdio.h>
#include "leapfrog.h"
void main()
{
unsigned int mid=0x0;
USB_Init();
mid = Read_MID();
printf("\n mid = 0x%x\n",mid);
USB_Deinit();
return;
}
The above was the test application and it was referencing this function in the library
uint16 Read_MID(void)
{
int8 buf[8]={0};
uint16 mid;
//Read Vendor id
buf[0] = 0xFE;
msp_write(0x41,buf,1);
msp_read(0x41,buf,2);
mid = buf[0];
mid <<= 8;
mid |= buf[1];
return mid;
}
till the "mid" calculation i could get the correct values. it is reaching till the end while debugging with insight debugger. just after "}" in the console i see the stack smash error.
what might be the cause of the stack smash.
Thank you for time and patience.
I resolved it by adding more array space.
int8 buf[8]={0};
i made it as
int8 buf[10]={0};

QWindow Program on QT Creator won't run

I have made a program on Qt Creator which builds without errors. But when I try to run it, I get the following in my output pane. Can anyone please tell me what this means/how to fix this? I would appreciate any help.
&"warning: GDB: Failed to set controlling terminal: Invalid argument\n"
*** glibc detected *** /home/test/Documents/Wave-build-desktop/Wave: double free or corruption (!prev): 0x000000000060b580 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x733b6)[0x7ffff5d423b6]
/lib64/libc.so.6(cfree+0x6c)[0x7ffff5d472dc]
/home/test/Documents/Wave-build-desktop/Wave[0x405359]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x7ffff5cedbfd]
/home/test/Documents/Wave-build-desktop/Wave[0x4042b9]
======= Memory map: ========
00400000-00409000 r-xp 00000000 08:03 9962314 /home/test/Documents/Wave-build-desktop/Wave
00608000-00609000 r--p 00008000 08:03 9962314 /home/test/Documents/Wave-build-desktop/Wave
00609000-0060a000 rw-p 00009000 08:03 9962314 /home/test/Documents/Wave-build-desktop/Wave
0060a000-0062b000 rw-p 00000000 00:00 0 [heap]
7fffec000000-7fffec021000 rw-p 00000000 00:00 0
7fffec021000-7ffff0000000 ---p 00000000 00:00 0
7ffff083c000-7ffff283d000 rw-p 00000000 00:00 0
7ffff283d000-7ffff283f000 r-xp 00000000 08:03 3806318 /usr/lib64/libXau.so.6.0.0
7ffff283f000-7ffff2a3f000 ---p 00002000 08:03 3806318 /usr/lib64/libXau.so.6.0.0
7ffff2a3f000-7ffff2a40000 r--p 00002000 08:03 3806318 /usr/lib64/libXau.so.6.0.0
7ffff2a40000-7ffff2a41000 rw-p 00003000 08:03 3806318 /usr/lib64/libXau.so.6.0.0
7ffff2a41000-7ffff2a5d000 r-xp 00000000 08:03 3806425 /usr/lib64/libxcb.so.1.1.0
7ffff2a5d000-7ffff2c5c000 ---p 0001c000 08:03 3806425 /usr/lib64/libxcb.so.1.1.0
7ffff2c5c000-7ffff2c5d000 r--p 0001b000 08:03 3806425 /usr/lib64/libxcb.so.1.1.0
7ffff2c5d000-7ffff2c5e000 rw-p 0001c000 08:03 3806425 /usr/lib64/libxcb.so.1.1.0
7ffff2c5e000-7ffff2c85000 r-xp 00000000 08:03 10747978 /lib64/libexpat.so.1.5.2
7ffff2c85000-7ffff2e85000 ---p 00027000 08:03 10747978 /lib64/libexpat.so.1.5.2
7ffff2e85000-7ffff2e87000 r--p 00027000 08:03 10747978 /lib64/libexpat.so.1.5.2
7ffff2e87000-7ffff2e88000 rw-p 00029000 08:03 10747978 /lib64/libexpat.so.1.5.2
7ffff2e88000-7ffff2e8c000 r-xp 00000000 08:03 10748069 /lib64/libuuid.so.1.3.0
7ffff2e8c000-7ffff308b000 ---p 00004000 08:03 10748069 /lib64/libuuid.so.1.3.0
7ffff308b000-7ffff308c000 r--p 00003000 08:03 10748069 /lib64/libuuid.so.1.3.0
7ffff308c000-7ffff308d000 rw-p 00004000 08:03 10748069 /lib64/libuuid.so.1.3.0
7ffff308d000-7ffff30c2000 r-xp 00000000 08:03 10747968 /lib64/libpcre.so.0.0.1
7ffff30c2000-7ffff32c1000 ---p 00035000 08:03 10747968 /lib64/libpcre.so.0.0.1
7ffff32c1000-7ffff32c2000 r--p 00034000 08:03 10747968 /lib64/libpcre.so.0.0.1
7ffff32c2000-7ffff32c3000 rw-p 00035000 08:03 10747968 /lib64/libpcre.so.0.0.1
7ffff32c3000-7ffff32c7000 r-xp 00000000 08:03 10748045 /lib64/libgthread-2.0.so.0.2800.0
7ffff32c7000-7ffff34c6000 ---p 00004000 08:03 10748045 /lib64/libgthread-2.0.so.0.2800.0
7ffff34c6000-7ffff34c7000 r--p 00003000 08:03 10748045 /lib64/libgthread-2.0.so.0.2800.0
7ffff34c7000-7ffff34c8000 rw-p 00004000 08:03 10748045 /lib64/libgthread-2.0.so.0.2800.0
7ffff34c8000-7ffff3605000 r-xp 00000000 08:03 3806790 /usr/lib64/libX11.so.6.3.0
7ffff3605000-7ffff3805000 ---p 0013d000 08:03 3806790 /usr/lib64/libX11.so.6.3.0
7ffff3805000-7ffff3806000 r--p 0013d000 08:03 3806790 /usr/lib64/libX11.so.6.3.0
7ffff3806000-7ffff380b000 rw-p 0013e000 08:03 3806790 /usr/lib64/libX11.so.6.3.0
7ffff380b000-7ffff381d000 r-xp 00000000 08:03 3807691 /usr/lib64/libXext.so.6.4.0
7ffff381d000-7ffff3a1c000 ---p 00012000 08:03 3807691 /usr/lib64/libXext.so.6.4.0
7ffff3a1c000-7ffff3a1d000 r--p 00011000 08:03 3807691 /usr/lib64/libXext.so.6.4.0
7ffff3a1d000-7ffff3a1e000 rw-p 00012000 08:03 3807691 /usr/lib64/libXext.so.6.4.0
7ffff3a1e000-7ffff3a53000 r-xp 00000000 08:03 3806497 /usr/lib64/libfontconfig.so.1.4.4
7ffff3a53000-7ffff3c53000 ---p 00035000 08:03 3806497 /usr/lib64/libfontconfig.so.1.4.4
7ffff3c53000-7ffff3c54000 r--p 00035000 08:03 3806497 /usr/lib64/libfontconfig.so.1.4.4
7ffff3c54000-7ffff3c55000 rw-p 00036000 08:03 3806497 /usr/lib64/libfontconfig.so.1.4.4
7ffff3c55000-7ffff3c57000 r-xp 00000000 08:03 3808118 /usr/lib64/libXinerama.so.1.0.0
7ffff3c57000-7ffff3e56000 ---p 00002000 08:03 3808118 /usr/lib64/libXinerama.so.1.0.0
7ffff3e56000-7ffff3e57000 r--p 00001000 08:03 3808118 /usr/lib64/libXinerama.so.1.0.0
7ffff3e57000-7ffff3e58000 rw-p 00002000 08:03 3808118 /usr/lib64/libXinerama.so.1.0.0
7ffff3e58000-7ffff3e62000 r-xp 00000000 08:03 3808106 /usr/lib64/libXcursor.so.1.0.2
7ffff3e62000-7ffff4061000 ---p 0000a000 08:03 3808106 /usr/lib64/libXcursor.so.1.0.2
7ffff4061000-7ffff4062000 r--p 00009000 08:03 3808106 /usr/lib64/libXcursor.so.1.0.2
7ffff4062000-7ffff4063000 rw-p 0000a000 08:03 3808106 /usr/lib64/libXcursor.so.1.0.2
7ffff4063000-7ffff4068000 r-xp 00000000 08:03 3807689 /usr/lib64/libXfixes.so.3.1.0
7ffff4068000-7ffff4267000 ---p 00005000 08:03 3807689 /usr/lib64/libXfixes.so.3.1.0
7ffff4267000-7ffff4268000 r--p 00004000 08:03 3807689 /usr/lib64/libXfixes.so.3.1.0
7ffff4268000-7ffff4269000 rw-p 00005000 08:03 3807689 /usr/lib64/libXfixes.so.3.1.0
7ffff4269000-7ffff4271000 r-xp 00000000 08:03 3808122 /usr/lib64/libXrandr.so.2.2.0
7ffff4271000-7ffff4470000 ---p 00008000 08:03 3808122 /usr/lib64/libXrandr.so.2.2.0
7ffff4470000-7ffff4471000 r--p 00007000 08:03 3808122 /usr/lib64/libXrandr.so.2.2.0
7ffff4471000-7ffff4472000 rw-p 00008000 08:03 3808122 /usr/lib64/libXrandr.so.2.2.0
7ffff4472000-7ffff447c000 r-xp 00000000 08:03 3807681 /usr/lib64/libXrender.so.1.3.0
7ffff447c000-7ffff467b000 ---p 0000a000 08:03 3807681 /usr/lib64/libXrender.so.1.3.0
7ffff467b000-7ffff467c000 r--p 00009000 08:03 3807681 /usr/lib64/libXrender.so.1.3.0
7ffff467c000-7ffff467d000 rw-p 0000a000 08:03 3807681 /usr/lib64/libXrender.so.1.3.0
7ffff467d000-7ffff468c000 r-xp 00000000 08:03 3807981 /usr/lib64/libXi.so.6.1.0
7ffff468c000-7ffff488b000 ---p 0000f000 08:03 3807981 /usr/lib64/libXi.so.6.1.0
7ffff488b000-7ffff488c000 r--p 0000e000 08:03 3807981 /usr/lib64/libXi.so.6.1.0
7ffff488c000-7ffff488d000 rw-p 0000f000 08:03 3807981 /usr/lib64/libXi.so.6.1.0
7ffff488d000-7ffff48a4000 r-xp 00000000 08:03 3806320 /usr/lib64/libICE.so.6.3.0
7ffff48a4000-7ffff4aa4000 ---p 00017000 08:03 3806320 /usr/lib64/libICE.so.6.3.0
7ffff4aa4000-7ffff4aa5000 r--p 00017000 08:03 3806320 /usr/lib64/libICE.so.6.3.0
7ffff4aa5000-7ffff4aa6000 rw-p 00018000 08:03 3806320 /usr/lib64/libICE.so.6.3.0
7ffff4aa6000-7ffff4aaa000 rw-p 00000000 00:00 0
7ffff4aaa000-7ffff4ab1000 r-xp 00000000 08:03 3806608 /usr/lib64/libSM.so.6.0.1
7ffff4ab1000-7ffff4cb1000 ---p 00007000 08:03 3806608 /usr/lib64/libSM.so.6.0.1
7ffff4cb1000-7ffff4cb2000 r--p 00007000 08:03 3806608 /usr/lib64/libSM.so.6.0.1
7ffff4cb2000-7ffff4cb3000 rw-p 00008000 08:03 3806608 /usr/lib64/libSM.so.6.0.1
7ffff4cb3000-7ffff4d01000 r-xp 00000000 08:03 10748064 /lib64/libgobject-2.0.so.0.2800.0
7ffff4d01000-7ffff4f01000 ---p 0004e000 08:03 10748064 /lib64/libgobject-2.0.so.0.2800.0
7ffff4f01000-7ffff4f02000 r--p 0004e000 08:03 10748064 /lib64/libgobject-2.0.so.0.2800.0
7ffff4f02000-7ffff4f03000 rw-p 0004f000 08:03 10748064 /lib64/libgobject-2.0.so.0.2800.0
7ffff4f03000-7ffff4f04000 rw-p 00000000 00:00 0
7ffff4f04000-7ffff4f88000 r-xp 00000000 08:03 3806341 /usr/lib64/libfreetype.so.6.6.2
7ffff4f88000-7ffff5188000 ---p 00084000 08:03 3806341 /usr/lib64/libfreetype.so.6.6.2
7ffff5188000-7ffff518d000 r--p 00084000 08:03 3806341 /usr/lib64/libfreetype.so.6.6.2
7ffff518d000-7ffff518e000 rw-p 00089000 08:03 3806341 /usr/lib64/libfreetype.so.6.6.2
7ffff518e000-7ffff51a4000 r-xp 00000000 08:03 10748027 /lib64/libz.so.1.2.5
7ffff51a4000-7ffff53a4000 ---p 00016000 08:03 10748027 /lib64/libz.so.1.2.5
7ffff53a4000-7ffff53a5000 r--p 00016000 08:03 10748027 /lib64/libz.so.1.2.5
7ffff53a5000-7ffff53a6000 rw-p 00017000 08:03 10748027 /lib64/libz.so.1.2.5
7ffff53a6000-7ffff53cf000 r-xp 00000000 08:03 3806339 /usr/lib64/libpng14.so.14.4.0
7ffff53cf000-7ffff55ce000 ---p 00029000 08:03 3806339 /usr/lib64/libpng14.so.14.4.0
7ffff55ce000-7ffff55cf000 r--p 00028000 08:03 3806339 /usr/lib64/libpng14.so.14.4.0
7ffff55cf000-7ffff55d0000 rw-p 00029000 08:03 3806339 /usr/lib64/libpng14.so.14.4.0
7ffff55d0000-7ffff56c0000 r-xp 00000000 08:03 10748033 /lib64/libglib-2.0.so.0.2800.0
7ffff56c0000-7ffff58bf000 ---p 000f0000 08:03 10748033 /lib64/libglib-2.0.so.0.2800.0
7ffff58bf000-7ffff58c0000 r--p 000ef000 08:03 10748033 /lib64/libglib-2.0.so.0.2800.0
7ffff58c0000-7ffff58c1000 rw-p 000f0000 08:03 10748033 /lib64/libglib-2.0.so.0.2800.0
7ffff58c1000-7ffff58c2000 rw-p 00000000 00:00 0
7ffff58c2000-7ffff58ca000 r-xp 00000000 08:03 10747943 /lib64/librt-2.11.3.so
7ffff58ca000-7ffff5ac9000 ---p 00008000 08:03 10747943 /lib64/librt-2.11.3.so
7ffff5ac9000-7ffff5aca000 r--p 00007000 08:03 10747943 /lib64/librt-2.11.3.so
7ffff5aca000-7ffff5acb000 rw-p 00008000 08:03 10747943 /lib64/librt-2.11.3.so
7ffff5acb000-7ffff5acd000 r-xp 00000000 08:03 10747919 /lib64/libdl-2.11.3.so
7ffff5acd000-7ffff5ccd000 ---p 00002000 08:03 10747919 /lib64/libdl-2.11.3.so
7ffff5ccd000-7ffff5cce000 r--p 00002000 08:03 10747919 /lib64/libdl-2.11.3.so
7ffff5cce000-7ffff5ccf000 rw-p 00003000 08:03 10747919 /lib64/libdl-2.11.3.so
7ffff5ccf000-7ffff5e33000 r-xp 00000000 08:03 10747913 /lib64/libc-2.11.3.so
7ffff5e33000-7ffff6032000 ---p 00164000 08:03 10747913 /lib64/libc-2.11.3.so
7ffff6032000-7ffff6036000 r--p 00163000 08:03 10747913 /lib64/libc-2.11.3.so
7ffff6036000-7ffff6037000 rw-p 00167000 08:03 10747913 /lib64/libc-2.11.3.so
7ffff6037000-7ffff603c000 rw-p 00000000 00:00 0
7ffff603c000-7ffff6051000 r-xp 00000000 08:03 10748067 /lib64/libgcc_s.so.1
7ffff6051000-7ffff6250000 ---p 00015000 08:03 10748067 /lib64/libgcc_s.so.1
7ffff6250000-7ffff6251000 r--p 00014000 08:03 10748067 /lib64/libgcc_s.so.1
7ffff6251000-7ffff6252000 rw-p 00015000 08:03 10748067 /lib64/libgcc_s.so.1
7ffff6252000-7ffff62a8000 r-xp 00000000 08:03 10747921 /lib64/libm-2.11.3.so
7ffff62a8000-7ffff64a7000 ---p 00056000 08:03 10747921 /lib64/libm-2.11.3.so
7ffff64a7000-7ffff64a8000 r--p 00055000 08:03 10747921 /lib64/libm-2.11.3.so
7ffff64a8000-7ffff64a9000 rw-p 00056000 08:03 10747921 /lib64/libm-2.11.3.so
7ffff64a9000-7ffff6594000 r-xp 00000000 08:03 3806566 /usr/lib64/libstdc++.so.6.0.14
7ffff6594000-7ffff6793000 ---p 000eb000 08:03 3806566 /usr/lib64/libstdc++.so.6.0.14
7ffff6793000-7ffff679b000 r--p 000ea000 08:03 3806566 /usr/lib64/libstdc++.so.6.0.14
7ffff679b000-7ffff679d000 rw-p 000f2000 08:03 3806566 /usr/lib64/libstdc++.so.6.0.14
7ffff679d000-7ffff67b2000 rw-p 00000000 00:00 0
7ffff67b2000-7ffff67c9000 r-xp 00000000 08:03 10747939 /lib64/libpthread-2.11.3.so
7ffff67c9000-7ffff69c9000 ---p 00017000 08:03 10747939 /lib64/libpthread-2.11.3.so
7ffff69c9000-7ffff69ca000 r--p 00017000 08:03 10747939 /lib64/libpthread-2.11.3.so
7ffff69ca000-7ffff69cb000 rw-p 00018000 08:03 10747939 /lib64/libpthread-2.11.3.so
7ffff69cb000-7ffff69cf000 rw-p 00000000 00:00 0
7ffff69cf000-7ffff6c59000 r-xp 00000000 08:03 3808046 /usr/lib64/libQtCore.so.4.7.1
7ffff6c59000-7ffff6e58000 ---p 0028a000 08:03 3808046 /usr/lib64/libQtCore.so.4.7.1
7ffff6e58000-7ffff6e63000 r--p 00289000 08:03 3808046 /usr/lib64/libQtCore.so.4.7.1
7ffff6e63000-7ffff6e64000 rw-p 00294000 08:03 3808046 /usr/lib64/libQtCore.so.4.7.1
7ffff6e64000-7ffff6e65000 rw-p 00000000 00:00 0
7ffff6e65000-7ffff78b8000 r-xp 00000000 08:03 3808607 /usr/lib64/libQtGui.so.4.7.1
7ffff78b8000-7ffff7ab8000 ---p 00a53000 08:03 3808607 /usr/lib64/libQtGui.so.4.7.1
7ffff7ab8000-7ffff7af7000 r--p 00a53000 08:03 3808607 /usr/lib64/libQtGui.so.4.7.1
7ffff7af7000-7ffff7afe000 rw-p 00a92000 08:03 3808607 /usr/lib64/libQtGui.so.4.7.1
7ffff7afe000-7ffff7b01000 rw-p 00000000 00:00 0
7ffff7b01000-7ffff7bd9000 r-xp 00000000 08:03 3806311 /usr/lib64/libasound.so.2.0.0
7ffff7bd9000-7ffff7dd8000 ---p 000d8000 08:03 3806311 /usr/lib64/libasound.so.2.0.0
7ffff7dd8000-7ffff7dde000 r--p 000d7000 08:03 3806311 /usr/lib64/libasound.so.2.0.0
7ffff7dde000-7ffff7ddf000 rw-p 000dd000 08:03 3806311 /usr/lib64/libasound.so.2.0.0
7ffff7ddf000-7ffff7dfd000 r-xp 00000000 08:03 10747906 /lib64/ld-2.11.3.so
7ffff7fcc000-7ffff7fdc000 rw-p 00000000 00:00 0
7ffff7fe8000-7ffff7ff8000 rw-s 00000000 00:05 4435 /dev/snd/pcmC0D0p
7ffff7ff8000-7ffff7ff9000 rw-s 81000000 00:05 4435 /dev/snd/pcmC0D0p
7ffff7ff9000-7ffff7ffa000 r--s 80000000 00:05 4435 /dev/snd/pcmC0D0p
7ffff7ffa000-7ffff7ffb000 rw-p 00000000 00:00 0
7ffff7ffb000-7ffff7ffc000 r-xp 00000000 00:00 0 [vdso]
7ffff7ffc000-7ffff7ffd000 r--p 0001d000 08:03 10747906 /lib64/ld-2.11.3.so
7ffff7ffd000-7ffff7ffe000 rw-p 0001e000 08:03 10747906 /lib64/ld-2.11.3.so
7ffff7ffe000-7ffff7fff000 rw-p 00000000 00:00 0
7ffffffde000-7ffffffff000 rw-p 00000000 00:00 0 [stack]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
main.cpp:
#include <QtGui>
#include <QApplication>
#include <qlineedit.h>
#include "ui_wave.h"
#include <QString>
#include <QObject>
#include <QDebug>
#include <stdio.h>
#include <cstdio>
#include <stdlib.h>
#include <cstdlib>
#include <string.h>
#include <cstring>
#include <sched.h>
#include <errno.h>
#include <getopt.h>
#include <alsa/asoundlib.h>
#include <sys/time.h>
#include <sstream>
#include <string>
#include <math.h>
#include <cmath>
#include <iostream>
#include "wave.h"
using namespace std;
static const char *device = "plughw:0,0"; // playback device
static snd_pcm_format_t format = SND_PCM_FORMAT_S16; // sample format- change to 24-bit
static unsigned int rate = 96000; // stream rate
static unsigned int channels = 128; // count of channels
static unsigned int buffer_time = 500000; // ring buffer length in us
static unsigned int period_time = 100000; // period time in us
static double freq; // sinusoidal wave frequency in Hz
static int verbose = 0; // verbose flag
static int resample = 1; // enable alsa-lib resampling
static int period_event = 0; // produce poll event after each period
static snd_pcm_sframes_t buffer_size;
static snd_pcm_sframes_t period_size;
static snd_output_t *output = NULL;
static double ampl;
static snd_pcm_t *h;
static bool isTrue;
....
int main(int argc, char *argv[])
{
struct option long_option[] =
{
{"help", 0, NULL, 'h'},
{"device", 1, NULL, 'D'},
{"rate", 1, NULL, 'r'},
{"channels", 1, NULL, 'c'},
{"frequency", 1, NULL, 'f'},
{"buffer", 1, NULL, 'b'},
{"period", 1, NULL, 'p'},
{"method", 1, NULL, 'm'},
{"format", 1, NULL, 'o'},
{"verbose", 1, NULL, 'v'},
{"noresample", 1, NULL, 'n'},
{"pevent", 1, NULL, 'e'},
{NULL, 0, NULL, 0},
};
int err, morehelp;
snd_pcm_hw_params_t *hwparams;
snd_pcm_sw_params_t *swparams;
int method = 0;
short int *samp;
snd_pcm_t *h;
snd_pcm_channel_area_t *area;
snd_pcm_t *handle = (snd_pcm_t*) h;
unsigned char *samples = (unsigned char*) samp;
unsigned int chn;
snd_pcm_channel_area_t *areas = (snd_pcm_channel_area_t*) area;
snd_pcm_hw_params_alloca(&hwparams);
snd_pcm_sw_params_alloca(&swparams);
err = snd_output_stdio_attach(&output, stdout, 0);
if (err < 0) {
printf("Output failed: %s\n", snd_strerror(err));
return 0;
}
// cout<<"Playback device is %s "<<","<< device);
// cout<<"Stream parameters are %iHz, %s, %i channels "<<","<< rate<<","<< snd_pcm_format_name(format), channels;
// cout<<"Sine wave rate is %.4fHz "<<","<< freq;
// cout<<"Using transfer method: %s "<<","<< transfer_methods[method].name;
if ((err = snd_pcm_open(&h, device, SND_PCM_STREAM_PLAYBACK, 0)) < 0) {
printf("Playback open error: %s\n", snd_strerror(err));
return 0;
}
if ((err = set_hwparams(h, hwparams, transfer_methods[method].access)) < 0) {
printf("Setting of hwparams failed: %s\n", snd_strerror(err));
exit(EXIT_FAILURE);
}
if ((err = set_swparams(h, swparams)) < 0) {
printf("Setting of swparams failed: %s\n", snd_strerror(err));
exit(EXIT_FAILURE);
}
if (verbose > 0)
snd_pcm_dump(h, output);
samp = new short int [period_size * channels * snd_pcm_format_physical_width(format)];
if (samp == NULL) {
printf("Not enough memory\n");
exit(EXIT_FAILURE);
}
area = new snd_pcm_channel_area_t [channels, sizeof(snd_pcm_channel_area_t)];
if (area == NULL) {
printf("Not enough memory\n");
exit(EXIT_FAILURE);
}
for (chn = 0; chn < channels; chn++) {
area[chn].addr = samp;
area[chn].first = chn * snd_pcm_format_physical_width(format);
area[chn].step = channels * snd_pcm_format_physical_width(format);
}
err = write_loop(h, samp, area);
if (err < 0)
printf("Transfer failed: %s\n", snd_strerror(err));
delete(area);
delete(samp);
snd_pcm_close(h);
return 0;
QApplication a(argc, argv);
wave w;
w.show();
return a.exec();
}
Some source code would be nice.
It looks like you're trying to delete something twice.
This important line is this:
glibc detected * * * /home/test/Documents/Wave-build-desktop/Wave: double free or corruption (!prev): 0x000000000060b580 *
If you cant catch this problem in the debug then you can analyze the backtrace you just posted to find which function in your program caused this. first do nm ./NameOfYourProgram to get the list of symbols. The list of symbols also displays the address of each function. The addresses in your backtrace will be greater or equal to the symbol addresses. The functions you need to look at in your backtrace are:
/home/test/Documents/Wave-build-desktop/Wave[0x405359]
...
/home/test/Documents/Wave-build-desktop/Wave[0x4042b9]
the addresses here are: 0x405359 and 0x4042b9. You can then step through the function you found and stop at 0x405359 and you will find the exact line in your code where the exception occured.

gnokii cannot send sms

the following gnokii command fails:
echo "this is a test message" | sudo gnokii --phone ATblue --sendsms +<number> -r
i can recieve sms and get network info using the current config file.
the above command results in this:
GNOKII Version 0.6.28
*** glibc detected *** gnokii: free(): invalid next size (fast): 0x09a7b540 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(+0x6b591)[0x4ed591]
/lib/tls/i686/cmov/libc.so.6(+0x6cde8)[0x4eede8]
/lib/tls/i686/cmov/libc.so.6(cfree+0x6d)[0x4f1ecd]
/usr/lib/libgnokii.so.5(gn_char_def_alphabet+0xb3)[0x3d2a43]
gnokii[0x805bb78]
gnokii[0x804b948]
gnokii[0x804b230]
gnokii[0x804bd5f]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0x498bd6]
gnokii[0x804ab61]
======= Memory map: ========
00110000-00116000 r-xp 00000000 08:01 315119 /lib/libusb-0.1.so.4.4.4
00116000-00117000 r--p 00005000 08:01 315119 /lib/libusb-0.1.so.4.4.4
00117000-00119000 rw-p 00006000 08:01 315119 /lib/libusb-0.1.so.4.4.4
00119000-0011b000 r-xp 00000000 08:01 260201 /lib/tls/i686/cmov/libdl-2.11.1.so
0011b000-0011c000 r--p 00001000 08:01 260201 /lib/tls/i686/cmov/libdl-2.11.1.so
0011c000-0011d000 rw-p 00002000 08:01 260201 /lib/tls/i686/cmov/libdl-2.11.1.so
0011d000-00132000 r-xp 00000000 08:01 260266 /lib/tls/i686/cmov/libpthread-2.11.1.so
00132000-00133000 r--p 00014000 08:01 260266 /lib/tls/i686/cmov/libpthread-2.11.1.so
00133000-00134000 rw-p 00015000 08:01 260266 /lib/tls/i686/cmov/libpthread-2.11.1.so
00134000-00136000 rw-p 00000000 00:00 0
00136000-0014e000 r-xp 00000000 08:01 268696 /usr/lib/libxcb.so.1.1.0
0014e000-0014f000 r--p 00017000 08:01 268696 /usr/lib/libxcb.so.1.1.0
0014f000-00150000 rw-p 00018000 08:01 268696 /usr/lib/libxcb.so.1.1.0
00150000-00152000 r-xp 00000000 08:01 267689 /usr/lib/libXau.so.6.0.0
00152000-00153000 r--p 00001000 08:01 267689 /usr/lib/libXau.so.6.0.0
00153000-00154000 rw-p 00002000 08:01 267689 /usr/lib/libXau.so.6.0.0
00154000-00158000 r-xp 00000000 08:01 267700 /usr/lib/libXdmcp.so.6.0.0
00158000-00159000 r--p 00003000 08:01 267700 /usr/lib/libXdmcp.so.6.0.0
00159000-0015a000 rw-p 00004000 08:01 267700 /usr/lib/libXdmcp.so.6.0.0
0020a000-0024c000 r-xp 00000000 08:01 268247 /usr/lib/libical.so.0.44.0
0024c000-00254000 r--p 00042000 08:01 268247 /usr/lib/libical.so.0.44.0
00254000-00255000 rw-p 0004a000 08:01 268247 /usr/lib/libical.so.0.44.0
00340000-0035d000 r-xp 00000000 08:01 260186 /lib/libgcc_s.so.1
0035d000-0035e000 r--p 0001c000 08:01 260186 /lib/libgcc_s.so.1
0035e000-0035f000 rw-p 0001d000 08:01 260186 /lib/libgcc_s.so.1
003a9000-00431000 r-xp 00000000 08:01 302338 /usr/lib/libgnokii.so.5.0.0
00431000-00432000 ---p 00088000 08:01 302338 /usr/lib/libgnokii.so.5.0.0
00432000-00435000 r--p 00088000 08:01 302338 /usr/lib/libgnokii.so.5.0.0
00435000-00437000 rw-p 0008b000 08:01 302338 /usr/lib/libgnokii.so.5.0.0
00437000-0047c000 rw-p 00000000 00:00 0
00481000-00482000 r-xp 00000000 00:00 0 [vdso]
00482000-005d5000 r-xp 00000000 08:01 260156 /lib/tls/i686/cmov/libc-2.11.1.so
005d5000-005d6000 ---p 00153000 08:01 260156 /lib/tls/i686/cmov/libc-2.11.1.so
005d6000-005d8000 r--p 00153000 08:01 260156 /lib/tls/i686/cmov/libc-2.11.1.so
005d8000-005d9000 rw-p 00155000 08:01 260156 /lib/tls/i686/cmov/libc-2.11.1.so
005d9000-005dc000 rw-p 00000000 00:00 0
006ca000-006d3000 r-xp 00000000 08:01 260246 /lib/libpcsclite.so.1.0.0
006d3000-006d4000 r--p 00009000 08:01 260246 /lib/libpcsclite.so.1.0.0
006d4000-006d5000 rw-p 0000a000 08:01 260246 /lib/libpcsclite.so.1.0.0
007f6000-00809000 r-xp 00000000 08:01 267800 /usr/lib/libbluetooth.so.3.5.0
00809000-0080a000 r--p 00012000 08:01 267800 /usr/lib/libbluetooth.so.3.5.0
0080a000-0080b000 rw-p 00013000 08:01 267800 /usr/lib/libbluetooth.so.3.5.0
008b5000-009ce000 r-xp 00000000 08:01 267685 /usr/lib/libX11.so.6.3.0
009ce000-009cf000 r--p 00118000 08:01 267685 /usr/lib/libX11.so.6.3.0
009cf000-009d1000 rw-p 00119000 08:01 267685 /usr/lib/libX11.so.6.3.0
009d1000-009d2000 rw-p 00000000 00:00 0
00dc3000-00dd2000 r-xp 00000000 08:01 267720 /usr/lib/libXpm.so.4.11.0
00dd2000-00dd3000 r--p 0000e000 08:01 267720 /usr/lib/libXpm.so.4.11.0
00dd3000-00dd4000 rw-p 0000f000 08:01 267720 /usr/lib/libXpm.so.4.11.0
00fcd000-00fe8000 r-xp 00000000 08:01 264975 /lib/ld-2.11.1.so
00fe8000-00fe9000 r--p 0001a000 08:01 264975 /lib/ld-2.11.1.so
00fe9000-00fea000 rw-p 0001b000 08:01 264975 /lib/ld-2.11.1.so
08048000-08067000 r-xp 00000000 08:01 302405 /usr/bin/gnokii
08067000-08068000 r--p 0001e000 08:01 302405 /usr/bin/gnokii
08068000-08069000 rw-p 0001f000 08:01 302405 /usr/bin/gnokii
08069000-0806c000 rw-p 00000000 00:00 0
09a79000-09add000 rw-p 00000000 00:00 0 [heap]
b7500000-b7521000 rw-p 00000000 00:00 0
b7521000-b7600000 ---p 00000000 00:00 0
b7662000-b7669000 r--s 00000000 08:01 280697 /usr/lib/gconv/gconv-modules.cache
b76a9000-b76ed000 rw-p 00000000 00:00 0
b76ed000-b772c000 r--p 00000000 08:01 272703 /usr/lib/locale/en_IN/LC_CTYPE
b772c000-b784a000 r--p 00000000 08:01 272702 /usr/lib/locale/en_IN/LC_COLLATE
b784a000-b784e000 rw-p 00000000 00:00 0
b7860000-b7861000 r--p 00000000 08:01 266931 /usr/lib/locale/en_IN/LC_NUMERIC
b7861000-b7862000 r--p 00000000 08:01 266932 /usr/lib/locale/en_IN/LC_TIME
b7862000-b7863000 r--p 00000000 08:01 266933 /usr/lib/locale/en_IN/LC_MONETARY
b7863000-b7864000 r--p 00000000 08:01 272751 /usr/lib/locale/en_IN/LC_MESSAGES/SYS_LC_MESSAGES
b7864000-b7865000 r--p 00000000 08:01 272709 /usr/lib/locale/en_IN/LC_PAPER
b7865000-b7866000 r--p 00000000 08:01 272668 /usr/lib/locale/en_IN/LC_NAME
b7866000-b7867000 r--p 00000000 08:01 272493 /usr/lib/locale/en_IN/LC_ADDRESS
b7867000-b7868000 r--p 00000000 08:01 272502 /usr/lib/locale/en_IN/LC_TELEPHONE
b7868000-b7869000 r--p 00000000 08:01 272705 /usr/lib/locale/en_IN/LC_MEASUREMENT
b7869000-b786a000 r--p 00000000 08:01 266934 /usr/lib/locale/en_IN/LC_IDENTIFICATION
b786a000-b786c000 rw-p 00000000 00:00 0
bfcec000-bfd6f000 rw-p 00000000 00:00 0 [stack]
Aborted
It was fixed in gnokii 0.6.29

Resources