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

pl_query memory issue #672

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

pl_query memory issue #672

guregu opened this issue Feb 18, 2025 · 1 comment

Comments

@guregu
Copy link
Contributor

guregu commented Feb 18, 2025

Currently pl_query will explode with some memory issues. You can switch over to it in tpl.c and punch anything in to see.
I've found that keeping the parser around for the lifetime of the query seems to help, but I'm not sure if this is the proper solution.
Diff here: main...guregu:trealla:pl_subquery-fix

Valgrind output

$ valgrind --leak-check=full ./tpl 
==2482== Memcheck, a memory error detector
==2482== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==2482== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==2482== Command: ./tpl
==2482== 
?- write(hello).
hello==2482== Invalid read of size 4
==2482==    at 0x291280: query_redo (toplevel.c:326)
==2482==    by 0x27DF07: pl_redo (prolog.c:178)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6e19d0c is 69,292 bytes inside a block of size 73,464 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B23B: query_destroy (query.c:1962)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B29B: query_create (query.c:1968)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid read of size 4
==2482==    at 0x28AFA8: query_destroy (query.c:1901)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6e1ad4c is 73,452 bytes inside a block of size 73,464 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B23B: query_destroy (query.c:1962)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B29B: query_create (query.c:1968)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid write of size 4
==2482==    at 0x28AFB0: query_destroy (query.c:1901)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6e1ad4c is 73,452 bytes inside a block of size 73,464 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B23B: query_destroy (query.c:1962)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B29B: query_create (query.c:1968)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid read of size 8
==2482==    at 0x28AFB8: query_destroy (query.c:1903)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6e09ee0 is 4,224 bytes inside a block of size 73,464 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B23B: query_destroy (query.c:1962)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B29B: query_create (query.c:1968)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid read of size 8
==2482==    at 0x28B058: query_destroy (query.c:1915)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6e08ea8 is 72 bytes inside a block of size 73,464 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B23B: query_destroy (query.c:1962)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B29B: query_create (query.c:1968)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid read of size 4
==2482==    at 0x28B0A8: query_destroy (query.c:1917)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6e09ff4 is 4,500 bytes inside a block of size 73,464 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B23B: query_destroy (query.c:1962)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B29B: query_create (query.c:1968)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid read of size 8
==2482==    at 0x28B0CC: query_destroy (query.c:1923)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6e08ef0 is 144 bytes inside a block of size 73,464 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B23B: query_destroy (query.c:1962)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B29B: query_create (query.c:1968)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid read of size 4
==2482==    at 0x28B128: query_destroy (query.c:1924)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6e1a928 is 72,392 bytes inside a block of size 73,464 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B23B: query_destroy (query.c:1962)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B29B: query_create (query.c:1968)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid read of size 8
==2482==    at 0x28B144: query_destroy (query.c:1927)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6e08ef0 is 144 bytes inside a block of size 73,464 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B23B: query_destroy (query.c:1962)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B29B: query_create (query.c:1968)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid read of size 8
==2482==    at 0x28B194: query_destroy (query.c:1930)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6e09ef0 is 4,240 bytes inside a block of size 73,464 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B23B: query_destroy (query.c:1962)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B29B: query_create (query.c:1968)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid read of size 8
==2482==    at 0x298FEC: MP_DIGITS (imath.h:66)
==2482==    by 0x299A17: mp_int_clear (imath.c:466)
==2482==    by 0x28B1AF: query_destroy (query.c:1953)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6e09f40 is 4,320 bytes inside a block of size 73,464 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B23B: query_destroy (query.c:1962)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B29B: query_create (query.c:1968)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid read of size 8
==2482==    at 0x298FEC: MP_DIGITS (imath.h:66)
==2482==    by 0x299A17: mp_int_clear (imath.c:466)
==2482==    by 0x2A29D7: mp_rat_clear (imrat.c:137)
==2482==    by 0x28B1BF: query_destroy (query.c:1954)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6e09f60 is 4,352 bytes inside a block of size 73,464 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B23B: query_destroy (query.c:1962)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B29B: query_create (query.c:1968)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid read of size 8
==2482==    at 0x298FEC: MP_DIGITS (imath.h:66)
==2482==    by 0x299A17: mp_int_clear (imath.c:466)
==2482==    by 0x2A29E3: mp_rat_clear (imrat.c:138)
==2482==    by 0x28B1BF: query_destroy (query.c:1954)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6e09f80 is 4,384 bytes inside a block of size 73,464 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B23B: query_destroy (query.c:1962)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B29B: query_create (query.c:1968)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid read of size 8
==2482==    at 0x239320: list_pop_front (list.c:33)
==2482==    by 0x28AF4B: query_purge_dirty_list (query.c:1885)
==2482==    by 0x28B1C7: query_destroy (query.c:1955)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6e09f08 is 4,264 bytes inside a block of size 73,464 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B23B: query_destroy (query.c:1962)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B29B: query_create (query.c:1968)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid read of size 8
==2482==    at 0x28B1CC: query_destroy (query.c:1956)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6e08eb8 is 88 bytes inside a block of size 73,464 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B23B: query_destroy (query.c:1962)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B29B: query_create (query.c:1968)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid free() / delete / delete[] / realloc()
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B1D3: query_destroy (query.c:1956)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6b61280 is 0 bytes inside a block of size 16,000 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B1D3: query_destroy (query.c:1956)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B5B7: query_create (query.c:1996)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid read of size 8
==2482==    at 0x28B1D8: query_destroy (query.c:1957)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6e08eb0 is 80 bytes inside a block of size 73,464 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B23B: query_destroy (query.c:1962)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B29B: query_create (query.c:1968)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid free() / delete / delete[] / realloc()
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B1DF: query_destroy (query.c:1957)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6b0da30 is 0 bytes inside a block of size 16,000 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B1DF: query_destroy (query.c:1957)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B517: query_create (query.c:1994)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid read of size 8
==2482==    at 0x28B1E4: query_destroy (query.c:1958)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6e08ea8 is 72 bytes inside a block of size 73,464 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B23B: query_destroy (query.c:1962)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B29B: query_create (query.c:1968)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid free() / delete / delete[] / realloc()
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B1EB: query_destroy (query.c:1958)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6a0f4a0 is 0 bytes inside a block of size 32,000 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B1EB: query_destroy (query.c:1958)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B567: query_create (query.c:1995)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid read of size 8
==2482==    at 0x28B1F0: query_destroy (query.c:1959)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6e08ea0 is 64 bytes inside a block of size 73,464 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B23B: query_destroy (query.c:1962)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B29B: query_create (query.c:1968)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid free() / delete / delete[] / realloc()
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B1F7: query_destroy (query.c:1959)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x62807b0 is 0 bytes inside a block of size 6,400 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B1F7: query_destroy (query.c:1959)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B4C7: query_create (query.c:1993)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid read of size 8
==2482==    at 0x28B1FC: query_destroy (query.c:1960)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6e08ec0 is 96 bytes inside a block of size 73,464 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B23B: query_destroy (query.c:1962)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B29B: query_create (query.c:1968)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid free() / delete / delete[] / realloc()
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B203: query_destroy (query.c:1960)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6c43310 is 0 bytes inside a block of size 2,400 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B203: query_destroy (query.c:1960)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x48850E8: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x235553: init_tmp_heap (heap.c:63)
==2482==    by 0x291473: dump_vars (toplevel.c:362)
==2482==    by 0x28ABD7: start (query.c:1770)
==2482==    by 0x28AEC3: execute (query.c:1877)
==2482==    by 0x260293: run (parser.c:4167)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid read of size 8
==2482==    at 0x28B210: query_destroy (query.c:1961)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6e08e90 is 48 bytes inside a block of size 73,464 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B23B: query_destroy (query.c:1962)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B29B: query_create (query.c:1968)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
==2482== Invalid free() / delete / delete[] / realloc()
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B23B: query_destroy (query.c:1962)
==2482==    by 0x27DF23: pl_redo (prolog.c:181)
==2482==    by 0x11902F: main (tpl.c:384)
==2482==  Address 0x6e08e60 is 0 bytes inside a block of size 73,464 free'd
==2482==    at 0x4887B60: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B23B: query_destroy (query.c:1962)
==2482==    by 0x2603DB: run (parser.c:4180)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482==  Block was alloc'd at
==2482==    at 0x4889FB4: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2482==    by 0x28B29B: query_create (query.c:1968)
==2482==    by 0x2601CB: run (parser.c:4155)
==2482==    by 0x27DE7B: pl_query (prolog.c:164)
==2482==    by 0x119027: main (tpl.c:381)
==2482== 
   true.
infradig added a commit that referenced this issue Feb 18, 2025
@guregu
Copy link
Contributor Author

guregu commented Feb 18, 2025

Thanks, don't know how I missed that, haha

@guregu guregu closed this as completed Feb 18, 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