orangeduck / tgc

A Tiny Garbage Collector for C
Other
968 stars 64 forks source link

fix valgrind : Conditional jump or move depends on uninitialised #21

Closed ClaudioDaffra closed 3 years ago

ClaudioDaffra commented 3 years ago

fix valgrind : Conditional jump or move depends on uninitialised

claudio@xubuntu20vm:~/tgc$ valgrind ./x
==3675== Memcheck, a memory error detector
==3675== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==3675== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==3675== Command: ./x
==3675== 
==3675== 
==3675== HEAP SUMMARY:
==3675==     in use at exit: 0 bytes in 0 blocks
==3675==   total heap usage: 4 allocs, 4 frees, 1,304 bytes allocated
==3675== 
==3675== All heap blocks were freed -- no leaks are possible
==3675== 
==3675== For lists of detected and suppressed errors, rerun with: -s
==3675== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
orangeduck commented 3 years ago

This may fix the valgrind errors but it stops the GC from scanning the stack and therefore working. These errors are actually okay though - it scans the stack safely but there is no way to avoid it seeing the uninitialized values. See "Uninitialised Values" on this page http://libcello.org/learn/garbage-collection

ClaudioDaffra commented 3 years ago

So there Is no other way can you close.

orangeduck commented 3 years ago

I can close it but I can't merge it because it breaks the garbage collector.