Spec proposal
Ali Fardan
raiz at stellarbound.space
Fri Oct 23 07:03:53 BST 2020
On 2020-10-23 01:01, Sean Conner wrote:
> I also ran it under valgrind [1] and found a leak in the happy path:
>
> [spc]lucy:/tmp/libgemtext>valgrind --show-reachable=yes
> --leak-check=full ./test </tmp/text.gemini >/tmp/t.gmi
> ==26859== Memcheck, a memory error detector.
> ==26859== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et
> al.
> ==26859== Using LibVEX rev 1575, a library for dynamic binary
> translation.
> ==26859== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.
> ==26859== Using valgrind-3.1.1, a dynamic binary instrumentation
> framework.
> ==26859== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et
> al.
> ==26859== For more details, rerun with: -v
> ==26859==
> ==26859== Conditional jump or move depends on uninitialised value(s)
> ==26859== at 0x804A2C1: strlcat (strlcat.c:38)
> ==26859== by 0x8049C7E: _line_append (encode.c:198)
> ==26859== by 0x8049EF5: gemtext_encode (encode.c:263)
> ==26859== by 0x804A182: gemtext_encode_fd (encode.c:339)
> ==26859== by 0x804A1FB: gemtext_encode_file (encode.c:359)
> ==26859== by 0x804867A: main (test.c:15)
> ==26859==
> ==26859== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from
> 1)
> ==26859== malloc/free: in use at exit: 7,200 bytes in 1 blocks.
> ==26859== malloc/free: 86 allocs, 85 frees, 84,247 bytes allocated.
> ==26859== For counts of detected errors, rerun with: -v
> ==26859== searching for pointers to 1 not-freed blocks.
> ==26859== checked 55,588 bytes.
> ==26859==
> ==26859==
> ==26859== 7,200 bytes in 1 blocks are possibly lost in loss record 1 of
> 1
> ==26859== at 0x400579F: realloc (vg_replace_malloc.c:306)
> ==26859== by 0x8049C56: _line_append (encode.c:194)
> ==26859== by 0x8049D5D: gemtext_encode (encode.c:224)
> ==26859== by 0x804A182: gemtext_encode_fd (encode.c:339)
> ==26859== by 0x804A1FB: gemtext_encode_file (encode.c:359)
> ==26859== by 0x804867A: main (test.c:15)
> ==26859==
> ==26859== LEAK SUMMARY:
> ==26859== definitely lost: 0 bytes in 0 blocks.
> ==26859== possibly lost: 7,200 bytes in 1 blocks.
> ==26859== still reachable: 0 bytes in 0 blocks.
> ==26859== suppressed: 0 bytes in 0 blocks.
Leak is fixed, thank you. I missed that.
https://git.tilde.institute/raiz/libgemtext/commit/?id=2024b2562ad83a04fbfb6699ca8dc4b877a676e4
More information about the Gemini
mailing list