yigit433/jsonparser

Known Errors

Opened this issue · 0 comments

  1. Memory errors after adding number reads.

Used Command

valgrind --leak-check=full -s ./jsonparser 

Result

==2258== Memcheck, a memory error detector
==2258== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==2258== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==2258== Command: ./jsonparser
==2258== 
#1 Starting the reading test..
==2258== Invalid write of size 1
==2258==    at 0x109B2A: read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x1094FA: test_read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x109444: main (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==  Address 0x4b74bf3 is 1 bytes after a block of size 2 alloc'd
==2258==    at 0x484DCD3: realloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==2258==    by 0x109AED: read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x1094FA: test_read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x109444: main (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258== 
==2258== Invalid read of size 1
==2258==    at 0x484ED24: strlen (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==2258==    by 0x109B80: read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x1094FA: test_read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x109444: main (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==  Address 0x4b74bf2 is 0 bytes after a block of size 2 alloc'd
==2258==    at 0x484DCD3: realloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==2258==    by 0x109AED: read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x1094FA: test_read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x109444: main (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258== 
==2258== Invalid read of size 1
==2258==    at 0x484ED24: strlen (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==2258==    by 0x10927B: custom_atof (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x109BB3: read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x1094FA: test_read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x109444: main (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==  Address 0x4b74bf2 is 0 bytes after a block of size 2 alloc'd
==2258==    at 0x484DCD3: realloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==2258==    by 0x109AED: read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x1094FA: test_read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x109444: main (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258== 
name: Marie Curie
country: Poland
age: 67.000000
✓ Read test was passed successfully.
==2258== 
==2258== HEAP SUMMARY:
==2258==     in use at exit: 0 bytes in 0 blocks
==2258==   total heap usage: 42 allocs, 42 frees, 4,219 bytes allocated
==2258==
==2258== All heap blocks were freed -- no leaks are possible
==2258==
==2258== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)
==2258==
==2258== 1 errors in context 1 of 3:
==2258== Invalid read of size 1
==2258==    at 0x484ED24: strlen (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==2258==    by 0x10927B: custom_atof (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x109BB3: read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x1094FA: test_read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x109444: main (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==  Address 0x4b74bf2 is 0 bytes after a block of size 2 alloc'd
==2258==    at 0x484DCD3: realloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==2258==    by 0x109AED: read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x1094FA: test_read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x109444: main (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==
==2258==
==2258== 1 errors in context 2 of 3:
==2258== Invalid read of size 1
==2258==    at 0x484ED24: strlen (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==2258==    by 0x109B80: read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x1094FA: test_read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x109444: main (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==  Address 0x4b74bf2 is 0 bytes after a block of size 2 alloc'd
==2258==    at 0x484DCD3: realloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==2258==    by 0x109AED: read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x1094FA: test_read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x109444: main (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==
==2258==
==2258== 1 errors in context 3 of 3:
==2258== Invalid write of size 1
==2258==    at 0x109B2A: read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x1094FA: test_read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x109444: main (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==  Address 0x4b74bf3 is 1 bytes after a block of size 2 alloc'd
==2258==    at 0x484DCD3: realloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==2258==    by 0x109AED: read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x1094FA: test_read (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==    by 0x109444: main (in /mnt/c/Users/Yiğit/Desktop/jsonparser/jsonparser)
==2258==
==2258== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)