View Issue Details

IDProjectCategoryView StatusLast Update
0011203Talermerchant backendpublic2026-03-05 21:09
Reportersebasjm Assigned ToChristian Grothoff  
PrioritynormalSeveritycrashReproducibilityhave not tried
Status feedbackResolutionopen 
Summary0011203: found a crash in kyccheck
Description$ coredumpctl
TIME PID UID GID SIG COREFILE EXE SIZE
Thu 2026-03-05 10:47:19 -03 1138815 1000 1000 SIGSEGV present /install-prefix/bin/taler-merchant-kyccheck 389K


#0 __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:76
#1 0x00007ad50d66f980 in __printf_buffer (buf=buf@entry=0x7ffc75243e60, format=0x7ad50bff5fe0 "Preparing SQL statement `%s' as `%s'\n", ap=0x7ffc75243f98, mode_flags=mode_flags@entry=0)
    at ./stdio-common/vfprintf-process-arg.c:443
#2 0x00007ad50d696d7c in __vsnprintf_internal (string=<optimized out>, maxlen=<optimized out>, format=<optimized out>, args=<optimized out>, mode_flags=0) at ./libio/vsnprintf.c:96
#3 ___vsnprintf (string=<optimized out>, maxlen=<optimized out>, format=<optimized out>, args=<optimized out>) at ./libio/vsnprintf.c:103
#4 0x00007ad50d983c2b in mylog (kind=GNUNET_ERROR_TYPE_DEBUG, comp=0x7ffc752440a0 "pq-1138815", message=0x7ad50bff5fe0 "Preparing SQL statement `%s' as `%s'\n", va=0x7ffc75244088)
    at ../src/lib/util/common_logging.c:1016
#5 0x00007ad50d984399 in GNUNET_log_from_nocheck (kind=GNUNET_ERROR_TYPE_DEBUG, comp=0x7ad50bff5fdb "pq", message=0x7ad50bff5fe0 "Preparing SQL statement `%s' as `%s'\n")
    at ../src/lib/util/common_logging.c:1135
#6 0x00007ad50bfe6743 in GNUNET_PQ_prepare_once (db=0x5cb97d031220, ps=0x5cb97d03be90) at ../src/lib/pq/pq_prepare.c:50
#7 0x00007ad50bfe6ae3 in GNUNET_PQ_prepare_statements (db=0x5cb97d031220, ps=0x5cb97d03be90) at ../src/lib/pq/pq_prepare.c:120
#8 0x00007ad50bfe3d51 in GNUNET_PQ_reconnect (db=0x5cb97d031220) at ../src/lib/pq/pq_connect.c:687
#9 0x00007ad50bfe51f9 in do_scheduler_notify (cls=0x5cb97d031220) at ../src/lib/pq/pq_event.c:278
#10 0x00007ad50d9df6ba in GNUNET_SCHEDULER_do_work (sh=0x5cb97d028950) at ../src/lib/util/scheduler.c:2152
#11 0x00007ad50d9e0436 in select_loop (sh=0x5cb97d028950, context=0x7ffc752443c0) at ../src/lib/util/scheduler.c:2452
#12 0x00007ad50d9da821 in GNUNET_SCHEDULER_run (task=0x7ad50d9d3e70 <program_main>, task_cls=0x7ffc752444c0) at ../src/lib/util/scheduler.c:749
#13 0x00007ad50d9d50b4 in GNUNET_PROGRAM_run2 (pd=0x7ad50db78d20, argc=5, argv=0x7ffc75244968, binaryName=0x5cb961f4e60f "taler-merchant-kyccheck",
    binaryHelp=0x5cb961f4e5b8 "background process that checks the KYC state of our bank accounts at various exchanges", options=0x7ffc75244710, task=0x5cb961f4cfa9 <run>, task_cls=0x0,
    run_without_scheduler=0) at ../src/lib/util/program.c:388
#14 0x00007ad50d9d521f in GNUNET_PROGRAM_run (pd=0x7ad50db78d20, argc=5, argv=0x7ffc75244968, binaryName=0x5cb961f4e60f "taler-merchant-kyccheck",
    binaryHelp=0x5cb961f4e5b8 "background process that checks the KYC state of our bank accounts at various exchanges", options=0x7ffc75244710, task=0x5cb961f4cfa9 <run>, task_cls=0x0)
    at ../src/lib/util/program.c:416
#15 0x00005cb961f4d754 in main (argc=5, argv=0x7ffc75244968) at taler-merchant-kyccheck.c:1758





ERROR Failed to read from Postgres: server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
DEBUG Change in PQ event FD to -1
DEBUG New poll FD is -1
DEBUG Executing PQ command `LISTEN X81B703VNNE2G2WKX9PRY0DXT1TC6191QZBZEEGKDR8R387R7RYVG'
ERROR Failed to execute `LISTEN X81B703VNNE2G2WKX9PRY0DXT1TC6191QZBZEEGKDR8R387R7RYVG': (null)/(null)//PGRES_FATAL_ERROR/no connecti>
DEBUG Executing PQ command `LISTEN XJ40P0CFMZ0DT6SFZ70VRQ19KG1HP6AJ1Q6VCDZN4N2FGPSAG4KDG'
ERROR Failed to execute `LISTEN XJ40P0CFMZ0DT6SFZ70VRQ19KG1HP6AJ1Q6VCDZN4N2FGPSAG4KDG': (null)/(null)//PGRES_FATAL_ERROR/no connecti>
DEBUG Executing PQ command `LISTEN XW9K15VBEKGDMCMN31SKH75KVXND1GTW5MW7WME4CMPQ0X9ECWTR0'
ERROR Failed to execute `LISTEN XW9K15VBEKGDMCMN31SKH75KVXND1GTW5MW7WME4CMPQ0X9ECWTR0': (null)/(null)//PGRES_FATAL_ERROR/no connecti>
DEBUG Executing PQ command `LISTEN XDQM4Z4N0D3GX0H9JEXH70EBC2T3KY7HC0TJB0Z60D2H781RXR6AG'
ERROR Failed to execute `LISTEN XDQM4Z4N0D3GX0H9JEXH70EBC2T3KY7HC0TJB0Z60D2H781RXR6AG': (null)/(null)//PGRES_FATAL_ERROR/no connecti>
ERROR Database connection to 'postgres://%2Ftmp%2Fdatabase-link-for-local-taler:5432/merchant' failed: connection to server on socke>
DEBUG Resubscribing
DEBUG Adding task 0x5cb97d03cb40
DEBUG Change in PQ event FD to -1
DEBUG New poll FD is -1
ERROR Database connection to 'postgres://%2Ftmp%2Fdatabase-link-for-local-taler:5432/merchant' failed: connection to server on socke>
        Is the server running locally and accepting connections on that socket?
DEBUG PG poll job active
ERROR Failed to read from Postgres: connection pointer is NULL
DEBUG Change in PQ event FD to -1
DEBUG New poll FD is -1
ERROR Database connection to 'postgres://%2Ftmp%2Fdatabase-link-for-local-taler:5432/merchant' failed: connection to server on socke>
        Is the server running locally and accepting connections on that socket?
DEBUG Resubscribing
DEBUG Adding task 0x5cb97d042ce0
DEBUG Change in PQ event FD to -1
DEBUG New poll FD is -1
ERROR Database connection to 'postgres://%2Ftmp%2Fdatabase-link-for-local-taler:5432/merchant' failed: connection to server on socke>
        Is the server running locally and accepting connections on that socket?
DEBUG PG poll job active
TagsNo tags attached.

Activities

Christian Grothoff

2026-03-05 20:59

manager   ~0028005

Wow, is this reproducible? How? Can you please try it while running the kyccheck process under valgrind? The stack itself here is not so helpful...

sebasjm

2026-03-05 21:09

developer   ~0028007

i don't think the config could be a problem but just in case, here it is

[merchantdb-postgres]
CONFIG = postgres://%2Ftmp%2Fdatabase-link-for-local-taler:5432/merchant
SQL_DIR = $DATADIR/sql/

the file /tmp/database-link-for-local-taler is a soft link to the database folder, the connections to the database is using a UNIX socket

$ ls -la /tmp/database-link-for-local-taler
lrwxrwxrwx 1 sebasjm sebasjm 37 Feb 25 09:43 /tmp/database-link-for-local-taler -> /database

$ ls -la /database/.s.PGSQL.5432
srwxrwxrwx 1 sebasjm sebasjm 0 Mar 5 17:03 /database/.s.PGSQL.5432


$ valgrind /install-prefix/bin/taler-merchant-kyccheck --version
==1399457== Memcheck, a memory error detector
==1399457== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==1399457== Using Valgrind-3.25.1 and LibVEX; rerun with -h for copyright info
==1399457== Command: /install-prefix/bin/taler-merchant-kyccheck --version
==1399457==
/install-prefix/bin/taler-merchant-kyccheck v1.4.11-git-b29d3a74
==1399457==
==1399457== HEAP SUMMARY:
==1399457== in use at exit: 1,536 bytes in 15 blocks
==1399457== total heap usage: 1,439 allocs, 1,424 frees, 144,520 bytes allocated
==1399457==
==1399457== LEAK SUMMARY:
==1399457== definitely lost: 0 bytes in 0 blocks
==1399457== indirectly lost: 0 bytes in 0 blocks
==1399457== possibly lost: 0 bytes in 0 blocks
==1399457== still reachable: 1,536 bytes in 15 blocks
==1399457== suppressed: 0 bytes in 0 blocks
==1399457== Rerun with --leak-check=full to see details of leaked memory
==1399457==
==1399457== For lists of detected and suppressed errors, rerun with: -s
==1399457== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)




$ valgrind /install-prefix/bin/taler-merchant-kyccheck -c taler/data/merchant.conf
==1399121== Memcheck, a memory error detector
==1399121== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==1399121== Using Valgrind-3.25.1 and LibVEX; rerun with -h for copyright info
==1399121== Command: /install-prefix/bin/taler-merchant-kyccheck -c taler/data/merchant.conf
==1399121==
NOW
2026-03-05T17:03:05.163695-0300 taler-merchant-kyccheck-1399121 ERROR Failed to read from Postgres: server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.

2026-03-05T17:03:05.187341-0300 pq-1399121 ERROR Failed to execute `LISTEN X81B703VNNE2G2WKX9PRY0DXT1TC6191QZBZEEGKDR8R387R7RYVG': (null)/(null)//PGRES_FATAL_ERROR/no connection to the server
2026-03-05T17:03:05.187964-0300 pq-1399121 ERROR Failed to execute `LISTEN XJ40P0CFMZ0DT6SFZ70VRQ19KG1HP6AJ1Q6VCDZN4N2FGPSAG4KDG': (null)/(null)//PGRES_FATAL_ERROR/no connection to the server
2026-03-05T17:03:05.188066-0300 pq-1399121 ERROR Failed to execute `LISTEN XW9K15VBEKGDMCMN31SKH75KVXND1GTW5MW7WME4CMPQ0X9ECWTR0': (null)/(null)//PGRES_FATAL_ERROR/no connection to the server
2026-03-05T17:03:05.188145-0300 pq-1399121 ERROR Failed to execute `LISTEN XDQM4Z4N0D3GX0H9JEXH70EBC2T3KY7HC0TJB0Z60D2H781RXR6AG': (null)/(null)//PGRES_FATAL_ERROR/no connection to the server
2026-03-05T17:03:05.192564-0300 pq-1399121 ERROR Database connection to 'postgres://%2Ftmp%2Fdatabase-link-for-local-taler:5432/merchant' failed: connection to server on socket "/tmp/database-link-for-local-taler/.s.PGSQL.5432" failed: No such file or directory
    Is the server running locally and accepting connections on that socket?

2026-03-05T17:03:06.199647-0300 pq-1399121 ERROR Database connection to 'postgres://%2Ftmp%2Fdatabase-link-for-local-taler:5432/merchant' failed: connection to server on socket "/tmp/database-link-for-local-taler/.s.PGSQL.5432" failed: No such file or directory
    Is the server running locally and accepting connections on that socket?

2026-03-05T17:03:06.200812-0300 taler-merchant-kyccheck-1399121 ERROR Failed to read from Postgres: connection pointer is NULL

2026-03-05T17:03:06.203403-0300 pq-1399121 ERROR Database connection to 'postgres://%2Ftmp%2Fdatabase-link-for-local-taler:5432/merchant' failed: connection to server on socket "/tmp/database-link-for-local-taler/.s.PGSQL.5432" failed: No such file or directory
    Is the server running locally and accepting connections on that socket?

2026-03-05T17:03:07.207592-0300 pq-1399121 ERROR Database connection to 'postgres://%2Ftmp%2Fdatabase-link-for-local-taler:5432/merchant' failed: connection to server on socket "/tmp/database-link-for-local-taler/.s.PGSQL.5432" failed: No such file or directory
    Is the server running locally and accepting connections on that socket?

2026-03-05T17:03:07.208191-0300 taler-merchant-kyccheck-1399121 ERROR Failed to read from Postgres: connection pointer is NULL

2026-03-05T17:03:07.210860-0300 pq-1399121 ERROR Database connection to 'postgres://%2Ftmp%2Fdatabase-link-for-local-taler:5432/merchant' failed: connection to server on socket "/tmp/database-link-for-local-taler/.s.PGSQL.5432" failed: No such file or directory
    Is the server running locally and accepting connections on that socket?

==1399121== Invalid read of size 8
==1399121== at 0x683396C: GNUNET_PQ_prepare_once (pq_prepare.c:46)
==1399121== by 0x6833AE2: GNUNET_PQ_prepare_statements (pq_prepare.c:120)
==1399121== by 0x6830D50: GNUNET_PQ_reconnect (pq_connect.c:687)
==1399121== by 0x68321F8: do_scheduler_notify (pq_event.c:278)
==1399121== by 0x4A946B9: GNUNET_SCHEDULER_do_work (scheduler.c:2152)
==1399121== by 0x4A95435: select_loop (scheduler.c:2452)
==1399121== by 0x4A8F820: GNUNET_SCHEDULER_run (scheduler.c:749)
==1399121== by 0x4A8A0B3: GNUNET_PROGRAM_run2 (program.c:388)
==1399121== by 0x4A8A21E: GNUNET_PROGRAM_run (program.c:416)
==1399121== by 0x4007753: main (taler-merchant-kyccheck.c:1758)
==1399121== Address 0x640ea00 is 0 bytes after a block of size 48 alloc'd
==1399121== at 0x4859858: malloc (vg_replace_malloc.c:446)
==1399121== by 0x4A36716: GNUNET_xmalloc_unchecked_ (common_allocation.c:111)
==1399121== by 0x4A362FE: GNUNET_xmalloc_ (common_allocation.c:59)
==1399121== by 0x6833A12: GNUNET_PQ_prepare_statements (pq_prepare.c:104)
==1399121== by 0x67B2C45: TMH_PG_select_exchange_keys (pg_select_exchange_keys.c:54)
==1399121== by 0x40056D6: find_keys (taler-merchant-kyccheck.c:1155)
==1399121== by 0x40065BA: accept_exchanges (taler-merchant-kyccheck.c:1407)
==1399121== by 0x4A3E2C1: GNUNET_CONFIGURATION_iterate_sections (configuration.c:1569)
==1399121== by 0x40074F6: run (taler-merchant-kyccheck.c:1711)
==1399121== by 0x4A88EE8: program_main (program.c:96)
==1399121== by 0x4A946B9: GNUNET_SCHEDULER_do_work (scheduler.c:2152)
==1399121== by 0x4A95435: select_loop (scheduler.c:2452)
==1399121==

^C==1399121==
==1399121== HEAP SUMMARY:
==1399121== in use at exit: 1,592 bytes in 17 blocks
==1399121== total heap usage: 4,798 allocs, 4,781 frees, 993,220 bytes allocated
==1399121==
==1399121== LEAK SUMMARY:
==1399121== definitely lost: 0 bytes in 0 blocks
==1399121== indirectly lost: 0 bytes in 0 blocks
==1399121== possibly lost: 0 bytes in 0 blocks
==1399121== still reachable: 1,592 bytes in 17 blocks
==1399121== suppressed: 0 bytes in 0 blocks
==1399121== Rerun with --leak-check=full to see details of leaked memory
==1399121==
==1399121== For lists of detected and suppressed errors, rerun with: -s
==1399121== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

Issue History

Date Modified Username Field Change
2026-03-05 19:46 sebasjm New Issue
2026-03-05 19:46 sebasjm Status new => assigned
2026-03-05 19:46 sebasjm Assigned To => Christian Grothoff
2026-03-05 19:46 sebasjm Severity minor => crash
2026-03-05 20:59 Christian Grothoff Note Added: 0028005
2026-03-05 20:59 Christian Grothoff Assigned To Christian Grothoff => sebasjm
2026-03-05 20:59 Christian Grothoff Status assigned => feedback
2026-03-05 21:09 sebasjm Note Added: 0028007
2026-03-05 21:09 sebasjm Assigned To sebasjm => Christian Grothoff