Hi,
Okay, attached is output from test.sh that calls valgrind twice.

Duncan
/home/builder/aport/src/postfix-3.6-20210224 # ./test.sh
==107== Memcheck, a memory error detector
==107== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==107== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==107== Command: postmap -q postmas...@example.com 
redis:/home/builder/aport/src/postfix-3.6-20210224/redis.cf
==107==
==107==
==107== HEAP SUMMARY:
==107==     in use at exit: 99,913 bytes in 554 blocks
==107==   total heap usage: 1,406 allocs, 852 frees, 165,329 bytes allocated
==107==
==107== LEAK SUMMARY:
==107==    definitely lost: 0 bytes in 0 blocks
==107==    indirectly lost: 0 bytes in 0 blocks
==107==      possibly lost: 23,419 bytes in 536 blocks
==107==    still reachable: 76,494 bytes in 18 blocks
==107==         suppressed: 0 bytes in 0 blocks
==107== Rerun with --leak-check=full to see details of leaked memory
==107==
==107== For lists of detected and suppressed errors, rerun with: -s
==107== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==109== Memcheck, a memory error detector
==109== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==109== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==109== Command: postmap -q postmas...@test.com 
redis:/home/builder/aport/src/postfix-3.6-20210224/redis.cf
==109==
u...@test.com
==109==
==109== HEAP SUMMARY:
==109==     in use at exit: 104,025 bytes in 555 blocks
==109==   total heap usage: 1,409 allocs, 854 frees, 169,507 bytes allocated
==109==
==109== LEAK SUMMARY:
==109==    definitely lost: 0 bytes in 0 blocks
==109==    indirectly lost: 0 bytes in 0 blocks
==109==      possibly lost: 27,531 bytes in 537 blocks
==109==    still reachable: 76,494 bytes in 18 blocks
==109==         suppressed: 0 bytes in 0 blocks
==109== Rerun with --leak-check=full to see details of leaked memory
==109==
==109== For lists of detected and suppressed errors, rerun with: -s
==109== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
> On 11 Mar 2021, at 20:29, Wietse Venema <wie...@porcupine.org> wrote:
> 
> Dunk:
>> ?Hi,
>> I tried
>> 
>> sh postfix-env.sh valgrind --tool=memcheck src/global/mail_dict 
>> redis:$(pwd)/redis.cf read<<'EOF'
>> 
>> With redis.cf
>> 
>> host = 127.0.0.1
>> port = 6379
>> prefix = TEST:
>> 
>> With ?get foo?, or any command like postmap I get segmentation fault (see 
>> attached output)
>> 
>> 
>> So I created test.sh with:
>> 
>> #!/bin/sh
>> postfix start
>> postmap -q "postmas...@example.com" redis:$(pwd)/redis.cf
>> postmap -q "postmas...@test.com" redis:$(pwd)/redis.cf
>> postfix stop
>> 
>> Redis only has the key:
>> 
>> "TEST:postmas...@test.com" set to "u...@test.com"
>> 
>> Run with  valgrind --tool=memcheck ./test.sh
> 
> That traces the shell process that runs the test.sh script,
> not the postmap processes.
> 
> Can you do instead:
> 
> #!/bin/sh
> valgrind --tool=memcheck postmap -q "postmas...@example.com" 
> redis:$(pwd)/redis.cf
> valgrind --tool=memcheck postmap -q "postmas...@test.com" 
> redis:$(pwd)/redis.cf
> 
> One address should exist, and one should not.
> 
>    Wietse

Reply via email to