ornladios / ADIOS

The old ADIOS 1.x code repository. Look for ADIOS2 for new repo
https://csmd.ornl.gov/adios
Other
54 stars 40 forks source link

crash with byte arrays FLEXPATH #147

Closed burlen closed 6 years ago

burlen commented 6 years ago

This is related to #146, when you avoid adois_unsigned_byte (by using adios_byte in its place), the program can run a little longer, but still crashes.

code to reproduce is here in the folder do a make issue_147

smic:/work/SENSEI/test_dataspaces$valgrind  ./put test.bp FLEXPATH 100 1 
==29117== Memcheck, a memory error detector
==29117== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==29117== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==29117== Command: ./put test.bp FLEXPATH 100 1
==29117== 
==29117== Syscall param writev(vector[...]) points to uninitialised byte(s)
==29117==    at 0x62FB35D: ??? (syscall-template.S:84)
==29117==    by 0x104B4859: libcmsockets_LTX_writev_func (cmsockets.c:1014)
==29117==    by 0x51338A: INT_CMwrite_raw_notify.part.19 (cm.c:3030)
==29117==    by 0x513F2C: INT_CMwrite_raw_notify (cm.c:3185)
==29117==    by 0x513F2C: INT_CMwrite_raw (cm.c:2954)
==29117==    by 0x513F2C: INT_CMwrite_attr (cm.c:3179)
==29117==    by 0x4EB0F5: CMwrite (cm_interface.c:576)
==29117==    by 0x4550B4: adios_flexpath_open (adios_flexpath.c:1448)
==29117==    by 0x41686C: common_adios_open (common_adios.c:239)
==29117==    by 0x414E40: adios_open (adios.c:86)
==29117==    by 0x40D7BF: main (put.cpp:116)
==29117==  Address 0xffeffe8f0 is on thread 1's stack
==29117==  in frame #3, created by INT_CMwrite_attr (cm.c:3061)
==29117== 
put 100 adios_byte
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95
96, 97, 98, 99
put 100 adios_byte
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95
96, 97, 98, 99
put 100 adios_integer
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95
96, 97, 98, 99
put 100 adios_unsigned_integer
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95
96, 97, 98, 99
put 100 adios_long
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95
96, 97, 98, 99
put 100 adios_unsigned_long
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95
96, 97, 98, 99
put 100 adios_real
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95
96, 97, 98, 99
put 100 adios_double
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95
96, 97, 98, 99
==29117== Syscall param writev(vector[...]) points to uninitialised byte(s)
==29117==    at 0x62FB35D: ??? (syscall-template.S:84)
==29117==    by 0x104B4859: libcmsockets_LTX_writev_func (cmsockets.c:1014)
==29117==    by 0x51338A: INT_CMwrite_raw_notify.part.19 (cm.c:3030)
==29117==    by 0x514C81: INT_CMwrite_raw_notify (cm.c:3239)
==29117==    by 0x514C81: INT_CMwrite_raw (cm.c:2954)
==29117==    by 0x514C81: internal_write_event (cm.c:3340)
==29117==    by 0x4F244B: do_bridge_action (evp.c:2179)
==29117==    by 0x4F244B: process_events_stone (evp.c:1706)
==29117==    by 0x4F3666: process_local_actions (evp.c:1999)
==29117==    by 0x4F56B7: INT_EVsubmit_general (evp.c:3364)
==29117==    by 0x4ECE39: EVsubmit_general (cm_interface.c:1449)
==29117==    by 0x45639D: adios_flexpath_close (adios_flexpath.c:1801)
==29117==    by 0x419034: common_adios_close (common_adios.c:1260)
==29117==    by 0x415166: adios_close (adios.c:206)
==29117==    by 0x40D892: main (put.cpp:134)
==29117==  Address 0xffefff1a0 is on thread 1's stack
==29117==  in frame #3, created by internal_write_event (cm.c:3198)
==29117== 
put finished step 0
==29117== Thread 3:
==29117== Invalid read of size 1
==29117==    at 0x512FA0: INT_CMwrite_raw_notify.part.19 (cm.c:2983)
==29117==    by 0x514C81: INT_CMwrite_raw_notify (cm.c:3239)
==29117==    by 0x514C81: INT_CMwrite_raw (cm.c:2954)
==29117==    by 0x514C81: internal_write_event (cm.c:3340)
==29117==    by 0x4F244B: do_bridge_action (evp.c:2179)
==29117==    by 0x4F244B: process_events_stone (evp.c:1706)
==29117==    by 0x4F3666: process_local_actions (evp.c:1999)
==29117==    by 0x4F54A7: internal_cm_network_submit (evp.c:3289)
==29117==    by 0x5153D6: CMact_on_data (cm.c:2402)
==29117==    by 0x516EE5: CMDataAvailable (cm.c:2054)
==29117==    by 0xF824679: socket_select.constprop.5 (cmselect.c:449)
==29117==    by 0x50E041: CMcontrol_list_wait (cm.c:674)
==29117==    by 0x50E8F9: CMpoll_forever (cm.c:170)
==29117==    by 0x50EBD8: server_thread_func (cm.c:193)
==29117==    by 0x533A619: start_thread (pthread_create.c:334)
==29117==  Address 0x706050403020100 is not stack'd, malloc'd or (recently) free'd
==29117== 
[smic:29117] *** Process received signal ***
[smic:29117] Signal: Segmentation fault (11)
[smic:29117] Signal code:  (128)
[smic:29117] Failing at address: (nil)
[smic:29117] [ 0] /lib64/libpthread.so.0(+0x10a00)[0x5343a00]
[smic:29117] [ 1] ./put[0x512fa0]
[smic:29117] [ 2] ./put[0x514c82]
[smic:29117] [ 3] ./put[0x4f244c]
[smic:29117] [ 4] ./put[0x4f3667]
[smic:29117] [ 5] ./put[0x4f54a8]
[smic:29117] [ 6] ./put[0x5153d7]
[smic:29117] [ 7] ./put[0x516ee6]
[smic:29117] [ 8] /work/apps/chaos/stable/lib/libcmselect.so(+0x167a)[0xf82467a]
[smic:29117] [ 9] ./put[0x50e042]
[smic:29117] [10] ./put[0x50e8fa]
[smic:29117] [11] ./put[0x50ebd9]
[smic:29117] [12] /lib64/libpthread.so.0(+0x761a)[0x533a61a]
[smic:29117] [13] /lib64/libc.so.6(clone+0x6d)[0x63055fd]
[smic:29117] *** End of error message ***
==29117== 
==29117== Process terminating with default action of signal 11 (SIGSEGV)
==29117==  Access not within mapped region at address 0x0
==29117==    at 0x512FA0: INT_CMwrite_raw_notify.part.19 (cm.c:2983)
==29117==    by 0x514C81: INT_CMwrite_raw_notify (cm.c:3239)
==29117==    by 0x514C81: INT_CMwrite_raw (cm.c:2954)
==29117==    by 0x514C81: internal_write_event (cm.c:3340)
==29117==    by 0x4F244B: do_bridge_action (evp.c:2179)
==29117==    by 0x4F244B: process_events_stone (evp.c:1706)
==29117==    by 0x4F3666: process_local_actions (evp.c:1999)
==29117==    by 0x4F54A7: internal_cm_network_submit (evp.c:3289)
==29117==    by 0x5153D6: CMact_on_data (cm.c:2402)
==29117==    by 0x516EE5: CMDataAvailable (cm.c:2054)
==29117==    by 0xF824679: socket_select.constprop.5 (cmselect.c:449)
==29117==    by 0x50E041: CMcontrol_list_wait (cm.c:674)
==29117==    by 0x50E8F9: CMpoll_forever (cm.c:170)
==29117==    by 0x50EBD8: server_thread_func (cm.c:193)
==29117==    by 0x533A619: start_thread (pthread_create.c:334)
==29117==  If you believe this happened as a result of a stack
==29117==  overflow in your program's main thread (unlikely but
==29117==  possible), you can try to increase the size of the
==29117==  main thread stack using the --main-stacksize= flag.
==29117==  The main thread stack size used in this run was 8388608.
==29117== 
==29117== HEAP SUMMARY:
==29117==     in use at exit: 3,232,706 bytes in 20,098 blocks
==29117==   total heap usage: 53,991 allocs, 33,893 frees, 1,042,261,949 bytes allocated
==29117== 
==29117== LEAK SUMMARY:
==29117==    definitely lost: 8,249 bytes in 101 blocks
==29117==    indirectly lost: 1,049 bytes in 27 blocks
==29117==      possibly lost: 996 bytes in 22 blocks
==29117==    still reachable: 3,149,708 bytes in 19,947 blocks
==29117==         suppressed: 72,704 bytes in 1 blocks
==29117== Rerun with --leak-check=full to see details of leaked memory
==29117== 
==29117== For counts of detected and suppressed errors, rerun with: -v
==29117== Use --track-origins=yes to see where uninitialised values come from
==29117== ERROR SUMMARY: 9 errors from 3 contexts (suppressed: 0 from 0)
Killed
burlen commented 6 years ago

@mw70 issue 3

eisenhauer commented 6 years ago

This has been fixed in HEAD as of commit 8a80363f526a0b64af72f2432c0e99e3c3a4528b.

burlen commented 6 years ago

Great work, this is fixed. Thank you!