Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String leak #670

Closed
guregu opened this issue Feb 14, 2025 · 1 comment
Closed

String leak #670

guregu opened this issue Feb 14, 2025 · 1 comment

Comments

@guregu
Copy link
Contributor

guregu commented Feb 14, 2025

Short example this time

hello :-
	atom_chars('hellloooooo world', Cs),
	something_else(Cs).

something_else(_).
==10060== Memcheck, a memory error detector
==10060== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==10060== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==10060== Command: ./tpl -f leak2
==10060== 
?- hello.
   true.
?- halt.
==10060== 
==10060== HEAP SUMMARY:
==10060==     in use at exit: 235,287 bytes in 237 blocks
==10060==   total heap usage: 14,115 allocs, 13,878 frees, 84,034,474 bytes allocated
==10060== 
==10060== 34 bytes in 1 blocks are definitely lost in loss record 18 of 77
==10060==    at 0x48850E8: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==10060==    by 0x24C6E7: make_string_internal (parser.c:122)
==10060==    by 0x24C947: make_stringn (parser.c:166)
==10060==    by 0x182D2F: bif_iso_atom_chars_2 (bif_predicates.c:352)
==10060==    by 0x28D3BB: start (query.c:1662)
==10060==    by 0x28DDA7: execute (query.c:1863)
==10060==    by 0x264277: run (parser.c:4167)
==10060==    by 0x280D2B: pl_eval (prolog.c:148)
==10060==    by 0x11901F: main (tpl.c:378)
==10060== 
==10060== LEAK SUMMARY:
==10060==    definitely lost: 34 bytes in 1 blocks
==10060==    indirectly lost: 0 bytes in 0 blocks
==10060==      possibly lost: 0 bytes in 0 blocks
==10060==    still reachable: 235,253 bytes in 236 blocks
==10060==         suppressed: 0 bytes in 0 blocks
==10060== Reachable blocks (those to which a pointer was found) are not shown.
==10060== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==10060== 
==10060== For lists of detected and suppressed errors, rerun with: -s
==10060== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

$ ./tpl --version
Trealla Prolog (c) Infradig 2020-2024, v2.63.36
infradig added a commit that referenced this issue Feb 14, 2025
infradig added a commit that referenced this issue Feb 14, 2025
infradig added a commit that referenced this issue Feb 14, 2025
@guregu
Copy link
Contributor Author

guregu commented Feb 15, 2025

Thanks!

@guregu guregu closed this as completed Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant