mapd_server crashed when queries and inserts proceeded concurrently
Tried to simulate a scenario commonly seen in IoT applications where queries and data injections proceed concurrently. Right after the test began, mapd_server crashed.
Not always reproducible.
How to reproduce:
- on one terminal window, repeat query "select count(*) from (select max(trip_time_in_secs) from trip1 where trip_time_in_secs > 10 group by trip_time_in_secs)" every one second.
- on another terminal window, continuously inject data from CSV files to table trip1
Backtrace follows: E0920 12:22:31.215850 3003 MapDHandler.cpp:201] No GPUs detected, falling back to CPU mode Received 1 Received 1 Received 1 *** Error in `/data/tmp/mapd/bin/mapd_server': free(): invalid next size (fast): 0x00007f3fc50d9540 *** ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f3fe4dfe7e5] /lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f3fe4e0737a] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f3fe4e0b53c] /data/tmp/mapd/bin/mapd_server(_ZN14File_Namespace10FileBuffer4readEPammN14Data_Namespace11MemoryLevelEi+0x13c4)[0xe0e2b4] /data/tmp/mapd/bin/mapd_server(_ZN14File_Namespace7FileMgr11fetchBufferERKSt6vectorIiSaIiEEPN14Data_Namespace14AbstractBufferEm+0x202)[0xdff3a2] /data/tmp/mapd/bin/mapd_server(_ZN16Buffer_Namespace9BufferMgr9getBufferERKSt6vectorIiSaIiEEm+0x26b)[0xe1c25b] /data/tmp/mapd/bin/mapd_server(_ZN8Chunk_NS5Chunk8getChunkEPK16ColumnDescriptorPN14Data_Namespace7DataMgrERKSt6vectorIiSaIiEENS4_11MemoryLevelEimm+0x100)[0xe27820] /data/tmp/mapd/bin/mapd_server(_ZNK8Executor17ExecutionDispatch13getScanColumnEiiiRKSt3mapIiPKSt5dequeIN20Fragmenter_Namespace12FragmentInfoESaIS4_EESt4lessIiESaISt4pairIKiS8_EEERSt4listISt10shared_ptrIN8Chunk_NS5ChunkEESaISM_EERSI_I9ChunkIterSaISQ_EEN14Data_Namespace11MemoryLevelEi+0x1e9)[0xc5d449] /data/tmp/mapd/bin/mapd_server(_ZN8Executor11fetchChunksERKNS_17ExecutionDispatchERK19RelAlgExecutionUnitiN14Data_Namespace11MemoryLevelERKSt3mapIiPKSt5dequeIN20Fragmenter_Namespace12FragmentInfoESaISB_EESt4lessIiESaISt4pairIKiSF_EEERKSt6vectorISI_IiSP_ImSaImEEESaISS_EERKN17Catalog_Namespace7CatalogERSt4listI9ChunkIterSaIS12_EERS11_ISt10shared_ptrIN8Chunk_NS5ChunkEESaIS19_EE+0x5c2)[0xc49322] /data/tmp/mapd/bin/mapd_server(_ZN8Executor17ExecutionDispatch7runImplE18ExecutorDeviceTypeiRK16ExecutionOptionsRKSt6vectorISt4pairIiS5_ImSaImEEESaIS9_EEml+0x428)[0xc61168] /data/tmp/mapd/bin/mapd_server(_ZN8Executor17ExecutionDispatch3runE18ExecutorDeviceTypeiRK16ExecutionOptionsRKSt6vectorISt4pairIiS5_ImSaImEEESaIS9_EEml+0x16)[0xc62886] /data/tmp/mapd/bin/mapd_server[0xc3f70d] /data/tmp/mapd/bin/mapd_server[0x29990c0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f3fe51586ba] /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f3fe4e8e3dd] ======= Memory map: ======== 00400000-036a5000 r-xp 00000000 08:11 1184770 /home/ppan/data/tmp/mapd-ce-3.2.1-20170826-327e7ee-Linux-x86_64-cpu/bin/mapd_server 038a5000-03b9f000 r--p 032a5000 08:11 1184770 /home/ppan/data/tmp/mapd-ce-3.2.1-20170826-327e7ee-Linux-x86_64-cpu/bin/mapd_server 03b9f000-03c08000 rw-p 0359f000 08:11 1184770 /home/ppan/data/tmp/mapd-ce-3.2.1-20170826-327e7ee-Linux-x86_64-cpu/bin/mapd_server 03c08000-03c6a000 rw-p 00000000 00:00 0 03db3000-03e37000 rw-p 00000000 00:00 0 [heap] 7f3ebc000000-7f3ebc021000 rw-p 00000000 00:00 0 7f3ebc021000-7f3ec0000000 ---p 00000000 00:00 0 7f3ec4000000-7f3ec4021000 rw-p 00000000 00:00 0 7f3ec4021000-7f3ec8000000 ---p 00000000 00:00 0 7f3ecc000000-7f3ecd86b000 rw-p 00000000 00:00 0 7f3ecd86b000-7f3ed0000000 ---p 00000000 00:00 0 7f3ed0142000-7f3edc000000 rw-p 00000000 00:00 0 7f3edc000000-7f3ede396000 rw-p 00000000 00:00 0 7f3ede396000-7f3ee0000000 ---p 00000000 00:00 0 7f3ee0bc6000-7f3ee0bdc000 r-xp 00000000 08:01 2626242 /lib/x86_64-linux-gnu/libgcc_s.so.1 7f3ee0bdc000-7f3ee0ddb000 ---p 00016000 08:01 2626242 /lib/x86_64-linux-gnu/libgcc_s.so.1 7f3ee0ddb000-7f3ee0ddc000 rw-p 00015000 08:01 2626242 /lib/x86_64-linux-gnu/libgcc_s.so.1 7f3ee0ddc000-7f3ee0ddd000 ---p 00000000 00:00 0 7f3ee0ddd000-7f3ee37ff000 rw-p 00000000 00:00 0 7f3ee37ff000-7f3ee3800000 ---p 00000000 00:00 0 7f3ee3800000-7f3ee4000000 rw-p 00000000 00:00 0 7f3ee4000000-7f3ee4114000 rw-p 00000000 00:00 0 7f3ee4114000-7f3ee8000000 ---p 00000000 00:00 0 7f3ee8000000-7f3ee9eaf000 rw-p 00000000 00:00 0 7f3ee9eaf000-7f3eec000000 ---p 00000000 00:00 0 7f3eec000000-7f3eec115000 rw-p 00000000 00:00 0 7f3eec115000-7f3ef0000000 ---p 00000000 00:00 0 7f3ef0000000-7f3ef0214000 rw-p 00000000 00:00 0 7f3ef0214000-7f3ef4000000 ---p 00000000 00:00 0 7f3ef40f2000-7f3ef47f9000 rw-p 00000000 00:00 0 7f3ef47f9000-7f3ef47fa000 ---p 00000000 00:00 0 7f3ef47fa000-7f3ef4ffa000 rw-p 00000000 00:00 0 7f3ef4ffa000-7f3ef4ffb000 ---p 00000000 00:00 0 7f3ef4ffb000-7f3ef57fb000 rw-p 00000000 00:00 0 7f3ef57fb000-7f3ef57fc000 ---p 00000000 00:00 0 7f3ef57fc000-7f3ef5ffc000 rw-p 00000000 00:00 0 7f3ef5ffc000-7f3ef5ffd000 ---p 00000000 00:00 0 7f3ef5ffd000-7f3ef67fd000 rw-p 00000000 00:00 0 7f3ef67fd000-7f3ef67fe000 ---p 00000000 00:00 0 7f3ef67fe000-7f3ef77ff000 rw-p 00000000 00:00 0 7f3ef77ff000-7f3ef7800000 ---p 00000000 00:00 0 7f3ef7800000-7f3ef8000000 rw-p 00000000 00:00 0 7f3ef8000000-7f3efa100000 rw-p 00000000 00:00 0 7f3efa100000-7f3efc000000 ---p 00000000 00:00 0 7f3efc000000-7f3efe21c000 rw-p 00000000 00:00 0 7f3efe21c000-7f3f00000000 ---p 00000000 00:00 0 7f3f00000000-7f3f00114000 rw-p 00000000 00:00 0 7f3f00114000-7f3f04000000 ---p 00000000 00:00 0 7f3f040a2000-7f3f044a6000 rw-p 00000000 00:00 0 7f3f044a6000-7f3f048a6000 rw-s 00000000 08:31 22282949 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_8/DictOffsets 7f3f048a6000-7f3f04ca6000 rw-s 00000000 08:31 22282948 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_8/DictPayload 7f3f04ca6000-7f3fbc000000 rw-p 00000000 00:00 0 7f3fbc000000-7f3fbc2bd000 rw-p 00000000 00:00 0 7f3fbc2bd000-7f3fc0000000 ---p 00000000 00:00 0 7f3fc0000000-7f3fc1ed3000 rw-p 00000000 00:00 0 7f3fc1ed3000-7f3fc4000000 ---p 00000000 00:00 0 7f3fc4000000-7f3fc61c0000 rw-p 00000000 00:00 0 7f3fc61c0000-7f3fc8000000 ---p 00000000 00:00 0 7f3fc80f9000-7f3fc8bfd000 rw-p 00000000 00:00 0 7f3fc8bfd000-7f3fc8ffd000 rw-s 00000000 08:31 22282947 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_7/DictOffsets 7f3fc8ffd000-7f3fc93fd000 rw-s 00000000 08:31 22282946 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_7/DictPayload 7f3fc93fd000-7f3fc9bfe000 rw-p 00000000 00:00 0 7f3fc9bfe000-7f3fc9ffe000 rw-s 00000000 08:31 22282926 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_6/DictOffsets 7f3fc9ffe000-7f3fca3fe000 rw-s 00000000 08:31 22282924 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_6/DictPayload 7f3fca3fe000-7f3fcabff000 rw-p 00000000 00:00 0 7f3fcabff000-7f3fcafff000 rw-s 00000000 08:31 22282922 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_5/DictOffsets 7f3fcafff000-7f3fcb3ff000 rw-s 00000000 08:31 22282920 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_5/DictPayload 7f3fcb3ff000-7f3fcbc00000 rw-p 00000000 00:00 0 7f3fcbc00000-7f3fcc000000 rw-s 00000000 08:31 22282709 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_4/DictOffsets 7f3fcc000000-7f3fcc118000 rw-p 00000000 00:00 0 7f3fcc118000-7f3fd0000000 ---p 00000000 00:00 0 7f3fd0000000-7f3fd0b1a000 rw-p 00000000 00:00 0 7f3fd0b1a000-7f3fd4000000 ---p 00000000 00:00 0 7f3fd4000000-7f3fd4021000 rw-p 00000000 00:00 0 7f3fd4021000-7f3fd8000000 ---p 00000000 00:00 0 7f3fd8000000-7f3fd821e000 rw-p 00000000 00:00 0 7f3fd821e000-7f3fdc000000 ---p 00000000 00:00 0 7f3fdc000000-7f3fdc021000 rw-p 00000000 00:00 0 7f3fdc021000-7f3fe0000000 ---p 00000000 00:00 0 7f3fe0069000-7f3fe0469000 rw-s 00000000 08:31 22282708 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_4/DictPayload 7f3fe0469000-7f3fe0c6a000 rw-p 00000000 00:00 0 7f3fe0c6a000-7f3fe106a000 rw-s 00000000 08:31 22282707 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_3/DictOffsets 7f3fe106a000-7f3fe146a000 rw-s 00000000 08:31 22282706 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_3/DictPayload 7f3fe146a000-7f3fe1c6b000 rw-p 00000000 00:00 0 7f3fe1c6b000-7f3fe206b000 rw-s 00000000 08:31 22282705 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_2/DictOffsets 7f3fe206b000-7f3fe246b000 rw-s 00000000 08:31 22282704 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_2/DictPayload 7f3fe246b000-7f3fe2c6c000 rw-p 00000000 00:00 0 7f3fe2c6c000-7f3fe306c000 rw-s 00000000 08:31 22282703 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_1/DictOffsets 7f3fe306c000-7f3fe346c000 rw-s 00000000 08:31 22282702 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_1/DictPayload 7f3fe346c000-7f3fe346d000 ---p 00000000 00:00 0 7f3fe346d000-7f3fe3c6d000 rw-p 00000000 00:00 0 7f3fe3c6d000-7f3fe3c6e000 ---p 00000000 00:00 0 7f3fe3c6e000-7f3fe446e000 rw-p 00000000 00:00 0 7f3fe446e000-7f3fe446f000 ---p 00000000 00:00 0 7f3fe446f000-7f3fe456f000 rw-p 00000000 00:00 0 7f3fe456f000-7f3fe4570000 ---p 00000000 00:00 0 7f3fe4570000-7f3fe4670000 rw-p 00000000 00:00 0 7f3fe4670000-7f3fe4671000 ---p 00000000 00:00 0 7f3fe4671000-7f3fe4771000 rw-p 00000000 00:00 0 7f3fe4771000-7f3fe4772000 ---p 00000000 00:00 0 7f3fe4772000-7f3fe4872000 rw-p 00000000 00:00 0 7f3fe4872000-7f3fe4873000 ---p 00000000 00:00 0 7f3fe4873000-7f3fe4973000 rw-p 00000000 00:00 0 7f3fe4973000-7f3fe4974000 ---p 00000000 00:00 0 7f3fe4974000-7f3fe4a74000 rw-p 00000000 00:00 0 7f3fe4a74000-7f3fe4a75000 ---p 00000000 00:00 0 7f3fe4a75000-7f3fe4b75000 rw-p 00000000 00:00 0 7f3fe4b75000-7f3fe4b80000 r-xp 00000000 08:01 2626303 /lib/x86_64-linux-gnu/libnss_files-2.23.so 7f3fe4b80000-7f3fe4d7f000 ---p 0000b000 08:01 2626303 /lib/x86_64-linux-gnu/libnss_files-2.23.so 7f3fe4d7f000-7f3fe4d80000 r--p 0000a000 08:01 2626303 /lib/x86_64-linux-gnu/libnss_files-2.23.so 7f3fe4d80000-7f3fe4d81000 rw-p 0000b000 08:01 2626303 /lib/x86_64-linux-gnu/libnss_files-2.23.so 7f3fe4d81000-7f3fe4d87000 rw-p 00000000 00:00 0 7f3fe4d87000-7f3fe4f47000 r-xp 00000000 08:01 2626204 /lib/x86_64-linux-gnu/libc-2.23.so 7f3fe4f47000-7f3fe5147000 ---p 001c0000 08:01 2626204 /lib/x86_64-linux-gnu/libc-2.23.so 7f3fe5147000-7f3fe514b000 r--p 001c0000 08:01 2626204 /lib/x86_64-linux-gnu/libc-2.23.so 7f3fe514b000-7f3fe514d000 rw-p 001c4000 08:01 2626204 /lib/x86_64-linux-gnu/libc-2.23.so 7f3fe514d000-7f3fe5151000 rw-p 00000000 00:00 0 7f3fe5151000-7f3fe5169000 r-xp 00000000 08:01 2626350 /lib/x86_64-linux-gnu/libpthread-2.23.so 7f3fe5169000-7f3fe5368000 ---p 00018000 08:01 2626350 /lib/x86_64-linux-gnu/libpthread-2.23.so 7f3fe5368000-7f3fe5369000 r--p 00017000 08:01 2626350 /lib/x86_64-linux-gnu/libpthread-2.23.so 7f3fe5369000-7f3fe536a000 rw-p 00018000 08:01 2626350 /lib/x86_64-linux-gnu/libpthread-2.23.so 7f3fe536a000-7f3fe536e000 rw-p 00000000 00:00 0 7f3fe536e000-7f3fe5476000 r-xp 00000000 08:01 2626274 /lib/x86_64-linux-gnu/libm-2.23.so 7f3fe5476000-7f3fe5675000 ---p 00108000 08:01 2626274 /lib/x86_64-linux-gnu/libm-2.23.so 7f3fe5675000-7f3fe5676000 r--p 00107000 08:01 2626274 /lib/x86_64-linux-gnu/libm-2.23.so 7f3fe5676000-7f3fe5677000 rw-p 00108000 08:01 2626274 /lib/x86_64-linux-gnu/libm-2.23.so 7f3fe5677000-7f3fe5690000 r-xp 00000000 08:01 2626395 /lib/x86_64-linux-gnu/libz.so.1.2.8 7f3fe5690000-7f3fe588f000 ---p 00019000 08:01 2626395 /lib/x86_64-linux-gnu/libz.so.1.2.8 7f3fe588f000-7f3fe5890000 r--p 00018000 08:01 2626395 /lib/x86_64-linux-gnu/libz.so.1.2.8 7f3fe5890000-7f3fe5891000 rw-p 00019000 08:01 2626395 /lib/x86_64-linux-gnu/libz.so.1.2.8 7f3fe5891000-7f3fe5894000 r-xp 00000000 08:01 2626228 /lib/x86_64-linux-gnu/libdl-2.23.so 7f3fe5894000-7f3fe5a93000 ---p 00003000 08:01 2626228 /lib/x86_64-linux-gnu/libdl-2.23.so 7f3fe5a93000-7f3fe5a94000 r--p 00002000 08:01 2626228 /lib/x86_64-linux-gnu/libdl-2.23.so 7f3fe5a94000-7f3fe5a95000 rw-p 00003000 08:01 2626228 /lib/x86_64-linux-gnu/libdl-2.23.so 7f3fe5a95000-7f3fe5abb000 r-xp 00000000 08:01 2626176 /lib/x86_64-linux-gnu/ld-2.23.so 7f3fe5b9c000-7f3fe5b9d000 ---p 00000000 00:00 0 7f3fe5b9d000-7f3fe5ca2000 rw-p 00000000 00:00 0 7f3fe5cb1000-7f3fe5cb2000 rw-p 00000000 00:00 0 7f3fe5cb2000-7f3fe5cb8000 r-xp 00000000 00:00 0 7f3fe5cb8000-7f3fe5cba000 rw-p 00000000 00:00 0 7f3fe5cba000-7f3fe5cbb000 r--p 00025000 08:01 2626176 /lib/x86_64-linux-gnu/ld-2.23.so 7f3fe5cbb000-7f3fe5cbc000 rw-p 00026000 08:01 2626176 /lib/x86_64-linux-gnu/ld-2.23.so 7f3fe5cbc000-7f3fe5cbd000 rw-p 00000000 00:00 0 7ffed8e17000-7ffed8e38000 rw-p 00000000 00:00 0 [stack] 7ffed8eb4000-7ffed8eb6000 r--p 00000000 00:00 0 [vvar] 7ffed8eb6000-7ffed8eb8000 r-xp 00000000 00:00 0 [vdso] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] Aborted (core dumped)
We will try to reproduce, please share the data and the schema to help us expedite the investigation.
We use this model often and the public tweetmap demo is constantly streaming new data in while queries are occuring, so will be great to get to the bottom of this issue.
Please download the data here. I downloaded it long time ago, so not sure if it matches my current schema.
The schema follows.
CREATE TABLE trip1 ( medallion TEXT ENCODING DICT, hack_license TEXT ENCODING DICT, vendor_id TEXT ENCODING DICT, rate_code_id SMALLINT, store_and_fwd_flag TEXT ENCODING DICT, pickup_datetime TIMESTAMP, dropoff_datetime TIMESTAMP, passenger_count SMALLINT, trip_time_in_secs INTEGER, trip_distance DECIMAL(14,2), pickup_longitude DECIMAL(14,2), pickup_latitude DECIMAL(14,2), dropoff_longitude DECIMAL(14,2), dropoff_latitude DECIMAL(14,2) ) WITH (FRAGMENT_SIZE=75000000);
Could reproduce it again. This time has slight different crash message:
*** Error in `/data/tmp/mapd/bin/mapd_server': double free or corruption (!prev): 0x00007f0651f0e400 *** ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f07797f97e5] /lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f077980237a] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f077980653c] /data/tmp/mapd/bin/mapd_server(_ZN14File_Namespace10FileBuffer4readEPammN14Data_Namespace11MemoryLevelEi+0x13ef)[0xe0e2df] /data/tmp/mapd/bin/mapd_server(_ZN14File_Namespace7FileMgr11fetchBufferERKSt6vectorIiSaIiEEPN14Data_Namespace14AbstractBufferEm+0x202)[0xdff3a2] /data/tmp/mapd/bin/mapd_server(_ZN16Buffer_Namespace9BufferMgr9getBufferERKSt6vectorIiSaIiEEm+0x26b)[0xe1c25b] /data/tmp/mapd/bin/mapd_server(_ZN8Chunk_NS5Chunk8getChunkEPK16ColumnDescriptorPN14Data_Namespace7DataMgrERKSt6vectorIiSaIiEENS4_11MemoryLevelEimm+0x100)[0xe27820] /data/tmp/mapd/bin/mapd_server(_ZNK8Executor17ExecutionDispatch13getScanColumnEiiiRKSt3mapIiPKSt5dequeIN20Fragmenter_Namespace12FragmentInfoESaIS4_EESt4lessIiESaISt4pairIKiS8_EEERSt4listISt10shared_ptrIN8Chunk_NS5ChunkEESaISM_EERSI_I9ChunkIterSaISQ_EEN14Data_Namespace11MemoryLevelEi+0x1e9)[0xc5d449] /data/tmp/mapd/bin/mapd_server(_ZN8Executor11fetchChunksERKNS_17ExecutionDispatchERK19RelAlgExecutionUnitiN14Data_Namespace11MemoryLevelERKSt3mapIiPKSt5dequeIN20Fragmenter_Namespace12FragmentInfoESaISB_EESt4lessIiESaISt4pairIKiSF_EEERKSt6vectorISI_IiSP_ImSaImEEESaISS_EERKN17Catalog_Namespace7CatalogERSt4listI9ChunkIterSaIS12_EERS11_ISt10shared_ptrIN8Chunk_NS5ChunkEESaIS19_EE+0x5c2)[0xc49322] /data/tmp/mapd/bin/mapd_server(_ZN8Executor17ExecutionDispatch7runImplE18ExecutorDeviceTypeiRK16ExecutionOptionsRKSt6vectorISt4pairIiS5_ImSaImEEESaIS9_EEml+0x428)[0xc61168] /data/tmp/mapd/bin/mapd_server(_ZN8Executor17ExecutionDispatch3runE18ExecutorDeviceTypeiRK16ExecutionOptionsRKSt6vectorISt4pairIiS5_ImSaImEEESaIS9_EEml+0x16)[0xc62886] /data/tmp/mapd/bin/mapd_server[0xc3f70d] /data/tmp/mapd/bin/mapd_server[0x29990c0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f0779b536ba] /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f07798893dd] ======= Memory map: ======== 00400000-036a5000 r-xp 00000000 08:11 1184770 /home/ppan/data/tmp/mapd-ce-3.2.1-20170826-327e7ee-Linux-x86_64-cpu/bin/mapd_server 038a5000-03b9f000 r--p 032a5000 08:11 1184770 /home/ppan/data/tmp/mapd-ce-3.2.1-20170826-327e7ee-Linux-x86_64-cpu/bin/mapd_server 03b9f000-03c08000 rw-p 0359f000 08:11 1184770 /home/ppan/data/tmp/mapd-ce-3.2.1-20170826-327e7ee-Linux-x86_64-cpu/bin/mapd_server 03c08000-03c6a000 rw-p 00000000 00:00 0 05219000-0529d000 rw-p 00000000 00:00 0 [heap] 7f064c000000-7f064eec3000 rw-p 00000000 00:00 0 7f064eec3000-7f0650000000 ---p 00000000 00:00 0 7f0650000000-7f06529ab000 rw-p 00000000 00:00 0 7f06529ab000-7f0654000000 ---p 00000000 00:00 0 7f0654000000-7f0656a1b000 rw-p 00000000 00:00 0 7f0656a1b000-7f0658000000 ---p 00000000 00:00 0 7f065c000000-7f065e9ee000 rw-p 00000000 00:00 0 7f065e9ee000-7f0660000000 ---p 00000000 00:00 0 7f0664000000-7f06669a0000 rw-p 00000000 00:00 0 7f06669a0000-7f0668000000 ---p 00000000 00:00 0 7f066c000000-7f066ef91000 rw-p 00000000 00:00 0 7f066ef91000-7f0670000000 ---p 00000000 00:00 0 7f0670000000-7f0671ec9000 rw-p 00000000 00:00 0 7f0671ec9000-7f0674000000 ---p 00000000 00:00 0 7f0674000000-7f0676c19000 rw-p 00000000 00:00 0 7f0676c19000-7f0678000000 ---p 00000000 00:00 0 7f0678142000-7f0684000000 rw-p 00000000 00:00 0 7f0684000000-7f0686b84000 rw-p 00000000 00:00 0 7f0686b84000-7f0688000000 ---p 00000000 00:00 0 7f0688000000-7f068ae9e000 rw-p 00000000 00:00 0 7f068ae9e000-7f068c000000 ---p 00000000 00:00 0 7f068c000000-7f068c11e000 rw-p 00000000 00:00 0 7f068c11e000-7f0690000000 ---p 00000000 00:00 0 7f0690000000-7f06928f1000 rw-p 00000000 00:00 0 7f06928f1000-7f0694000000 ---p 00000000 00:00 0 7f0694000000-7f069418c000 rw-p 00000000 00:00 0 7f069418c000-7f0698000000 ---p 00000000 00:00 0 7f0698000000-7f0698122000 rw-p 00000000 00:00 0 7f0698122000-7f069c000000 ---p 00000000 00:00 0 7f069c000000-7f069c147000 rw-p 00000000 00:00 0 7f069c147000-7f06a0000000 ---p 00000000 00:00 0 7f06a0ca6000-7f0758000000 rw-p 00000000 00:00 0 7f0758000000-7f075811c000 rw-p 00000000 00:00 0 7f075811c000-7f075c000000 ---p 00000000 00:00 0 7f075d7fb000-7f075d7fc000 ---p 00000000 00:00 0 7f075d7fc000-7f075dffc000 rw-p 00000000 00:00 0 7f075dffc000-7f075dffd000 ---p 00000000 00:00 0 7f075dffd000-7f075e7fd000 rw-p 00000000 00:00 0 7f075e7fd000-7f075e7fe000 ---p 00000000 00:00 0 7f075e7fe000-7f075effe000 rw-p 00000000 00:00 0 7f075effe000-7f075efff000 ---p 00000000 00:00 0 7f075efff000-7f075f7ff000 rw-p 00000000 00:00 0 7f075f7ff000-7f075f800000 ---p 00000000 00:00 0 7f075f800000-7f0760000000 rw-p 00000000 00:00 0 7f0760000000-7f0762523000 rw-p 00000000 00:00 0 7f0762523000-7f0764000000 ---p 00000000 00:00 0 7f0764000000-7f0764299000 rw-p 00000000 00:00 0 7f0764299000-7f0768000000 ---p 00000000 00:00 0 7f0768000000-7f0768021000 rw-p 00000000 00:00 0 7f0768021000-7f076c000000 ---p 00000000 00:00 0 7f076c000000-7f076c231000 rw-p 00000000 00:00 0 7f076c231000-7f0770000000 ---p 00000000 00:00 0 7f0770000000-7f0770021000 rw-p 00000000 00:00 0 7f0770021000-7f0774000000 ---p 00000000 00:00 0 7f077444e000-7f0774464000 r-xp 00000000 08:01 2626242 /lib/x86_64-linux-gnu/libgcc_s.so.1 7f0774464000-7f0774663000 ---p 00016000 08:01 2626242 /lib/x86_64-linux-gnu/libgcc_s.so.1 7f0774663000-7f0774664000 rw-p 00015000 08:01 2626242 /lib/x86_64-linux-gnu/libgcc_s.so.1 7f0774664000-7f0774665000 ---p 00000000 00:00 0 7f0774665000-7f0774e65000 rw-p 00000000 00:00 0 7f0774e65000-7f0774e66000 ---p 00000000 00:00 0 7f0774e66000-7f0775666000 rw-p 00000000 00:00 0 7f0775666000-7f0775667000 ---p 00000000 00:00 0 7f0775667000-7f0775e67000 rw-p 00000000 00:00 0 7f0775e67000-7f0776267000 rw-s 00000000 08:31 22282951 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_8/DictOffsets 7f0776267000-7f0776667000 rw-s 00000000 08:31 22282950 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_8/DictPayload 7f0776667000-7f0776a67000 rw-s 00000000 08:31 22282949 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_7/DictOffsets 7f0776a67000-7f0776e67000 rw-s 00000000 08:31 22282948 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_7/DictPayload 7f0776e67000-7f0777267000 rw-s 00000000 08:31 22282947 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_6/DictOffsets 7f0777267000-7f0777667000 rw-s 00000000 08:31 22282946 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_6/DictPayload 7f0777667000-7f0777a67000 rw-s 00000000 08:31 22282926 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_5/DictOffsets 7f0777a67000-7f0777e67000 rw-s 00000000 08:31 22282924 /mnt/trip/mapd/data/mapd_data/DB_1_DICT_5/DictPayload 7f0777e67000-7f0777e68000 ---p 00000000 00:00 0 7f0777e68000-7f0778668000 rw-p 00000000 00:00 0 7f0778668000-7f0778669000 ---p 00000000 00:00 0 7f0778669000-7f0778e69000 rw-p 00000000 00:00 0 7f0778e69000-7f0778e6a000 ---p 00000000 00:00 0 7f0778e6a000-7f0778f6a000 rw-p 00000000 00:00 0 7f0778f6a000-7f0778f6b000 ---p 00000000 00:00 0 7f0778f6b000-7f077906b000 rw-p 00000000 00:00 0 7f077906b000-7f077906c000 ---p 00000000 00:00 0 7f077906c000-7f077916c000 rw-p 00000000 00:00 0 7f077916c000-7f077916d000 ---p 00000000 00:00 0 7f077916d000-7f077926d000 rw-p 00000000 00:00 0 7f077926d000-7f077926e000 ---p 00000000 00:00 0 7f077926e000-7f077936e000 rw-p 00000000 00:00 0 7f077936e000-7f077936f000 ---p 00000000 00:00 0 7f077936f000-7f077946f000 rw-p 00000000 00:00 0 7f077946f000-7f0779470000 ---p 00000000 00:00 0 7f0779470000-7f0779570000 rw-p 00000000 00:00 0 7f0779570000-7f077957b000 r-xp 00000000 08:01 2626303 /lib/x86_64-linux-gnu/libnss_files-2.23.so 7f077957b000-7f077977a000 ---p 0000b000 08:01 2626303 /lib/x86_64-linux-gnu/libnss_files-2.23.so 7f077977a000-7f077977b000 r--p 0000a000 08:01 2626303 /lib/x86_64-linux-gnu/libnss_files-2.23.so 7f077977b000-7f077977c000 rw-p 0000b000 08:01 2626303 /lib/x86_64-linux-gnu/libnss_files-2.23.so 7f077977c000-7f0779782000 rw-p 00000000 00:00 0 7f0779782000-7f0779942000 r-xp 00000000 08:01 2626204 /lib/x86_64-linux-gnu/libc-2.23.so 7f0779942000-7f0779b42000 ---p 001c0000 08:01 2626204 /lib/x86_64-linux-gnu/libc-2.23.so 7f0779b42000-7f0779b46000 r--p 001c0000 08:01 2626204 /lib/x86_64-linux-gnu/libc-2.23.so 7f0779b46000-7f0779b48000 rw-p 001c4000 08:01 2626204 /lib/x86_64-linux-gnu/libc-2.23.so 7f0779b48000-7f0779b4c000 rw-p 00000000 00:00 0 7f0779b4c000-7f0779b64000 r-xp 00000000 08:01 2626350 /lib/x86_64-linux-gnu/libpthread-2.23.so 7f0779b64000-7f0779d63000 ---p 00018000 08:01 2626350 /lib/x86_64-linux-gnu/libpthread-2.23.so 7f0779d63000-7f0779d64000 r--p 00017000 08:01 2626350 /lib/x86_64-linux-gnu/libpthread-2.23.so 7f0779d64000-7f0779d65000 rw-p 00018000 08:01 2626350 /lib/x86_64-linux-gnu/libpthread-2.23.so 7f0779d65000-7f0779d69000 rw-p 00000000 00:00 0 7f0779d69000-7f0779e71000 r-xp 00000000 08:01 2626274 /lib/x86_64-linux-gnu/libm-2.23.so 7f0779e71000-7f077a070000 ---p 00108000 08:01 2626274 /lib/x86_64-linux-gnu/libm-2.23.so 7f077a070000-7f077a071000 r--p 00107000 08:01 2626274 /lib/x86_64-linux-gnu/libm-2.23.so 7f077a071000-7f077a072000 rw-p 00108000 08:01 2626274 /lib/x86_64-linux-gnu/libm-2.23.so 7f077a072000-7f077a08b000 r-xp 00000000 08:01 2626395 /lib/x86_64-linux-gnu/libz.so.1.2.8 7f077a08b000-7f077a28a000 ---p 00019000 08:01 2626395 /lib/x86_64-linux-gnu/libz.so.1.2.8 7f077a28a000-7f077a28b000 r--p 00018000 08:01 2626395 /lib/x86_64-linux-gnu/libz.so.1.2.8 7f077a28b000-7f077a28c000 rw-p 00019000 08:01 2626395 /lib/x86_64-linux-gnu/libz.so.1.2.8 7f077a28c000-7f077a28f000 r-xp 00000000 08:01 2626228 /lib/x86_64-linux-gnu/libdl-2.23.so 7f077a28f000-7f077a48e000 ---p 00003000 08:01 2626228 /lib/x86_64-linux-gnu/libdl-2.23.so 7f077a48e000-7f077a48f000 r--p 00002000 08:01 2626228 /lib/x86_64-linux-gnu/libdl-2.23.so 7f077a48f000-7f077a490000 rw-p 00003000 08:01 2626228 /lib/x86_64-linux-gnu/libdl-2.23.so 7f077a490000-7f077a4b6000 r-xp 00000000 08:01 2626176 /lib/x86_64-linux-gnu/ld-2.23.so 7f077a597000-7f077a598000 ---p 00000000 00:00 0 7f077a598000-7f077a69d000 rw-p 00000000 00:00 0 7f077a6aa000-7f077a6ab000 rw-p 00000000 00:00 0 7f077a6ab000-7f077a6b3000 r-xp 00000000 00:00 0 7f077a6b3000-7f077a6b5000 rw-p 00000000 00:00 0 7f077a6b5000-7f077a6b6000 r--p 00025000 08:01 2626176 /lib/x86_64-linux-gnu/ld-2.23.so 7f077a6b6000-7f077a6b7000 rw-p 00026000 08:01 2626176 /lib/x86_64-linux-gnu/ld-2.23.so 7f077a6b7000-7f077a6b8000 rw-p 00000000 00:00 0 7ffc45415000-7ffc45436000 rw-p 00000000 00:00 0 [stack] 7ffc454f9000-7ffc454fb000 r--p 00000000 00:00 0 [vvar] 7ffc454fb000-7ffc454fd000 r-xp 00000000 00:00 0 [vdso] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] Aborted (core dumped)
Hi @fleapapa how much CPU RAM is on this machine? Just wondering if the bug might be related to memory pressure.
Just shrank my VM to only one cpu core and doing the same test. I didn't shrink VM memory. Here is top command output. You could see free memory (free + buff + cache) is pretty sufficient while the same test is still proceeding.
%Cpu(s): 98.3 us, 1.3 sy, 0.0 ni, 0.0 id, 0.0 wa, 0.0 hi, 0.3 si, 0.0 st KiB Mem : 5050956 total, 386840 free, 2814080 used, 1850036 buff/cache KiB Swap: 8387580 total, 8387580 free, 0 used. 1963804 avail Mem
By the way, because there is only one column involved in the repeated query (see 1st comment), i guess the query should not require too much memory more than 172M x 4 bytes.
Also, because there are actually 12 CSV files to load for totally 172M rows, at least in first few minutes of the test, the table should have only a few million rows and the query should need even less memory.
This seems interesting but not sure if it is helpful for trouble shooting the issue.
When i shrank my VM to single cpu core to do the read-write test for 5 iterations. Mapd_server did NOT crash in any iteration.
When i increased my VM to 6 cpu cores to do the same read-write test for 5 iterations. Mapd_server crashed in 1~2 minutes in every iteration.
Wondering if the root cause is a racing condition between the threads executing FileBuffer::read() and those executing FileBuffer::write(). Concurrent access to the member FileBuffer.multiPages_ seems kind of risky without mutual exclusion... (Intel TBB lockless container is good stuff if explicit lock is not liked :)
Here is the top output during one iteration before crash. Memory available was >5GB at that time.
KiB Mem : 6127340 total, 118168 free, 951640 used, 5057532 buff/cache
Here are backtraces of the iterations:
1st iteration: *** Error in `/data/tmp/mapd/bin/mapd_server': double free or corruption (out): 0x00007f62cc003070 *** ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f63eb6627e5] /lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f63eb66b37a] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f63eb66f53c] /data/tmp/mapd/bin/mapd_server(_ZN14File_Namespace10FileBuffer4readEPammN14Data_Namespace11MemoryLevelEi+0x13c4)[0xe0e2b4] /data/tmp/mapd/bin/mapd_server(_ZN14File_Namespace7FileMgr11fetchBufferERKSt6vectorIiSaIiEEPN14Data_Namespace14AbstractBufferEm+0x202)[0xdff3a2] /data/tmp/mapd/bin/mapd_server(_ZN16Buffer_Namespace9BufferMgr9getBufferERKSt6vectorIiSaIiEEm+0x26b)[0xe1c25b] /data/tmp/mapd/bin/mapd_server(_ZN8Chunk_NS5Chunk8getChunkEPK16ColumnDescriptorPN14Data_Namespace7DataMgrERKSt6vectorIiSaIiEENS4_11MemoryLevelEimm+0x100)[0xe27820] /data/tmp/mapd/bin/mapd_server(_ZNK8Executor17ExecutionDispatch13getScanColumnEiiiRKSt3mapIiPKSt5dequeIN20Fragmenter_Namespace12FragmentInfoESaIS4_EESt4lessIiESaISt4pairIKiS8_EEERSt4listISt10shared_ptrIN8Chunk_NS5ChunkEESaISM_EERSI_I9ChunkIterSaISQ_EEN14Data_Namespace11MemoryLevelEi+0x1e9)[0xc5d449] /data/tmp/mapd/bin/mapd_server(_ZN8Executor11fetchChunksERKNS_17ExecutionDispatchERK19RelAlgExecutionUnitiN14Data_Namespace11MemoryLevelERKSt3mapIiPKSt5dequeIN20Fragmenter_Namespace12FragmentInfoESaISB_EESt4lessIiESaISt4pairIKiSF_EEERKSt6vectorISI_IiSP_ImSaImEEESaISS_EERKN17Catalog_Namespace7CatalogERSt4listI9ChunkIterSaIS12_EERS11_ISt10shared_ptrIN8Chunk_NS5ChunkEESaIS19_EE+0x5c2)[0xc49322] /data/tmp/mapd/bin/mapd_server(_ZN8Executor17ExecutionDispatch7runImplE18ExecutorDeviceTypeiRK16ExecutionOptionsRKSt6vectorISt4pairIiS5_ImSaImEEESaIS9_EEml+0x428)[0xc61168] /data/tmp/mapd/bin/mapd_server(_ZN8Executor17ExecutionDispatch3runE18ExecutorDeviceTypeiRK16ExecutionOptionsRKSt6vectorISt4pairIiS5_ImSaImEEESaIS9_EEml+0x16)[0xc62886] /data/tmp/mapd/bin/mapd_server[0xc3f70d] /data/tmp/mapd/bin/mapd_server[0x29990c0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f63eb9bc6ba] /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f63eb6f23dd]
2nd iteration: *** Error in `/data/tmp/mapd/bin/mapd_server': double free or corruption (out): 0x00007fe19c02fa10 *** ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7fe1f380f7e5] /lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7fe1f381837a] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fe1f381c53c] /data/tmp/mapd/bin/mapd_server(_ZN14File_Namespace10FileBuffer4readEPammN14Data_Namespace11MemoryLevelEi+0x138c)[0xe0e27c] /data/tmp/mapd/bin/mapd_server(_ZN14File_Namespace7FileMgr11fetchBufferERKSt6vectorIiSaIiEEPN14Data_Namespace14AbstractBufferEm+0x202)[0xdff3a2] /data/tmp/mapd/bin/mapd_server(_ZN16Buffer_Namespace9BufferMgr9getBufferERKSt6vectorIiSaIiEEm+0x26b)[0xe1c25b] /data/tmp/mapd/bin/mapd_server(_ZN8Chunk_NS5Chunk8getChunkEPK16ColumnDescriptorPN14Data_Namespace7DataMgrERKSt6vectorIiSaIiEENS4_11MemoryLevelEimm+0x100)[0xe27820] /data/tmp/mapd/bin/mapd_server(_ZNK8Executor17ExecutionDispatch13getScanColumnEiiiRKSt3mapIiPKSt5dequeIN20Fragmenter_Namespace12FragmentInfoESaIS4_EESt4lessIiESaISt4pairIKiS8_EEERSt4listISt10shared_ptrIN8Chunk_NS5ChunkEESaISM_EERSI_I9ChunkIterSaISQ_EEN14Data_Namespace11MemoryLevelEi+0x1e9)[0xc5d449] /data/tmp/mapd/bin/mapd_server(_ZN8Executor11fetchChunksERKNS_17ExecutionDispatchERK19RelAlgExecutionUnitiN14Data_Namespace11MemoryLevelERKSt3mapIiPKSt5dequeIN20Fragmenter_Namespace12FragmentInfoESaISB_EESt4lessIiESaISt4pairIKiSF_EEERKSt6vectorISI_IiSP_ImSaImEEESaISS_EERKN17Catalog_Namespace7CatalogERSt4listI9ChunkIterSaIS12_EERS11_ISt10shared_ptrIN8Chunk_NS5ChunkEESaIS19_EE+0x5c2)[0xc49322] /data/tmp/mapd/bin/mapd_server(_ZN8Executor17ExecutionDispatch7runImplE18ExecutorDeviceTypeiRK16ExecutionOptionsRKSt6vectorISt4pairIiS5_ImSaImEEESaIS9_EEml+0x428)[0xc61168] /data/tmp/mapd/bin/mapd_server(_ZN8Executor17ExecutionDispatch3runE18ExecutorDeviceTypeiRK16ExecutionOptionsRKSt6vectorISt4pairIiS5_ImSaImEEESaIS9_EEml+0x16)[0xc62886] /data/tmp/mapd/bin/mapd_server[0xc3f70d] /data/tmp/mapd/bin/mapd_server[0x29990c0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7fe1f3b696ba] /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7fe1f389f3dd]
3rd iteration: *** Error in `/data/tmp/mapd/bin/mapd_server': double free or corruption (!prev): 0x00007f92085f64b0 *** ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f930be837e5] /lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f930be8c37a] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f930be9053c] /data/tmp/mapd/bin/mapd_server(_ZN14File_Namespace10FileBuffer4readEPammN14Data_Namespace11MemoryLevelEi+0x13ef)[0xe0e2df] /data/tmp/mapd/bin/mapd_server(_ZN14File_Namespace7FileMgr11fetchBufferERKSt6vectorIiSaIiEEPN14Data_Namespace14AbstractBufferEm+0x202)[0xdff3a2] /data/tmp/mapd/bin/mapd_server(_ZN16Buffer_Namespace9BufferMgr9getBufferERKSt6vectorIiSaIiEEm+0x26b)[0xe1c25b] /data/tmp/mapd/bin/mapd_server(_ZN8Chunk_NS5Chunk8getChunkEPK16ColumnDescriptorPN14Data_Namespace7DataMgrERKSt6vectorIiSaIiEENS4_11MemoryLevelEimm+0x100)[0xe27820] /data/tmp/mapd/bin/mapd_server(_ZNK8Executor17ExecutionDispatch13getScanColumnEiiiRKSt3mapIiPKSt5dequeIN20Fragmenter_Namespace12FragmentInfoESaIS4_EESt4lessIiESaISt4pairIKiS8_EEERSt4listISt10shared_ptrIN8Chunk_NS5ChunkEESaISM_EERSI_I9ChunkIterSaISQ_EEN14Data_Namespace11MemoryLevelEi+0x1e9)[0xc5d449] /data/tmp/mapd/bin/mapd_server(_ZN8Executor11fetchChunksERKNS_17ExecutionDispatchERK19RelAlgExecutionUnitiN14Data_Namespace11MemoryLevelERKSt3mapIiPKSt5dequeIN20Fragmenter_Namespace12FragmentInfoESaISB_EESt4lessIiESaISt4pairIKiSF_EEERKSt6vectorISI_IiSP_ImSaImEEESaISS_EERKN17Catalog_Namespace7CatalogERSt4listI9ChunkIterSaIS12_EERS11_ISt10shared_ptrIN8Chunk_NS5ChunkEESaIS19_EE+0x5c2)[0xc49322] /data/tmp/mapd/bin/mapd_server(_ZN8Executor17ExecutionDispatch7runImplE18ExecutorDeviceTypeiRK16ExecutionOptionsRKSt6vectorISt4pairIiS5_ImSaImEEESaIS9_EEml+0x428)[0xc61168] /data/tmp/mapd/bin/mapd_server(_ZN8Executor17ExecutionDispatch3runE18ExecutorDeviceTypeiRK16ExecutionOptionsRKSt6vectorISt4pairIiS5_ImSaImEEESaIS9_EEml+0x16)[0xc62886] /data/tmp/mapd/bin/mapd_server[0xc3f70d] /data/tmp/mapd/bin/mapd_server[0x29990c0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f930c1dd6ba] /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f930bf133dd]
4th iteration: *** Error in `/data/tmp/mapd/bin/mapd_server': double free or corruption (out): 0x00007f2d6973b200 *** ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f2db16a27e5] /lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f2db16ab37a] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f2db16af53c] /data/tmp/mapd/bin/mapd_server(_ZN14File_Namespace10FileBuffer4readEPammN14Data_Namespace11MemoryLevelEi+0x138c)[0xe0e27c] /data/tmp/mapd/bin/mapd_server(_ZN14File_Namespace7FileMgr11fetchBufferERKSt6vectorIiSaIiEEPN14Data_Namespace14AbstractBufferEm+0x202)[0xdff3a2] /data/tmp/mapd/bin/mapd_server(_ZN16Buffer_Namespace9BufferMgr9getBufferERKSt6vectorIiSaIiEEm+0x26b)[0xe1c25b] /data/tmp/mapd/bin/mapd_server(_ZN8Chunk_NS5Chunk8getChunkEPK16ColumnDescriptorPN14Data_Namespace7DataMgrERKSt6vectorIiSaIiEENS4_11MemoryLevelEimm+0x100)[0xe27820] /data/tmp/mapd/bin/mapd_server(_ZNK8Executor17ExecutionDispatch13getScanColumnEiiiRKSt3mapIiPKSt5dequeIN20Fragmenter_Namespace12FragmentInfoESaIS4_EESt4lessIiESaISt4pairIKiS8_EEERSt4listISt10shared_ptrIN8Chunk_NS5ChunkEESaISM_EERSI_I9ChunkIterSaISQ_EEN14Data_Namespace11MemoryLevelEi+0x1e9)[0xc5d449] /data/tmp/mapd/bin/mapd_server(_ZN8Executor11fetchChunksERKNS_17ExecutionDispatchERK19RelAlgExecutionUnitiN14Data_Namespace11MemoryLevelERKSt3mapIiPKSt5dequeIN20Fragmenter_Namespace12FragmentInfoESaISB_EESt4lessIiESaISt4pairIKiSF_EEERKSt6vectorISI_IiSP_ImSaImEEESaISS_EERKN17Catalog_Namespace7CatalogERSt4listI9ChunkIterSaIS12_EERS11_ISt10shared_ptrIN8Chunk_NS5ChunkEESaIS19_EE+0x5c2)[0xc49322] /data/tmp/mapd/bin/mapd_server(_ZN8Executor17ExecutionDispatch7runImplE18ExecutorDeviceTypeiRK16ExecutionOptionsRKSt6vectorISt4pairIiS5_ImSaImEEESaIS9_EEml+0x428)[0xc61168] /data/tmp/mapd/bin/mapd_server(_ZN8Executor17ExecutionDispatch3runE18ExecutorDeviceTypeiRK16ExecutionOptionsRKSt6vectorISt4pairIiS5_ImSaImEEESaIS9_EEml+0x16)[0xc62886] /data/tmp/mapd/bin/mapd_server[0xc3f70d] /data/tmp/mapd/bin/mapd_server[0x29990c0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f2db19fc6ba] /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f2db17323dd]
5th iteration: *** Error in `/data/tmp/mapd/bin/mapd_server': double free or corruption (out): 0x00007f9f4d4059a0 *** ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7fa02dd117e5] /lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7fa02dd1a37a] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fa02dd1e53c] /data/tmp/mapd/bin/mapd_server(_ZN14File_Namespace10FileBuffer4readEPammN14Data_Namespace11MemoryLevelEi+0x13c4)[0xe0e2b4] /data/tmp/mapd/bin/mapd_server(_ZN14File_Namespace7FileMgr11fetchBufferERKSt6vectorIiSaIiEEPN14Data_Namespace14AbstractBufferEm+0x202)[0xdff3a2] /data/tmp/mapd/bin/mapd_server(_ZN16Buffer_Namespace9BufferMgr9getBufferERKSt6vectorIiSaIiEEm+0x26b)[0xe1c25b] /data/tmp/mapd/bin/mapd_server(_ZN8Chunk_NS5Chunk8getChunkEPK16ColumnDescriptorPN14Data_Namespace7DataMgrERKSt6vectorIiSaIiEENS4_11MemoryLevelEimm+0x100)[0xe27820] /data/tmp/mapd/bin/mapd_server(_ZNK8Executor17ExecutionDispatch13getScanColumnEiiiRKSt3mapIiPKSt5dequeIN20Fragmenter_Namespace12FragmentInfoESaIS4_EESt4lessIiESaISt4pairIKiS8_EEERSt4listISt10shared_ptrIN8Chunk_NS5ChunkEESaISM_EERSI_I9ChunkIterSaISQ_EEN14Data_Namespace11MemoryLevelEi+0x1e9)[0xc5d449] /data/tmp/mapd/bin/mapd_server(_ZN8Executor11fetchChunksERKNS_17ExecutionDispatchERK19RelAlgExecutionUnitiN14Data_Namespace11MemoryLevelERKSt3mapIiPKSt5dequeIN20Fragmenter_Namespace12FragmentInfoESaISB_EESt4lessIiESaISt4pairIKiSF_EEERKSt6vectorISI_IiSP_ImSaImEEESaISS_EERKN17Catalog_Namespace7CatalogERSt4listI9ChunkIterSaIS12_EERS11_ISt10shared_ptrIN8Chunk_NS5ChunkEESaIS19_EE+0x5c2)[0xc49322] /data/tmp/mapd/bin/mapd_server(_ZN8Executor17ExecutionDispatch7runImplE18ExecutorDeviceTypeiRK16ExecutionOptionsRKSt6vectorISt4pairIiS5_ImSaImEEESaIS9_EEml+0x428)[0xc61168] /data/tmp/mapd/bin/mapd_server(_ZN8Executor17ExecutionDispatch3runE18ExecutorDeviceTypeiRK16ExecutionOptionsRKSt6vectorISt4pairIiS5_ImSaImEEESaIS9_EEml+0x16)[0xc62886] /data/tmp/mapd/bin/mapd_server[0xc3f70d] /data/tmp/mapd/bin/mapd_server[0x29990c0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7fa02e06b6ba] /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7fa02dda13dd]
Can reproduce this issue with --cpu-buffer-mem-bytes 107374182 but not with --cpu-buffer-mem-bytes 1073741824. Obviously this is due to my carelessly truncated mapd_server command line as described in issue 85.
Closed this issue.
We accept slowness under memory pressure, but not crashes. We still need to fix this.
With latest code 3.3.1dev-20170925-b876cd7, i can't reproduce the "double free" error as seen with 3.2 and with either truncated --cpu-buffer-mem-bytes option or any reasonable buffer size (eg. 1GB)
However, with the unreasonable --cpu-buffer-mem-bytes size (ie, 1GB truncated to 100MB), different core dump occurred, as attached below.
Common is that core dump always occurs after the message "Query couldn't keep the entire working set of columns in GPU memory" showed up.
Also, with that unreasonable buffer size, and with "std::vector<MultiPage>" in FileBuffer.* replaced with "tbb:concurrent_vector<MultiPage>, the same core dump as below occurred too. So, it may be concluded that it's not unsynchronized std::vector<MultiPage> that contributed to that core dump; it's other code.
Question is: is a normal working result still expected on abnormal (100MB) buffer configuration :?
E0925 07:49:18.067535 1660 BufferMgr.cpp:370] ALLOCATION failed to find 197460480B throwing out of memory CPU_MGR:0 E0925 07:49:18.076426 31560 MapDHandler.cpp:2115] Exception: Query couldn't keep the entire working set of columns in GPU memory F0925 07:49:19.494565 1681 File.cpp:88] Check failed: bytesRead == sizeof(int8_t) * size (0 vs. 2097120) *** Check failure stack trace: *** @ 0x7f73c133b5cd google::LogMessage::Fail() @ 0x7f73c133d433 google::LogMessage::SendToLog() @ 0x7f73c133b15b google::LogMessage::Flush() @ 0x7f73c133de1e google::LogMessageFatal::~LogMessageFatal() F0925 07:49:19.619173 1673 File.cpp:88] Check failed: bytesRead == sizeof(int8_t) * size (1858608 vs. 2097120) *** Check failure stack trace: *** F0925 07:49:19.619173 1673 File.cpp:88] Check failed: bytesRead == sizeof(int8_t) * size (1858608 vs. 2097120) F0925 07:49:19.627471 1674 File.cpp:88] Check failed: bytesRead == sizeof(int8_t) * size (0 vs. 2097120) *** Check failure stack trace: *** @ 0x7f73c133b5cd google::LogMessage::Fail() @ 0x7f73c133b5cd google::LogMessage::Fail() @ 0x7f73c133d433 google::LogMessage::SendToLog() @ 0x7f73c133d433 google::LogMessage::SendToLog() @ 0x7f73c133b15b google::LogMessage::Flush() @ 0x7f73c133de1e google::LogMessageFatal::~LogMessageFatal() @ 0x7f73c133b15b google::LogMessage::Flush() @ 0x7f73c133de1e google::LogMessageFatal::~LogMessageFatal() F0925 07:49:19.619173 1673 File.cpp:88] Check failed: bytesRead == sizeof(int8_t) * size (1858608 vs. 2097120) F0925 07:49:19.627471 1674 File.cpp:88] Check failed: bytesRead == sizeof(int8_t) * size (0 vs. 2097120) F0925 07:49:19.651443 1679 File.cpp:88] Check failed: bytesRead == sizeof(int8_t) * size (0 vs. 2097120) *** Check failure stack trace: *** @ 0x7f73c133b5cd google::LogMessage::Fail() @ 0x7f73c133d433 google::LogMessage::SendToLog() @ 0x7f73c133b15b google::LogMessage::Flush() @ 0x7f73c133de1e google::LogMessageFatal::~LogMessageFatal() @ 0x1788912 File_Namespace::read() @ 0x1788912 File_Namespace::read() @ 0x1788912 File_Namespace::read() @ 0x1788912 File_Namespace::read() @ 0x1784d2b File_Namespace::FileInfo::read() @ 0x1784d2b File_Namespace::FileInfo::read() @ 0x1784d2b File_Namespace::FileInfo::read() @ 0x1784d2b File_Namespace::FileInfo::read() @ 0x177c727 File_Namespace::readForThread() @ 0x177c727 File_Namespace::readForThread() @ 0x177c727 File_Namespace::readForThread() @ 0x177c727 File_Namespace::readForThread() @ 0x1783922 _ZNSt12_Bind_simpleIFPFmPN14File_Namespace10FileBufferENS0_12readThreadDSEES2_S3_EE9_M_invokeIILm0ELm1EEEEmSt12_Index_tupleIIXspT_EEE @ 0x1783922 _ZNSt12_Bind_simpleIFPFmPN14File_Namespace10FileBufferENS0_12readThreadDSEES2_S3_EE9_M_invokeIILm0ELm1EEEEmSt12_Index_tupleIIXspT_EEE @ 0x1783922 _ZNSt12_Bind_simpleIFPFmPN14File_Namespace10FileBufferENS0_12readThreadDSEES2_S3_EE9_M_invokeIILm0ELm1EEEEmSt12_Index_tupleIIXspT_EEE @ 0x1783922 _ZNSt12_Bind_simpleIFPFmPN14File_Namespace10FileBufferENS0_12readThreadDSEES2_S3_EE9_M_invokeIILm0ELm1EEEEmSt12_Index_tupleIIXspT_EEE @ 0x1783732 std::_Bind_simple<>::operator()() @ 0x1783732 std::_Bind_simple<>::operator()() @ 0x1783732 std::_Bind_simple<>::operator()() @ 0x17833e0 std::__future_base::_Task_setter<>::operator()() @ 0x17833e0 std::__future_base::_Task_setter<>::operator()() @ 0x1783732 std::_Bind_simple<>::operator()() @ 0x178306c std::_Function_handler<>::_M_invoke() @ 0x178306c std::_Function_handler<>::_M_invoke() @ 0x17833e0 std::__future_base::_Task_setter<>::operator()() @ 0x17833e0 std::__future_base::_Task_setter<>::operator()() @ 0x178306c std::_Function_handler<>::_M_invoke() @ 0x13caa68 std::function<>::operator()() @ 0x13caa68 std::function<>::operator()() @ 0x13caa68 std::function<>::operator()() @ 0x178306c std::_Function_handler<>::_M_invoke() @ 0x13c9e2e std::__future_base::_State_baseV2::_M_do_set() @ 0x13c9e2e std::__future_base::_State_baseV2::_M_do_set() @ 0x13c9e2e std::__future_base::_State_baseV2::_M_do_set() @ 0x13cf396 std::_Mem_fn_base<>::operator()<>() @ 0x13cf396 std::_Mem_fn_base<>::operator()<>() @ 0x13cf396 std::_Mem_fn_base<>::operator()<>() @ 0x13ceb27 _ZNSt12_Bind_simpleIFSt7_Mem_fnIMNSt13__future_base13_State_baseV2EFvPSt8functionIFSt10unique_ptrINS1_12_Result_baseENS5_8_DeleterEEvEEPbEEPS2_SA_SB_EE9_M_invokeIJLm0ELm1ELm2EEEEvSt12_Index_tupleIJXspT_EEE @ 0x13ceb27 _ZNSt12_Bind_simpleIFSt7_Mem_fnIMNSt13__future_base13_State_baseV2EFvPSt8functionIFSt10unique_ptrINS1_12_Result_baseENS5_8_DeleterEEvEEPbEEPS2_SA_SB_EE9_M_invokeIJLm0ELm1ELm2EEEEvSt12_Index_tupleIJXspT_EEE @ 0x13ceb27 _ZNSt12_Bind_simpleIFSt7_Mem_fnIMNSt13__future_base13_State_baseV2EFvPSt8functionIFSt10unique_ptrINS1_12_Result_baseENS5_8_DeleterEEvEEPbEEPS2_SA_SB_EE9_M_invokeIJLm0ELm1ELm2EEEEvSt12_Index_tupleIJXspT_EEE @ 0x13cdab8 std::_Bind_simple<>::operator()() @ 0x13cdab8 std::_Bind_simple<>::operator()() @ 0x13cdab8 std::_Bind_simple<>::operator()() @ 0x13cc54d std::__once_call_impl<>() @ 0x7f73bf14fa99 __pthread_once_slow @ 0x13cc54d std::__once_call_impl<>() @ 0x7f73bf14fa99 __pthread_once_slow @ 0x13c2832 __gthread_once() @ 0x13c2832 __gthread_once() @ 0x13ca8f2 std::call_once<>() @ 0x13c9bac std::__future_base::_State_baseV2::_M_set_result() @ 0x13ca8f2 std::call_once<>() @ 0x1782ac6 _ZZNSt13__future_base17_Async_state_implISt12_Bind_simpleIFPFmPN14File_Namespace10FileBufferENS2_12readThreadDSEES4_S5_EEmEC4EOS9_ENKUlvE_clEv @ 0x13cc54d std::__once_call_impl<>() @ 0x13c9bac std::__future_base::_State_baseV2::_M_set_result() @ 0x7f73bf14fa99 __pthread_once_slow @ 0x13c2832 __gthread_once() @ 0x1782ac6 _ZZNSt13__future_base17_Async_state_implISt12_Bind_simpleIFPFmPN14File_Namespace10FileBufferENS2_12readThreadDSEES4_S5_EEmEC4EOS9_ENKUlvE_clEv @ 0x13ca8f2 std::call_once<>() @ 0x17849ae _ZNSt12_Bind_simpleIFZNSt13__future_base17_Async_state_implIS_IFPFmPN14File_Namespace10FileBufferENS2_12readThreadDSEES4_S5_EEmEC4EOS9_EUlvE_vEE9_M_invokeIJEEEvSt12_Index_tupleIJXspT_EEE @ 0x17849ae _ZNSt12_Bind_simpleIFZNSt13__future_base17_Async_state_implIS_IFPFmPN14File_Namespace10FileBufferENS2_12readThreadDSEES4_S5_EEmEC4EOS9_EUlvE_vEE9_M_invokeIJEEEvSt12_Index_tupleIJXspT_EEE @ 0x13c9bac std::__future_base::_State_baseV2::_M_set_result() @ 0x1782ac6 _ZZNSt13__future_base17_Async_state_implISt12_Bind_simpleIFPFmPN14File_Namespace10FileBufferENS2_12readThreadDSEES4_S5_EEmEC4EOS9_ENKUlvE_clEv @ 0x1784884 _ZNSt12_Bind_simpleIFZNSt13__future_base17_Async_state_implIS_IFPFmPN14File_Namespace10FileBufferENS2_12readThreadDSEES4_S5_EEmEC4EOS9_EUlvE_vEEclEv @ 0x17849ae _ZNSt12_Bind_simpleIFZNSt13__future_base17_Async_state_implIS_IFPFmPN14File_Namespace10FileBufferENS2_12readThreadDSEES4_S5_EEmEC4EOS9_EUlvE_vEE9_M_invokeIJEEEvSt12_Index_tupleIJXspT_EEE @ 0x1784884 _ZNSt12_Bind_simpleIFZNSt13__future_base17_Async_state_implIS_IFPFmPN14File_Namespace10FileBufferENS2_12readThreadDSEES4_S5_EEmEC4EOS9_EUlvE_vEEclEv @ 0x1784884 _ZNSt12_Bind_simpleIFZNSt13__future_base17_Async_state_implIS_IFPFmPN14File_Namespace10FileBufferENS2_12readThreadDSEES4_S5_EEmEC4EOS9_EUlvE_vEEclEv @ 0x17843a0 _ZNSt6thread5_ImplISt12_Bind_simpleIFZNSt13__future_base17_Async_state_implIS1_IFPFmPN14File_Namespace10FileBufferENS4_12readThreadDSEES6_S7_EEmEC4EOSB_EUlvE_vEEE6_M_runEv @ 0x17843a0 _ZNSt6thread5_ImplISt12_Bind_simpleIFZNSt13__future_base17_Async_state_implIS1_IFPFmPN14File_Namespace10FileBufferENS4_12readThreadDSEES6_S7_EEmEC4EOSB_EUlvE_vEEE6_M_runEv @ 0x7f73bf935c80 (unknown) @ 0x7f73bf935c80 (unknown) @ 0x7f73bf1486ba start_thread @ 0x7f73bf1486ba start_thread @ 0x7f73bee7e3dd clone @ 0x7f73bee7e3dd clone @ (nil) (unknown) @ (nil) (unknown) Aborted (core dumped)
We accept slowness under memory pressure, but not crashes. We still need to fix this.
Okay. Just realized that --cpu-buffer-mem-bytes configures cpu buffer pool which needs not be as large as dataset.
So tried small but more reasonable --cpu-buffer-mem-bytes values. So far experienced only one core dump with a value of 1GB.
Core dump summary follows:
$ time /data/github/mapd-core/bin/mapd_server --data /mnt/trip/mapd/data --cpu-buffer-mem-bytes 1073741824 E0925 18:32:58.940585 8681 MapDHandler.cpp:140] This build isn't CUDA enabled, will run on CPU Thrift: Mon Sep 25 18:32:58 2017 TSocket::open() connect() <Host: localhost Port: 9093>Connection refused Thrift: Mon Sep 25 18:32:59 2017 TSocket::open() connect() <Host: localhost Port: 9093>Connection refused Thrift: Mon Sep 25 18:32:59 2017 TSocket::open() connect() <Host: localhost Port: 9093>Connection refused E0925 18:32:59.398660 8681 MapDHandler.cpp:172] No GPUs detected, falling back to CPU mode Received 1 Received 1 *** Error in `/data/github/mapd-core/bin/mapd_server': corrupted size vs. prev_size: 0x00007f62bc656b00 *** ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f630de2b7e5] /lib/x86_64-linux-gnu/libc.so.6(+0x82aec)[0x7f630de36aec] /lib/x86_64-linux-gnu/libc.so.6(__libc_malloc+0x54)[0x7f630de38184] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(_Znwm+0x18)[0x7f630e947e78] /data/github/mapd-core/bin/mapd_server(_ZN9__gnu_cxx13new_allocatorIN14File_Namespace9MultiPageEE8allocateEmPKv+0x51)[0x1778bbd] /data/github/mapd-core/bin/mapd_server(_ZNSt16allocator_traitsISaIN14File_Namespace9MultiPageEEE8allocateERS2_m+0x28)[0x17777fa] /data/github/mapd-core/bin/mapd_server(_ZNSt12_Vector_baseIN14File_Namespace9MultiPageESaIS1_EE11_M_allocateEm+0x2a)[0x17752ca] /data/github/mapd-core/bin/mapd_server(_ZNSt12_Vector_baseIN14File_Namespace9MultiPageESaIS1_EE17_M_create_storageEm+0x23)[0x1780999] /data/github/mapd-core/bin/mapd_server(ZNSt12_Vector_baseIN14File_Namespace9MultiPageESaIS1_EEC2EmRKS2+0x3b)[0x177fccf] /data/github/mapd-core/bin/mapd_server(ZNSt6vectorIN14File_Namespace9MultiPageESaIS1_EEC2ERKS3+0x64)[0x177f3f8] /data/github/mapd-core/bin/mapd_server(ZN14File_Namespace12readThreadDSC2ERKS0+0x98)[0x177f390] /data/github/mapd-core/bin/mapd_server(_ZN14File_Namespace10FileBuffer4readEPammN14Data_Namespace11MemoryLevelEi+0x442)[0x177ccfe] /data/github/mapd-core/bin/mapd_server(_ZN14File_Namespace7FileMgr11fetchBufferERKSt6vectorIiSaIiEEPN14Data_Namespace14AbstractBufferEm+0x3fc)[0x176e464] /data/github/mapd-core/bin/mapd_server(_ZN14File_Namespace13GlobalFileMgr11fetchBufferERKSt6vectorIiSaIiEEPN14Data_Namespace14AbstractBufferEm+0x47)[0x1767365] /data/github/mapd-core/bin/mapd_server(_ZN16Buffer_Namespace9BufferMgr9getBufferERKSt6vectorIiSaIiEEm+0x2ba)[0x17903c6] /data/github/mapd-core/bin/mapd_server(_ZN14Data_Namespace7DataMgr14getChunkBufferERKSt6vectorIiSaIiEENS_11MemoryLevelEim+0xca)[0x1754fea] /data/github/mapd-core/bin/mapd_server(_ZN8Chunk_NS5Chunk14getChunkBufferEPN14Data_Namespace7DataMgrERKSt6vectorIiSaIiEENS1_11MemoryLevelEimm+0x324)[0x179ed2e] /data/github/mapd-core/bin/mapd_server(_ZN8Chunk_NS5Chunk8getChunkEPK16ColumnDescriptorPN14Data_Namespace7DataMgrERKSt6vectorIiSaIiEENS4_11MemoryLevelEimm+0x95)[0x179e7eb] /data/github/mapd-core/bin/mapd_server(_ZNK8Executor17ExecutionDispatch13getScanColumnEiiiRKSt3mapIiPKSt5dequeIN20Fragmenter_Namespace12FragmentInfoESaIS4_EESt4lessIiESaISt4pairIKiS8_EEERNSt7__cxx114listISt10shared_ptrIN8Chunk_NS5ChunkEESaISN_EEERNSJ_I9ChunkIterSaISR_EEEN14Data_Namespace11MemoryLevelEi+0x5c0)[0x146815a] /data/github/mapd-core/bin/mapd_server(_ZN8Executor11fetchChunksERKNS_17ExecutionDispatchERK19RelAlgExecutionUnitiN14Data_Namespace11MemoryLevelERKSt3mapIiPKSt5dequeIN20Fragmenter_Namespace12FragmentInfoESaISB_EESt4lessIiESaISt4pairIKiSF_EEERKSt6vectorISI_IiSP_ImSaImEEESaISS_EERKN17Catalog_Namespace7CatalogERNSt7__cxx114listI9ChunkIterSaIS13_EEERNS12_ISt10shared_ptrIN8Chunk_NS5ChunkEESaIS1A_EEE+0xd77)[0x13de31b] /data/github/mapd-core/bin/mapd_server(_ZN8Executor17ExecutionDispatch7runImplE18ExecutorDeviceTypeiRK16ExecutionOptionsRKSt6vectorISt4pairIiS5_ImSaImEEESaIS9_EEml+0x71f)[0x14657d7] /data/github/mapd-core/bin/mapd_server(_ZN8Executor17ExecutionDispatch3runE18ExecutorDeviceTypeiRK16ExecutionOptionsRKSt6vectorISt4pairIiS5_ImSaImEEESaIS9_EEml+0x62)[0x146790c] /data/github/mapd-core/bin/mapd_server[0x13d66d4] /data/github/mapd-core/bin/mapd_server[0x140e213] /data/github/mapd-core/bin/mapd_server(_ZNKSt8functionIFv18ExecutorDeviceTypeiRKSt6vectorISt4pairIiS1_ImSaImEEESaIS5_EEmlEEclES0_iS9_ml+0xa4)[0x146362a] /data/github/mapd-core/bin/mapd_server(_ZNSt12_Bind_simpleIFSt8functionIFv18ExecutorDeviceTypeiRKSt6vectorISt4pairIiS2_ImSaImEEESaIS6_EEmlEES1_iS8_mlEE9_M_invokeIILm0ELm1ELm2ELm3ELm4EEEEvSt12_Index_tupleIIXspT_EEE+0xb1)[0x1463577] /data/github/mapd-core/bin/mapd_server(_ZNSt12_Bind_simpleIFSt8functionIFv18ExecutorDeviceTypeiRKSt6vectorISt4pairIiS2_ImSaImEEESaIS6_EEmlEES1_iS8_mlEEclEv+0x2c)[0x14631f4] /data/github/mapd-core/bin/mapd_server(_ZNSt6thread5_ImplISt12_Bind_simpleIFSt8functionIFv18ExecutorDeviceTypeiRKSt6vectorISt4pairIiS4_ImSaImEEESaIS8_EEmlEES3_iSA_mlEEE6_M_runEv+0x1c)[0x1463104] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb8c80)[0x7f630e972c80] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f630e1856ba] /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f630debb3dd] ======= Memory map: ======== 00400000-03495000 r-xp 00000000 08:11 141377 /home/ppan/data/github/mapd-core/bin/mapd_server 03695000-0393a000 r--p 03095000 08:11 141377 /home/ppan/data/github/mapd-core/bin/mapd_server 0393a000-0393f000 rw-p 0333a000 08:11 141377 /home/ppan/data/github/mapd-core/bin/mapd_server 0393f000-03964000 rw-p 00000000 00:00 0 04774000-04812000 rw-p 00000000 00:00 0 [heap] ...
Reset cpu buffer bytes to 107M in order to reproduce core dump more quickly. This unreasonably small value always ran into a core dump so far; vice versa, value of 1GB or larger could also run to a core dump but relatively rarely.
$ time /data/github/mapd-core/bin/mapd_server --data /mnt/trip/mapd/data --cpu-buffer-mem-bytes 107374182
On stack frame #7 of back trace below, there was an error "<error: Cannot access memory at address 0x7f2ea4239f90>) ". It seemed readForThread() gave an invalid buffer address. readForThread() may be a victim, too.
(gdb) bt
#0 0x00007f2f12224428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1 0x00007f2f1222602a in __GI_abort () at abort.c:89
#2 0x00007f2f147bc12c in ?? () from /usr/lib/x86_64-linux-gnu/libglog.so.0
#3 0x00007f2f147b35cd in google::LogMessage::Fail() () from /usr/lib/x86_64-linux-gnu/libglog.so.0
#4 0x00007f2f147b5433 in google::LogMessage::SendToLog() () from /usr/lib/x86_64-linux-gnu/libglog.so.0
#5 0x00007f2f147b315b in google::LogMessage::Flush() () from /usr/lib/x86_64-linux-gnu/libglog.so.0
#6 0x00007f2f147b5e1e in google::LogMessageFatal::~LogMessageFatal() () from /usr/lib/x86_64-linux-gnu/libglog.so.0
#7 0x0000000001788912 in File_Namespace::read (f=0x7f2eb8620250, offset=184549408, size=2097120, buf=0x7f2ea4239f90 <error: Cannot access memory at address 0x7f2ea4239f90>) at /data/github/mapd-core/DataMgr/FileMgr/File.cpp:88
#8 0x0000000001784d2b in File_Namespace::FileInfo::read (this=0x7f2eb8613750, offset=184549408, size=2097120, buf=0x7f2ea4239f90 <error: Cannot access memory at address 0x7f2ea4239f90>)
at /data/github/mapd-core/DataMgr/FileMgr/FileInfo.cpp:59
#9 0x000000000177c727 in File_Namespace::readForThread (fileBuffer=0x7f2ecc809cf0, threadDS=...) at /data/github/mapd-core/DataMgr/FileMgr/FileBuffer.cpp:215
#10 0x0000000001783922 in std::_Bind_simple<unsigned long (*(File_Namespace::FileBuffer*, File_Namespace::readThreadDS))(File_Namespace::FileBuffer*, File_Namespace::readThreadDS)>::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) (this=0x7f2ed257b298) at /usr/include/c++/5/functional:1530
#11 0x0000000001783732 in std::__addressof<std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<unsigned long>, std::__future_base::_Result_base::_Deleter>, std::_Bind_simple<unsigned long (*(File_Namespace::FileBuffer*, File_Namespace::readThreadDS))(File_Namespace::FileBuffer*, File_Namespace::readThreadDS)>, unsigned long> const>(std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<unsigned long>, std::__future_base::_Result_base::_Deleter>, std::_Bind_simple<unsigned long (*(File_Namespace::FileBuffer*, File_Namespace::readThreadDS))(File_Namespace::FileBuffer*, File_Namespace::readThreadDS)>, unsigned long> const&) (__r=...)
at /usr/include/c++/5/bits/move.h:51
#12 0x00007f2ec27fb270 in ?? ()
#13 0x0000000000000000 in ?? ()
More often is the following type of core dump which resulted from incomplete file read.
$ time /data/github/mapd-core/bin/mapd_server --data /mnt/trip/mapd/data --cpu-buffer-mem-bytes 107374182
E0925 21:26:25.449587 24255 MapDHandler.cpp:140] This build isn't CUDA enabled, will run on CPU
E0925 21:26:25.580756 24255 Calcite.cpp:101] Appears to be orphaned Calcite serve already running, shutting it down
E0925 21:26:25.580806 24255 Calcite.cpp:102] Please check that you are not trying to run two servers on same port
E0925 21:26:25.580826 24255 Calcite.cpp:103] Attempting to shutdown orphaned Calcite server
E0925 21:26:25.587929 24255 Calcite.cpp:109] orphaned Calcite server shutdown
Thrift: Mon Sep 25 21:26:25 2017 TSocket::open() connect() <Host: localhost Port: 9093>Connection refused
Thrift: Mon Sep 25 21:26:25 2017 TSocket::open() connect() <Host: localhost Port: 9093>Connection refused
E0925 21:26:26.022274 24255 MapDHandler.cpp:172] No GPUs detected, falling back to CPU mode
Received 1
Received 1
E0925 21:29:00.404398 24284 MapDHandler.cpp:2115] Exception: Query couldn't keep the entire working set of columns in GPU memory
E0925 21:29:01.223201 24284 MapDHandler.cpp:2115] Exception: Query couldn't keep the entire working set of columns in GPU memory
F0925 21:29:02.468096 25092 File.cpp:88] **Check failed: bytesRead == sizeof(int8_t) * size (423504 vs. 1052328)**
Inspection of corresponding threadDS struct passed to readForThread() thread shows no sign of invalid address in this type of core dumps. The destination memory block into which File_Namespace::read() would read data from file seems well within the memory that had been reserved for fileBuffer. So no idea yet why the read was incomplete...
However, one thing very sure is that once LOAD thread finished, there would be no crash resulted from SELECT thread.
When mapd_server was launched in gdb, crash pattern seems further diverse. For example, i got the following core dump of mapd_server in gdb which i haven't seen before when running mapd_server on shell command line. It seems mapd_sever is timing sensitive in some degree. When running in gdb, the sensitivity is highlighted by the runtime overhead that gdb adds to the debugged process.
Note: I didn't step into/over any code but simply launched mapd_server in gdb and let it run till it crashed.
This crash occurred in a constructor:
Thread 815 "mapd_server" received signal SIGABRT, Aborted. [Switching to Thread 0x7fffb893b700 (LWP 17720)] 0x00007ffff44a5428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54 54 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb) bt #0 0x00007ffff44a5428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54 #1 0x00007ffff44a702a in __GI_abort () at abort.c:89 #2 0x00007ffff44e77ea in __libc_message (do_abort=2, fmt=fmt@entry=0x7ffff4600e98 "*** Error in `%s': %s: 0x%s *\n") at ../sysdeps/posix/libc_fatal.c:175 #3 0x00007ffff44f2aec in malloc_printerr (ar_ptr=0x7fffa0000020, ptr=0x7fffa066ecb0, str=0x7ffff45fdc35 "corrupted size vs. prev_size", action=
) at malloc.c:5006 #4 _int_malloc (av=av@entry=0x7fffa0000020, bytes=bytes@entry=9072) at malloc.c:3727 #5 0x00007ffff44f4184 in __GI___libc_malloc (bytes=9072) at malloc.c:2913 #6 0x00007ffff5003e78 in operator new(unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #7 0x0000000001778b87 in __gnu_cxx::new_allocator<File_Namespace::MultiPage>::allocate (this=0x7fffb8939178, __n=54) at /usr/include/c++/5/ext/new_allocator.h:104 #8 0x00000000017777c4 in std::allocator_traits<std::allocator<File_Namespace::MultiPage> >::allocate (__a=..., __n=54) at /usr/include/c++/5/bits/alloc_traits.h:491 #9 0x0000000001775294 in std::_Vector_base<File_Namespace::MultiPage, std::allocator<File_Namespace::MultiPage> >::_M_allocate (this=0x7fffb8939178, __n=54) at /usr/include/c++/5/bits/stl_vector.h:170 #10 0x0000000001780a15 in std::_Vector_base<File_Namespace::MultiPage, std::allocator<File_Namespace::MultiPage> >::_M_create_storage (this=0x7fffb8939178, __n=54) at /usr/include/c++/5/bits/stl_vector.h:185 #11 0x000000000177fd2d in std::_Vector_base<File_Namespace::MultiPage, std::allocator<File_Namespace::MultiPage> >::_Vector_base (this=0x7fffb8939178, __n=54, __a=...) at /usr/include/c++/5/bits/stl_vector.h:136 #12 0x000000000177f44a in std::vector<File_Namespace::MultiPage, std::allocator<File_Namespace::MultiPage> >::vector (this=0x7fffb8939178, __x=std::vector of length 54, capacity 53 = {...}) at /usr/include/c++/5/bits/stl_vector.h:320 #13 0x000000000177f3e2 in File_Namespace::readThreadDS::readThreadDS (this=0x7fffb8939130) at /data/github/mapd-core/DataMgr/FileMgr/FileBuffer.cpp:176 #14 0x000000000177cd0c in File_Namespace::FileBuffer::read (this=0x7fffb0808c50, dst=0x7fff6c56aa20 "", numBytes=731916, offset=110402064, dstBufferType=Data_Namespace::CPU_LEVEL, deviceId=0) at /data/github/mapd-core/DataMgr/FileMgr/FileBuffer.cpp:291 #15 0x000000000176e43e in File_Namespace::FileMgr::fetchBuffer (this=0x7fffcc0155d0, key=std::vector of length 4, capacity 4 = {...}, destBuffer=0x7fffac805fe0, numBytes=111133980) at /data/github/mapd-core/DataMgr/FileMgr/FileMgr.cpp:589 #16 0x0000000001767365 in File_Namespace::GlobalFileMgr::fetchBuffer (this=0x39dcf90, key=std::vector of length 4, capacity 4 = {...}, destBuffer=0x7fffac805fe0, numBytes=111133980) at /data/github/mapd-core/DataMgr/FileMgr/GlobalFileMgr.h:82 #17 0x0000000001790448 in Buffer_Namespace::BufferMgr::getBuffer (this=0x39e0830, key=std::vector of length 4, capacity 4 = {...}, numBytes=111133980) at /data/github/mapd-core/DataMgr/BufferMgr/BufferMgr.cpp:665 #18 0x0000000001754fea in Data_Namespace::DataMgr::getChunkBuffer (this=0x39d4970, key=std::vector of length 4, capacity 4 = {...}, memoryLevel=Data_Namespace::CPU_LEVEL, deviceId=0, numBytes=111133980) at /data/github/mapd-core/DataMgr/DataMgr.cpp:330 #19 0x000000000179edb0 in Chunk_NS::Chunk::getChunkBuffer (this=0x7fffa096c650, data_mgr=0x39d4970, key=std::vector of length 4, capacity 4 = {...}, mem_level=Data_Namespace::CPU_LEVEL, device_id=0, num_bytes=111133980, num_elems=27783495) at /data/github/mapd-core/Chunk/Chunk.cpp:88 #20 0x000000000179e86d in Chunk_NS::Chunk::getChunk (cd=0x7fffd4031560, data_mgr=0x39d4970, key=std::vector of length 4, capacity 4 = {...}, memoryLevel=Data_Namespace::CPU_LEVEL, deviceId=0, numBytes=111133980, numElems=27783495) at /data/github/mapd-core/Chunk/Chunk.cpp:35 #21 0x000000000146815a in Executor::ExecutionDispatch::getScanColumn (this=0x7fffe04d49e0, table_id=1, frag_id=0, col_id=9, all_tables_fragments=std::map with 1 elements = {...}, chunk_holder=..., chunk_iter_holder=..., memory_level=Data_Namespace::CPU_LEVEL, device_id=0) at /data/github/mapd-core/QueryEngine/ExecutionDispatch.cpp:544 #22 0x00000000013de31b in Executor::fetchChunks (this=0x7fffc80018a0, execution_dispatch=..., ra_exe_unit=..., device_id=0, memory_level=Data_Namespace::CPU_LEVEL, all_tables_fragments=std::map with 1 elements = {...}, selected_fragments=std::vector of length 1, capacity 1 = {...}, cat=..., chunk_iterators=..., chunks=...) at /data/github/mapd-core/QueryEngine/Execute.cpp:1570 #23 0x00000000014657d7 in Executor::ExecutionDispatch::runImpl (this=0x7fffe04d49e0, chosen_device_type=ExecutorDeviceType::CPU, chosen_device_id=0, options=..., frag_ids=std::vector of length 1, capacity 1 = {...}, ctx_idx=0, rowid_lookup_key=-1) at /data/github/mapd-core/QueryEngine/ExecutionDispatch.cpp:217 #24 0x000000000146790c in Executor::ExecutionDispatch::run (this=0x7fffe04d49e0, chosen_device_type=ExecutorDeviceType::CPU, chosen_device_id=0, options=..., frag_ids=std::vector of length 1, capacity 1 = {...}, ctx_idx=0, rowid_lookup_key=-1) at /data/github/mapd-core/QueryEngine/ExecutionDispatch.cpp:492 #25 0x00000000013d66d4 in Executor::<lambda(ExecutorDeviceType, int, const std::vector<std::pair<int, std::vector<long unsigned int, std::allocator , size_t&, bool, const std::vector> >, std::allocator<std::pair<int, std::vector<long unsigned int, std::allocator > > > >&, size_t, int64_t)>::operator()(ExecutorDeviceType, int, const std::vector<std::pair<int, std::vector<unsigned long, std::allocator > >, std::allocator<std::pair<int, std::vector<unsigned long, std::allocator > > > > &, size_t, int64_t) const (__closure=0x7fffc8065130, chosen_device_type=ExecutorDeviceType::CPU, chosen_device_id=0, frag_ids=std::vector of length 1, capacity 1 = {...}, ctx_idx=0, rowid_lookup_key=-1) at /data/github/mapd-core/QueryEngine/Execute.cpp:867 ---Type to continue, or q to quit--- #26 0x000000000140e213 in std::_Function_handler<void(ExecutorDeviceType, int, const std::vector<std::pair<int, std::vector<long unsigned int, std::allocator > >, std::allocator<std::pair<int, std::vector<long unsigned int, std::allocator > > > >&, long unsigned int, long int), Executor::executeWorkUnit(int32_t &, const RelAlgExecutionUnit&, const CompilationOptions&, const ExecutionOptions&, const Catalog_Namespace::Catalog&, std::shared_ptr , bool)::<lambda(ExecutorDeviceType, int, const std::vector<std::pair<int, std::vector<long unsigned int, std::allocator, RenderAllocatorMap > >, std::allocator<std::pair<int, std::vector<long unsigned int, std::allocator > > > >&, size_t, int64_t)> >::_M_invoke(const std::_Any_data &, <unknown type in /home/ppan/data/github/mapd-core/bin/mapd_server, CU 0x9908f0, DIE 0xb56e32>, <unknown type in /home/ppan/data/github/mapd-core/bin/mapd_server, CU 0x9908f0, DIE 0xb56e37>, const std::vector<std::pair<int, std::vector<unsigned long, std::allocator > >, std::allocator<std::pair<int, std::vector<unsigned long, std::allocator > > > > &, <unknown type in /home/ppan/data/github/mapd-core/bin/mapd_server, CU 0x9908f0, DIE 0xb56e41>, <unknown type in /home/ppan/data/github/mapd-core/bin/mapd_server, CU 0x9908f0, DIE 0xb56e46>) (__functor=..., __args#0=<unknown type in /home/ppan/data/github/mapd-core/bin/mapd_server, CU 0x9908f0, DIE 0xb56e32>, __args#1=<unknown type in /home/ppan/data/github/mapd-core/bin/mapd_server, CU 0x9908f0, DIE 0xb56e37>, __args#2=std::vector of length 1, capacity 1 = {...}, __args#3=<unknown type in /home/ppan/data/github/mapd-core/bin/mapd_server, CU 0x9908f0, DIE 0xb56e41>, __args#4=<unknown type in /home/ppan/data/github/mapd-core/bin/mapd_server, CU 0x9908f0, DIE 0xb56e46>) at /usr/include/c++/5/functional:1871 #27 0x000000000146362a in std::function<void (ExecutorDeviceType, int, std::vector<std::pair<int, std::vector<unsigned long, std::allocator > >, std::allocator<std::pair<int, std::vector<unsigned long, std::allocator > > > > const&, unsigned long, long)>::operator()(ExecutorDeviceType, int, std::vector<std::pair<int, std::vector<unsigned long, std::allocator > >, std::allocator<std::pair<int, std::vector<unsigned long, std::allocator > > > > const&, unsigned long, long) const (this=0x7fffc82abcf8, __args#0=ExecutorDeviceType::CPU, __args#1=0, __args#2=std::vector of length 1, capacity 1 = {...}, __args#3=0, __args#4=-1) at /usr/include/c++/5/functional:2267 #28 0x0000000001463577 in std::_Bind_simple<std::function<void (ExecutorDeviceType, int, std::vector<std::pair<int, std::vector<unsigned long, std::allocator > >, std::allocator<std::pair<int, std::vector<unsigned long, std::allocator > > > > const&, unsigned long, long)> (ExecutorDeviceType, int, std::vector<std::pair<int, std::vector<unsigned long, std::allocator > >, std::allocator<std::pair<int, std::vector<unsigned long, std::allocator > > > >, unsigned long, long)>::_M_invoke<0ul, 1ul, 2ul, 3ul, 4ul>(std::_Index_tuple<0ul, 1ul, 2ul, 3ul, 4ul>) (this=0x7fffc82abcc8) at /usr/include/c++/5/functional:1531 #29 0x00000000014631f4 in std::_Bind_simple<std::function<void (ExecutorDeviceType, int, std::vector<std::pair<int, std::vector<unsigned long, std::allocator > >, std::allocator<std::pair<int, std::vector<unsigned long, std::allocator > > > > const&, unsigned long, long)> (ExecutorDeviceType, int, std::vector<std::pair<int, std::vector<unsigned long, std::allocator > >, std::allocator<std::pair<int, std::vector<unsigned long, std::allocator > > > >, unsigned long, long)>::operator()() (this=0x7fffc82abcc8) at /usr/include/c++/5/functional:1520 #30 0x0000000001463104 in std::thread::_Impl<std::_Bind_simple<std::function<void (ExecutorDeviceType, int, std::vector<std::pair<int, std::vector<unsigned long, std::allocator > >, std::allocator<std::pair<int, std::vector<unsigned long, std::allocator > > > > const&, unsigned long, long)> (ExecutorDeviceType, int, std::vector<std::pair<int, std::vector<unsigned long, std::allocator > >, std::allocator<std::pair<int, std::vector<unsigned long, std::allocator > > > >, unsigned long, long)> >::_M_run() (this=0x7fffc82abcb0) at /usr/include/c++/5/thread:115 #31 0x00007ffff502ec80 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #32 0x00007ffff48416ba in start_thread (arg=0x7fffb893b700) at pthread_create.c:333 #33 0x00007ffff45773dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
Note: From stack frame #14, multiple readForThread threads had not even been created yet.
This is another crash pattern inside gdb, occurring in the destructor.
#0 0x00007ffff44a5428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54 #1 0x00007ffff44a702a in __GI_abort () at abort.c:89 #2 0x00007ffff44e77ea in __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0x7ffff4600e98 "*** Error in `%s': %s: 0x%s \n") at ../sysdeps/posix/libc_fatal.c:175 #3 0x00007ffff44f037a in malloc_printerr (ar_ptr=
, ptr= > (__first=0x7fff8cc41580, __last=0x7fff8cc42498) at /usr/include/c++/5/bits/stl_construct.h:103 #15 0x000000000177460a in std::_Destroy<File_Namespace::MultiPage> (__first=0x7fff8cc3e3a0, __last=0x7fff8cc42498) at /usr/include/c++/5/bits/stl_construct.h:126 #16 0x0000000001772579 in std::_Destroy<File_Namespace::MultiPage, File_Namespace::MultiPage> (__first=0x7fff8cc3e3a0, __last=0x7fff8cc42498) at /usr/include/c++/5/bits/stl_construct.h:151 #17 0x0000000001770c3b in std::vector<File_Namespace::MultiPage, std::allocator<File_Namespace::MultiPage> >::~vector (this=0x7fff68819118, __in_chrg=, str=0x7ffff4600fa8 "double free or corruption (out)", action=3) at malloc.c:5006 #4 _int_free (av= , p= , have_lock=0) at malloc.c:3867 #5 0x00007ffff44f453c in __GI___libc_free (mem= ) at malloc.c:2968 #6 0x0000000001242a98 in __gnu_cxx::new_allocator ::deallocate (this=0x7fff8cc415d8, __p=0x7fff8cc42400) at /usr/include/c++/5/ext/new_allocator.h:110 #7 0x000000000123c8d1 in std::allocator_traits<std::allocator >::deallocate (__a=..., __p=0x7fff8cc42400, __n=128) at /usr/include/c++/5/bits/alloc_traits.h:517 #8 0x0000000001774582 in std::_Deque_base<int, std::allocator >::_M_deallocate_node (this=0x7fff8cc415d8, __p=0x7fff8cc42400) at /usr/include/c++/5/bits/stl_deque.h:608 #9 0x0000000001774144 in std::_Deque_base<int, std::allocator >::_M_destroy_nodes (this=0x7fff8cc415d8, __nstart=0x7fff8c6f99f8, __nfinish=0x7fff8c6f9a00) at /usr/include/c++/5/bits/stl_deque.h:742 #10 0x0000000001771ea5 in std::_Deque_base<int, std::allocator >::~_Deque_base (this=0x7fff8cc415d8, __in_chrg= ) at /usr/include/c++/5/bits/stl_deque.h:664 #11 0x0000000001770902 in std::deque<int, std::allocator >::~deque (this=0x7fff8cc415d8, __in_chrg= ) at /usr/include/c++/5/bits/stl_deque.h:1039 #12 0x000000000176fdd4 in File_Namespace::MultiPage::~MultiPage (this=0x7fff8cc41580, __in_chrg= ) at /data/github/mapd-core/DataMgr/FileMgr/Page.h:77 #13 0x000000000177813b in std::_Destroy<File_Namespace::MultiPage> (__pointer=0x7fff8cc41580) at /usr/include/c++/5/bits/stl_construct.h:93 #14 0x000000000177695f in std::_Destroy_aux ::__destroy<File_Namespace::MultiPage ) at /usr/include/c++/5/bits/stl_vector.h:424 #18 0x000000000177f326 in File_Namespace::readThreadDS::~readThreadDS (this=0x7fff688190d0, __in_chrg= ) at /data/github/mapd-core/DataMgr/FileMgr/FileBuffer.cpp:176 #19 0x000000000177d137 in File_Namespace::FileBuffer::read (this=0x7fffa4403960, dst=0x7fff8695f574 "\022\002", numBytes=683672, offset=204640612, dstBufferType=Data_Namespace::CPU_LEVEL, deviceId=0) at /data/github/mapd-core/DataMgr/FileMgr/FileBuffer.cpp:270 #20 0x000000000176e43e in File_Namespace::FileMgr::fetchBuffer (this=0x7fffcc0155d0, key=std::vector of length 4, capacity 4 = {...}, destBuffer=0x7fff54000c10, numBytes=205324284) at /data/github/mapd-core/DataMgr/FileMgr/FileMgr.cpp:589 #21 0x0000000001767365 in File_Namespace::GlobalFileMgr::fetchBuffer (this=0x39dcf90, key=std::vector of length 4, capacity 4 = {...}, destBuffer=0x7fff54000c10, numBytes=205324284) at /data/github/mapd-core/DataMgr/FileMgr/GlobalFileMgr.h:82 #22 0x0000000001790448 in Buffer_Namespace::BufferMgr::getBuffer (this=0x39e0830, key=std::vector of length 4, capacity 4 = {...}, numBytes=205324284) at /data/github/mapd-core/DataMgr/BufferMgr/BufferMgr.cpp:665 #23 0x0000000001754fea in Data_Namespace::DataMgr::getChunkBuffer (this=0x39d4970, key=std::vector of length 4, capacity 4 = {...}, memoryLevel=Data_Namespace::CPU_LEVEL, deviceId=0, numBytes=205324284) at /data/github/mapd-core/DataMgr/DataMgr.cpp:330 #24 0x000000000179edb0 in Chunk_NS::Chunk::getChunkBuffer (this=0x7fff8c019080, data_mgr=0x39d4970, key=std::vector of length 4, capacity 4 = {...}, mem_level=Data_Namespace::CPU_LEVEL, device_id=0, num_bytes=205324284, num_elems=51331071) at /data/github/mapd-core/Chunk/Chunk.cpp:88 #25 0x000000000179e86d in Chunk_NS::Chunk::getChunk (cd=0x7fffd4031e60, data_mgr=0x39d4970, key=std::vector of length 4, capacity 4 = {...}, memoryLevel=Data_Namespace::CPU_LEVEL, deviceId=0, numBytes=205324284, numElems=51331071) at /data/github/mapd-core/Chunk/Chunk.cpp:35 #26 0x000000000146815a in Executor::ExecutionDispatch::getScanColumn (this=0x7fffdffcf9e0, table_id=1, frag_id=1, col_id=9, all_tables_fragments=std::map with 1 elements = {...}, chunk_holder=..., chunk_iter_holder=..., memory_level=Data_Namespace::CPU_LEVEL, device_id=0) at /data/github/mapd-core/QueryEngine/ExecutionDispatch.cpp:544 #27 0x00000000013de31b in Executor::fetchChunks (this=0x7fffc8001870, execution_dispatch=..., ra_exe_unit=..., device_id=0, memory_level=Data_Namespace::CPU_LEVEL, all_tables_fragments=std::map with 1 elements = {...}, selected_fragments=std::vector of length 1, capacity 1 = {...}, cat=..., chunk_iterators=..., chunks=...) at /data/github/mapd-core/QueryEngine/Execute.cpp:1570
Another type of core dump so far occurred only when default thread stack size was enlarged from by default 8M to 10MB by "ulimit -s" before launching mapd_server on shell command line. It is intriguing because it is the writer thread that crashed this time. Here is the back trace:
Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007ff04da3ddc1 in _int_free (av=0x1e0000004ec, p=0x7fefd0bcddf0, have_lock=0) at malloc.c:3897 3897 malloc.c: No such file or directory. [Current thread is 1 (Thread 0x7ff012f3f700 (LWP 2502))] (gdb) bt #0 0x00007ff04da3ddc1 in _int_free (av=0x1e0000004ec, p=0x7fefd0bcddf0, have_lock=0) at malloc.c:3897 #1 0x00007ff04da4253c in __GI___libc_free (mem=
) at malloc.c:2968 #2 0x0000000001179018 in std::_Destroy<std::__cxx11::basic_string<char, std::char_traits , std::allocator > > (__pointer=0x7fefd23d58e0) at /usr/include/c++/5/bits/stl_construct.h:93 #3 0x0000000001175c93 in std::_Destroy_aux ::__destroy<std::__cxx11::basic_string<char, std::char_traits , std::allocator >> (__first=0x7fefd23d58e0, __last=0x7fefd23d5aa0) at /usr/include/c++/5/bits/stl_construct.h:103 #4 0x0000000001172361 in std::_Destroy<std::__cxx11::basic_string<char, std::char_traits , std::allocator > (__first=0x7fefd23d58e0, __last=0x7fefd23d5aa0) at /usr/include/c++/5/bits/stl_construct.h:126 #5 0x000000000116ef57 in std::_Destroy<std::__cxx11::basic_string<char, std::char_traits> , std::allocator >, std::__cxx11::basic_string<char, std::char_traits , std::allocator , char const*, size_t, size_t, size_t)::<lambda()> >(Importer_NS::<lambda()>) (func=...) at /data/github/mapd-core/Import/../Shared/measure.h:28 #10 0x00000000028c3a58 in Importer_NS::import_thread (thread_id=4, importer=0x7ff024010e00, buffer=0x7ff0198a0010 "22E1352DD960E204657DDF614570578A,DB10483B86F53654F64F91181C587550,CMT,1,N,2013-02-01 16:41:37,2013-02-01 16:50:56,1,559,1.30,-73.980255,40.765572,-73.992455,40.748867\r\n9017CA7AABAFF3485AF8C4209FC87F03"..., begin_pos=57142788, end_pos=71428485, total_size=99999879) at /data/github/mapd-core/Import/Importer.cpp:996 #11 0x00000000028ea4e0 in std::_Bind_simple<Importer_NS::ImportStatus ((int, Importer_NS::Importer, char*, unsigned long, unsigned long, unsigned long))(int, Importer_NS::Importer*, char const*, unsigned long, unsigned long, unsigned long)>::_M_invoke<0ul, 1ul, 2ul, 3ul, 4ul, 5ul>(std::_Index_tuple<0ul, 1ul, 2ul, 3ul, 4ul, 5ul>) (this=0x7ff024016648) at /usr/include/c++/5/functional:1531 #12 0x00000000028e9fe1 in std::_Bind_simple<Importer_NS::ImportStatus ((int, Importer_NS::Importer, char*, unsigned long, unsigned long, unsigned long))(int, Importer_NS::Importer*, char const*, unsigned long, unsigned long, unsigned long)>::operator()() (this=0x7ff024016648) at /usr/include/c++/5/functional:1520 #13 0x00000000028e9c6f in std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<Importer_NS::ImportStatus>, std::__future_base::_Result_base::_Deleter>, std::_Bind_simple<Importer_NS::ImportStatus ((int, Importer_NS::Importer, char*, unsigned long, unsigned long, unsigned long))(int, Importer_NS::Importer*, char const*, unsigned long, unsigned long, unsigned long)>, Importer_NS::ImportStatus>::operator()() const ( this=0x7ff012f3e270) at /usr/include/c++/5/future:1319 #14 0x00000000028e9844 in std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<Importer_NS::ImportStatus>, std::__future_base::_Result_base::_Deleter>, std::_Bind_simple<Importer_NS::ImportStatus ((int, Importer_NS::Importer, char*, unsigned long, unsigned long, unsigned long))(int, Importer_NS::Importer*, char const*, unsigned long, unsigned long, unsigned long)>, Importer_NS::ImportStatus> >::_M_invoke(std::_Any_data const&) (__functor=...) at /usr/include/c++/5/functional:1857 #15 0x00000000013caa68 in std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const (this=0x7ff012f3e270) at /usr/include/c++/5/functional:2267 #16 0x00000000013c9e2e in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) (this=0x7ff024016610, __f=0x7ff012f3e270, __did_set=0x7ff012f3e1cf) at /usr/include/c++/5/future:527 #17 0x00000000013cf396 in std::_Mem_fn_base<void (std::__future_base::_State_baseV2::)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool*), true>::operator()<std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool, void>(std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>&&, bool&&) const (this=0x7ff012f3e158, __object=0x7ff024016610) at /usr/include/c++/5/functional:600 #18 0x00000000013ceb27 in std::_Bind_simple<std::_Mem_fn<void (std::__future_base::_State_baseV2::)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool*)> (std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool)>::_M_invoke<0ul, 1ul, 2ul>(std::_Index_tuple<0ul, 1ul, 2ul>) ( this=0x7ff012f3e140) at /usr/include/c++/5/functional:1531 #19 0x00000000013cdab8 in std::_Bind_simple<std::_Mem_fn<void (std::__future_base::_State_baseV2::)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool*)> (std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool)>::operator()() (this=0x7ff012f3e140) at /usr/include/c++/5/functional:1520 #20 0x00000000013cc54d in std::__once_call_impl<std::_Bind_simple<std::_Mem_fn<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter>> > (__first=0x7fefd23d58e0, __last=0x7fefd23d5aa0) at /usr/include/c++/5/bits/stl_construct.h:151 #6 0x00000000011fe50a in std::vector<std::__cxx11::basic_string<char, std::char_traits , std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits , std::allocator > > >::_M_erase_at_end (this=0x7ff012f3db60, __pos=0x7fefd23d58e0) at /usr/include/c++/5/bits/stl_vector.h:1438 #7 0x00000000011fbea6 in std::vector<std::__cxx11::basic_string<char, std::char_traits , std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits , std::allocator > > >::clear ( this=0x7ff012f3db60) at /usr/include/c++/5/bits/stl_vector.h:1212 #8 0x00000000028c35ab in Importer_NS::<lambda()>::operator()(void) const (__closure=0x7ff012f3dc90) at /data/github/mapd-core/Import/Importer.cpp:950 #9 0x00000000028cd076 in measure<std::chrono::duration<long, std::ratio<1l, 1000l> > >::execution<Importer_NS::import_thread(int, Importer_NS::Importer
Kind of lost from these diverse core dump patterns. However, there seems a common sign that somewhere in heap was corrupted.
Hi @fleapapa, I think I may know what's going on. Let us investigate and we'll update this thread.
Thanks. One thing maybe worth to re-mention is, if i remember it correctly, most (if not all) core dumps occurred after running out of cpu buffers like this:
E0927 08:48:28.096045 18736 MapDHandler.cpp:2115] Exception: Query couldn't keep the entire working set of columns in GPU memory E0927 08:48:28.870908 18736 MapDHandler.cpp:2115] Exception: Query couldn't keep the entire working set of columns in GPU memory Segmentation fault (core dumped)
BTW, i have a dummy question: Why can't cpu 'buffers' operate like OS file buffers to fulfill queries of any size? The latter needs not be as large as a big file to read the file.
My point of the question is: Besides the 107MB cpu buffers, my VM has >5GB free memory. I don't mind that mapd_server temporarily uses it to fulfill a query that needs <5GB memory as long as mapd_server frees whatever temporary memory is used for the query.
Add another test script to use INSERT instead of LOAD. With this script, each reader aggregates a different column so as to quickly saturate cpu buffers.
Not sure if the following issue may be classified as a race condition but through further diagnosis, the member function Buffer::reserve() seems to be the culprit and should be modified like below; otherwise, when a chunk is too large to fit any cpu buffer slab, though the first call of FileMgr::fetchBuffer() triggers a "SlabTooBig" exception, later calls of FileMgr::fetchBuffer() on the same chunk will falsely succeed in calling destBuffer->reserve(chunkSize) and fall thru to read() a chunk to an insufficient-sized slab and hence corrupt the (heap) memory immediately follow the slab...
void Buffer::reserve(const size_t numBytes) {
size_t numPages_old = numPages_;
size_t numPages = (numBytes + pageSize_ - 1) / pageSize_;
// std::cout << "NumPages reserved: " << numPages << std::endl;
if (numPages > numPages_) {
pageDirtyFlags_.resize(numPages);
numPages_ = numPages;
// ppan+ When reserveBuffer() fails the first time, the member variable numPages_
// has been advanced, so later entry of Buffer::reserve() won't call reserveBuffer
// again, which will practically indicate a 'false' success of memory reservation
// and cause FileMgr::fetchBuffer() to proceed to read() and corrupt the memory
// beyond the boundary of cpu memory that was actually allocated to this buffer.
// One way to fix it is to restore old members once if any (SlabTooBig) exception
// occurs.
try
{
segIt_ = bm_->reserveBuffer(segIt_, reservedSize());
}
catch (...)
{
pageDirtyFlags_.resize(numPages_old);
numPages_ = numPages_old;
throw;
}
}
}
It seems, regardless how small or large total cpu buffer size is, when it runs out of capacity on reading big data, this issue can happen with existing code.
Alternatively, simply reordering the three statements and changing 2nd argument of the reserveBuffer() call like below will work, too :)
void Buffer::reserve(const size_t numBytes) {
#ifdef BUFFER_MUTEX
mapd_unique_lock<mapd_shared_mutex> writeLock(readWriteMutex_);
#endif
size_t numPages = (numBytes + pageSize_ - 1) / pageSize_;
// std::cout << "NumPages reserved: " << numPages << std::endl;
if (numPages > numPages_) {
segIt_ = bm_->reserveBuffer(segIt_, pageSize_ * numPages);
pageDirtyFlags_.resize(numPages);
numPages_ = numPages;
}
}