exbotanical / ys

The Modern Web Application Framework for C

Home Page:https://exbotanical.github.io/ys

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Valgrind reported error

stricaud opened this issue · comments

Running the example/html/demo with valgrind, I am getting lots of errors which I am reporting here:

valgrind --leak-check=full ./demo
==3192293== Memcheck, a memory error detector
==3192293== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==3192293== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==3192293== Command: ./demo
==3192293== 
==3192293== Conditional jump or move depends on uninitialised value(s)
==3192293==    at 0x4860D58: ys_router_init (router.c:167)
==3192293==    by 0x1092E8: main (in /home/sebastien/git/ys/examples/html/demo)
==3192293== 
==3192293== Conditional jump or move depends on uninitialised value(s)
==3192293==    at 0x4860DCC: ys_router_init (router.c:182)
==3192293==    by 0x1092E8: main (in /home/sebastien/git/ys/examples/html/demo)
==3192293== 
==3192293== Conditional jump or move depends on uninitialised value(s)
==3192293==    at 0x4860E40: ys_router_init (router.c:199)
==3192293==    by 0x1092E8: main (in /home/sebastien/git/ys/examples/html/demo)
==3192293== 
==3192293== Invalid write of size 4
==3192293==    at 0x48658D6: array_init (array.c:42)
==3192293==    by 0x4860F30: __router_register (router.c:221)
==3192293==    by 0x109316: main (in /home/sebastien/git/ys/examples/html/demo)
==3192293==  Address 0x510d8d8 is 0 bytes after a block of size 8 alloc'd
==3192293==    at 0x48407B4: malloc (vg_replace_malloc.c:381)
==3192293==    by 0x486587A: array_init (array.c:28)
==3192293==    by 0x4860F30: __router_register (router.c:221)
==3192293==    by 0x109316: main (in /home/sebastien/git/ys/examples/html/demo)
==3192293== 
==3192293== Invalid read of size 4
==3192293==    at 0x4865AF6: array_push (array.c:93)
==3192293==    by 0x4860FCE: __router_register (router.c:231)
==3192293==    by 0x109316: main (in /home/sebastien/git/ys/examples/html/demo)
==3192293==  Address 0x510d8d8 is 0 bytes after a block of size 8 alloc'd
==3192293==    at 0x48407B4: malloc (vg_replace_malloc.c:381)
==3192293==    by 0x486587A: array_init (array.c:28)
==3192293==    by 0x4860F30: __router_register (router.c:221)
==3192293==    by 0x109316: main (in /home/sebastien/git/ys/examples/html/demo)
==3192293== 
==3192293== Invalid read of size 4
==3192293==    at 0x4865B57: array_push (array.c:102)
==3192293==    by 0x4860FCE: __router_register (router.c:231)
==3192293==    by 0x109316: main (in /home/sebastien/git/ys/examples/html/demo)
==3192293==  Address 0x510d8d8 is 0 bytes after a block of size 8 alloc'd
==3192293==    at 0x48407B4: malloc (vg_replace_malloc.c:381)
==3192293==    by 0x486587A: array_init (array.c:28)
==3192293==    by 0x4860F30: __router_register (router.c:221)
==3192293==    by 0x109316: main (in /home/sebastien/git/ys/examples/html/demo)
...

I stopped, as there is many more coming.

Thank you for submitting this. I'll set up a Valgrind CI task and fix the existing problems. Let's leave this issue open for tracking.

Resolved a fair number of these by fixing some of the deps. The work continues!