AltF02 / AltF02/x11-rs

Valgrind reports allocated mem at close

Abierto
#67 5 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Rust
Estrellas
205
Forks
69
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

I ran valgrind on some code I had written and found that some memory isn't deallocated on close. This probably doesn't matter unless you keep closing/opening the X lib a LOT, but it's nice to tidy up after ourselves ;). I used x11_dl, haven't checked x11.

Of course it might be a leak in X, or some mem that can only be allocated once, in which case it doesn't matter.

Valgrind report

```
==4119== Memcheck, a memory error detector
==4119== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==4119== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==4119== Command: ./target/debug/main
==4119==
==4119==
==4119== HEAP SUMMARY:
==4119== in use at exit: 32 bytes in 1 blocks
==4119== total heap usage: 136 allocs, 135 frees, 83,124 bytes allocated
==4119==
==4119== 32 bytes in 1 blocks are still reachable in loss record 1 of 1
==4119== at 0x4C2EF35: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4119== by 0x4E3A63B: ??? (in /usr/lib/libdl-2.26.so)
==4119== by 0x4E39F21: dlopen (in /usr/lib/libdl-2.26.so)
==4119== by 0x148E98: x11_dl::link::DynamicLibrary::open (link.rs:90)
==4119== by 0x149391: x11_dl::link::DynamicLibrary::open_multi (link.rs:119)
==4119== by 0x14A6C6: x11_dl::xlib::Xlib::open (link.rs:57)
==4119== by 0x11C1A8: main::run (main.rs:7)
==4119== by 0x11CBB6: main::main (:4)
==4119== by 0x17E6DC: __rust_maybe_catch_panic (lib.rs:99)
==4119== by 0x17811B: try<(),closure> (panicking.rs:459)
==4119== by 0x17811B: catch_unwind (panic.rs:361)
==4119== by 0x17811B: std::rt::lang_start (rt.rs:59)
==4119==
==4119== LEAK SUMMARY:
==4119== definitely lost: 0 bytes in 0 blocks
==4119== indirectly lost: 0 bytes in 0 blocks
==4119== possibly lost: 0 bytes in 0 blocks
==4119== still reachable: 32 bytes in 1 blocks
==4119== suppressed: 0 bytes in 0 blocks
==4119==
==4119== For counts of detected and suppressed errors, rerun with: -v
==4119== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
```

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.