rainwoodman / vast

vala and scientific numerical computation
11 stars 1 forks source link

valgrind error in to_string. #35

Open rainwoodman opened 7 years ago

rainwoodman commented 7 years ago
valgrind tests/vast-test
==8169== Memcheck, a memory error detector
==8169== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==8169== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==8169== Command: tests/vast-test
==8169== 
/array: OK
/array/zeroed: OK
/array/fill: OK
/array/scalar_like: OK
/array/gobject_construction: OK
/array/iterator: OK
/array/to_string: ==8169== Invalid write of size 8
==8169==    at 0x4C303BB: memcpy@@GLIBC_2.14 (vg_replace_strmem.c:1018)
==8169==    by 0x4E3EC46: _vast_array_value_to_memory (array.c:1342)
==8169==    by 0x4E3D103: vast_array_set_value (array.c:531)
==8169==    by 0x404B03: __lambda10_ (vast-test.c:1122)
==8169==    by 0x406440: ___lambda10__gtest_func (vast-test.c:1435)
==8169==    by 0x50B9940: ??? (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x50B9B0E: ??? (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x50B9D1D: g_test_run_suite (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x50B9D40: g_test_run (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x40F887: _vala_main (vast-test.c:4226)
==8169==    by 0x40F8B5: main (vast-test.c:4236)
==8169==  Address 0x6e830e8 is 0 bytes after a block of size 8 alloc'd
==8169==    at 0x4C2BBAD: malloc (vg_replace_malloc.c:299)
==8169==    by 0x5099E18: g_malloc (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x50B2897: g_memdup (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x506FB46: g_bytes_new (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x4E3FB84: vast_array_constructor (array.c:1760)
==8169==    by 0x536D4C8: ??? (in /usr/lib64/libgobject-2.0.so.0.4800.2)
==8169==    by 0x536F5AD: g_object_new_valist (in /usr/lib64/libgobject-2.0.so.0.4800.2)
==8169==    by 0x536F850: g_object_new (in /usr/lib64/libgobject-2.0.so.0.4800.2)
==8169==    by 0x4E3C900: vast_array_construct (array.c:306)
==8169==    by 0x4E3C95F: vast_array_new (array.c:312)
==8169==    by 0x404A54: __lambda10_ (vast-test.c:1111)
==8169==    by 0x406440: ___lambda10__gtest_func (vast-test.c:1435)
==8169== 
OK
/array/reshape: OK
/array/compact: OK
/array/string: ==8169== Invalid write of size 1
==8169==    at 0x4E3EB6B: _vast_array_value_to_memory (array.c:1323)
==8169==    by 0x4E3D103: vast_array_set_value (array.c:531)
==8169==    by 0x406B5A: __lambda13_ (vast-test.c:1621)
==8169==    by 0x406F8C: ___lambda13__gtest_func (vast-test.c:1670)
==8169==    by 0x50B9940: ??? (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x50B9B0E: ??? (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x50B9D1D: g_test_run_suite (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x50B9D40: g_test_run (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x40F887: _vala_main (vast-test.c:4226)
==8169==    by 0x40F8B5: main (vast-test.c:4236)
==8169==  Address 0x6ec3059 is 4 bytes after a block of size 5 alloc'd
==8169==    at 0x4C2BBAD: malloc (vg_replace_malloc.c:299)
==8169==    by 0x5099E18: g_malloc (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x50B285E: g_strdup (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x4E3EB09: _vast_array_value_to_memory (array.c:1316)
==8169==    by 0x4E3D103: vast_array_set_value (array.c:531)
==8169==    by 0x406B5A: __lambda13_ (vast-test.c:1621)
==8169==    by 0x406F8C: ___lambda13__gtest_func (vast-test.c:1670)
==8169==    by 0x50B9940: ??? (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x50B9B0E: ??? (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x50B9D1D: g_test_run_suite (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x50B9D40: g_test_run (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x40F887: _vala_main (vast-test.c:4226)
==8169== 
==8169== Invalid read of size 1
==8169==    at 0x4E3EB7D: _vast_array_value_to_memory (array.c:1324)
==8169==    by 0x4E3D103: vast_array_set_value (array.c:531)
==8169==    by 0x406B5A: __lambda13_ (vast-test.c:1621)
==8169==    by 0x406F8C: ___lambda13__gtest_func (vast-test.c:1670)
==8169==    by 0x50B9940: ??? (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x50B9B0E: ??? (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x50B9D1D: g_test_run_suite (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x50B9D40: g_test_run (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x40F887: _vala_main (vast-test.c:4226)
==8169==    by 0x40F8B5: main (vast-test.c:4236)
==8169==  Address 0x6ec3059 is 4 bytes after a block of size 5 alloc'd
==8169==    at 0x4C2BBAD: malloc (vg_replace_malloc.c:299)
==8169==    by 0x5099E18: g_malloc (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x50B285E: g_strdup (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x4E3EB09: _vast_array_value_to_memory (array.c:1316)
==8169==    by 0x4E3D103: vast_array_set_value (array.c:531)
==8169==    by 0x406B5A: __lambda13_ (vast-test.c:1621)
==8169==    by 0x406F8C: ___lambda13__gtest_func (vast-test.c:1670)
==8169==    by 0x50B9940: ??? (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x50B9B0E: ??? (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x50B9D1D: g_test_run_suite (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x50B9D40: g_test_run (in /usr/lib64/libglib-2.0.so.0.4800.2)
==8169==    by 0x40F887: _vala_main (vast-test.c:4226)
arteymix commented 7 years ago

I'll investigate this bug. There's some other buggy case with GValue copying for boxed types #31

arteymix commented 7 years ago

By the way, you can run ninja test-valgrind to run the test suite with Valgrind.