View Issue Details

IDProjectCategoryView StatusLast Update
0003886Talerexchangepublic2021-09-02 18:14
ReporterChristian Grothoff Assigned ToChristian Grothoff  
PriorityimmediateSeveritymajorReproducibilityN/A
Status closedResolutionfixed 
Platformi7OSDebian GNU/LinuxOS Versionsqueeze
Product Versiongit (master) 
Target Version0.0Fixed in Version0.0 
Summary0003886: mintdb_keyio has some ugly allocation semantics
DescriptionRight now, denomkeys_iterate_keydir_iter allocates some pointers, passes them to a callback, in taler-mint_httpd_keystate.c we then make a memdup of the struct with the pointers and are later expected to free those. VERY ugly.
TagsNo tags attached.

Activities

Christian Grothoff

2015-07-09 22:24

manager   ~0009409

related valgrind info:

==30801==
==30801== HEAP SUMMARY:
==30801== in use at exit: 195,689 bytes in 746 blocks
==30801== total heap usage: 255,645 allocs, 254,899 frees, 9,808,861 bytes allocated
==30801==
==30801== 1,102 bytes in 2 blocks are possibly lost in loss record 105 of 116
==30801== at 0x4C2AF2E: realloc (vg_replace_malloc.c:692)
==30801== by 0x4E41FC4: ??? (in /lib/x86_64-linux-gnu/libgcrypt.so.20.0.3)
==30801== by 0x4E4280D: ??? (in /lib/x86_64-linux-gnu/libgcrypt.so.20.0.3)
==30801== by 0x4E43C65: ??? (in /lib/x86_64-linux-gnu/libgcrypt.so.20.0.3)
==30801== by 0x4E44C1E: ??? (in /lib/x86_64-linux-gnu/libgcrypt.so.20.0.3)
==30801== by 0x4E3E1AE: gcry_sexp_build (in /lib/x86_64-linux-gnu/libgcrypt.so.20.0.3)
==30801== by 0x599DFCD: GNUNET_CRYPTO_rsa_private_key_get_public (crypto_rsa.c:272)
==30801== by 0x53328B1: TALER_MINTDB_denomination_key_read (mintdb_keyio.c:171)
==30801== by 0x5332BA4: denomkeys_iterate_keydir_iter (mintdb_keyio.c:276)
==30801== by 0x59A1C5E: GNUNET_DISK_directory_scan (disk.c:1259)
==30801== by 0x5332D79: denomkeys_iterate_topdir_iter (mintdb_keyio.c:309)
==30801== by 0x59A1C5E: GNUNET_DISK_directory_scan (disk.c:1259)
==30801==
==30801== 2,698 bytes in 2 blocks are possibly lost in loss record 109 of 116
==30801== at 0x4C28C20: malloc (vg_replace_malloc.c:296)
==30801== by 0x4E40ED0: ??? (in /lib/x86_64-linux-gnu/libgcrypt.so.20.0.3)
==30801== by 0x4E41E05: ??? (in /lib/x86_64-linux-gnu/libgcrypt.so.20.0.3)
==30801== by 0x4E42C04: ??? (in /lib/x86_64-linux-gnu/libgcrypt.so.20.0.3)
==30801== by 0x4E44347: ??? (in /lib/x86_64-linux-gnu/libgcrypt.so.20.0.3)
==30801== by 0x4E45517: ??? (in /lib/x86_64-linux-gnu/libgcrypt.so.20.0.3)
==30801== by 0x4E3E0C8: gcry_sexp_new (in /lib/x86_64-linux-gnu/libgcrypt.so.20.0.3)
==30801== by 0x599DD27: GNUNET_CRYPTO_rsa_private_key_decode (crypto_rsa.c:227)
==30801== by 0x5332711: TALER_MINTDB_denomination_key_read (mintdb_keyio.c:161)
==30801== by 0x5332BA4: denomkeys_iterate_keydir_iter (mintdb_keyio.c:276)
==30801== by 0x59A1C5E: GNUNET_DISK_directory_scan (disk.c:1259)
==30801== by 0x5332D79: denomkeys_iterate_topdir_iter (mintdb_keyio.c:309)
==30801==
==30801== 40,002 (896 direct, 39,106 indirect) bytes in 112 blocks are definitely lost in loss record 114 of 116
==30801== at 0x4C28C20: malloc (vg_replace_malloc.c:296)
==30801== by 0x597C380: GNUNET_xmalloc_unchecked_ (common_allocation.c:154)
==30801== by 0x597BF0E: GNUNET_xmalloc_ (common_allocation.c:75)
==30801== by 0x599DFFE: GNUNET_CRYPTO_rsa_private_key_get_public (crypto_rsa.c:279)
==30801== by 0x53328B1: TALER_MINTDB_denomination_key_read (mintdb_keyio.c:171)
==30801== by 0x5332BA4: denomkeys_iterate_keydir_iter (mintdb_keyio.c:276)
==30801== by 0x59A1C5E: GNUNET_DISK_directory_scan (disk.c:1259)
==30801== by 0x5332D79: denomkeys_iterate_topdir_iter (mintdb_keyio.c:309)
==30801== by 0x59A1C5E: GNUNET_DISK_directory_scan (disk.c:1259)
==30801== by 0x5332E2C: TALER_MINTDB_denomination_keys_iterate (mintdb_keyio.c:344)
==30801== by 0x406F29: TMH_KS_acquire (taler-mint-httpd_keystate.c:519)
==30801== by 0x408099: TMH_KS_loop (taler-mint-httpd_keystate.c:745)
==30801==
==30801== 100,697 (896 direct, 99,801 indirect) bytes in 112 blocks are definitely lost in loss record 116 of 116
==30801== at 0x4C28C20: malloc (vg_replace_malloc.c:296)
==30801== by 0x597C380: GNUNET_xmalloc_unchecked_ (common_allocation.c:154)
==30801== by 0x597BF0E: GNUNET_xmalloc_ (common_allocation.c:75)
==30801== by 0x599DD0A: GNUNET_CRYPTO_rsa_private_key_decode (crypto_rsa.c:225)
==30801== by 0x5332711: TALER_MINTDB_denomination_key_read (mintdb_keyio.c:161)
==30801== by 0x5332BA4: denomkeys_iterate_keydir_iter (mintdb_keyio.c:276)
==30801== by 0x59A1C5E: GNUNET_DISK_directory_scan (disk.c:1259)
==30801== by 0x5332D79: denomkeys_iterate_topdir_iter (mintdb_keyio.c:309)
==30801== by 0x59A1C5E: GNUNET_DISK_directory_scan (disk.c:1259)
==30801== by 0x5332E2C: TALER_MINTDB_denomination_keys_iterate (mintdb_keyio.c:344)
==30801== by 0x406F29: TMH_KS_acquire (taler-mint-httpd_keystate.c:519)
==30801== by 0x408099: TMH_KS_loop (taler-mint-httpd_keystate.c:745)
==30801==

Christian Grothoff

2015-07-11 18:25

manager   ~0009418

Fixed in 22f022e..ee7e690

Christian Grothoff

2021-09-02 18:14

manager   ~0018321

Fix committed to master branch.

Related Changesets

exchange: master ee7e690b

2015-07-11 20:25

Christian Grothoff


Details Diff
fix 0003886 Affected Issues
0003886
mod - src/mint/taler-mint-httpd_keystate.c Diff File
mod - src/mintdb/mintdb_keyio.c Diff File

Issue History

Date Modified Username Field Change
2015-07-09 22:09 Christian Grothoff New Issue
2015-07-09 22:24 Christian Grothoff Note Added: 0009409
2015-07-09 22:24 Christian Grothoff Assigned To => Christian Grothoff
2015-07-09 22:24 Christian Grothoff Status new => assigned
2015-07-09 22:31 Christian Grothoff Priority urgent => immediate
2015-07-11 18:25 Christian Grothoff Note Added: 0009418
2015-07-11 18:25 Christian Grothoff Status assigned => resolved
2015-07-11 18:25 Christian Grothoff Fixed in Version => 0.0
2015-07-11 18:25 Christian Grothoff Resolution open => fixed
2015-07-11 19:44 Christian Grothoff Status resolved => closed
2016-02-18 15:43 Christian Grothoff Category mint => exchange
2021-09-02 18:14 Christian Grothoff Changeset attached => Taler-exchange master ee7e690b
2021-09-02 18:14 Christian Grothoff Note Added: 0018321