{"action":"created","issue":{"url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/1244","labels_url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/1244/labels{/name}","comments_url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/1244/comments","events_url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/1244/events","html_url":"https://github.com/magnumripper/JohnTheRipper/issues/1244","id":71972519,"number":1244,"title":"./john --show calls format's init(), but not done() -> memory leak","user":{"login":"frank-dittrich","id":2026819,"avatar_url":"https://avatars.githubusercontent.com/u/2026819?v=3","gravatar_id":"","url":"https://api.github.com/users/frank-dittrich","html_url":"https://github.com/frank-dittrich","followers_url":"https://api.github.com/users/frank-dittrich/followers","following_url":"https://api.github.com/users/frank-dittrich/following{/other_user}","gists_url":"https://api.github.com/users/frank-dittrich/gists{/gist_id}","starred_url":"https://api.github.com/users/frank-dittrich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frank-dittrich/subscriptions","organizations_url":"https://api.github.com/users/frank-dittrich/orgs","repos_url":"https://api.github.com/users/frank-dittrich/repos","events_url":"https://api.github.com/users/frank-dittrich/events{/privacy}","received_events_url":"https://api.github.com/users/frank-dittrich/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/magnumripper/JohnTheRipper/labels/core%20John%20(master%20branch)","name":"core John (master branch)","color":"000000"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-04-29T19:55:33Z","updated_at":"2015-04-30T11:52:36Z","closed_at":"2015-04-30T11:37:53Z","body":"```\r\n$ rm john.pot\r\n$ for f in `./john --list=format-details |cut -f 1`; do ./john --list=format-tests --format=$f|cut -f 3 > hashes.$f ; done\r\n```\r\n\r\n```\r\n$ for f in `./john --list=format-details --format=dynamic|cut -f 1`; do ./john --show hashes.$f --format=$f > /dev/null;done\r\n[...]\r\nAt Program Exit\r\nMemDbg_Validate level 0 checking Passed\r\n\r\n------------------------------\r\nMEMDBG: allocation information (display):\r\n   current normal alloc mem (leaks)4424904  max normal mem allocated: 4953334\r\n   current 'tiny' alloc mem (leaks)0  max  tiny  mem allocated: 2190864\r\n\r\nIndex : alloc# :   Size : File(Line)  [first 20 bytes, or size of bytes]\r\n0     : 96     :  24580 : dynamic_fmt.c(764)  ....................\r\n1     : 95     :  24580 : dynamic_fmt.c(763)  ....................\r\n2     : 94     : 1573376 : dynamic_fmt.c(762)  ....................\r\n3     : 93     : 1573376 : dynamic_fmt.c(761)  ....................\r\n4     : 92     :  98336 : dynamic_fmt.c(760)  ....................\r\n5     : 91     :  98336 : dynamic_fmt.c(759)  ....................\r\n6     : 90     :  98304 : dynamic_fmt.c(757)  ....................\r\n7     : 89     :  98368 : dynamic_fmt.c(756)  ....................\r\n8     : 88     : 393216 : dynamic_fmt.c(755)  ....................\r\n9     : 87     :  24576 : dynamic_fmt.c(754)  ....................\r\n10    : 86     :  24576 : dynamic_fmt.c(753)  ....................\r\n11    : 85     : 393216 : dynamic_fmt.c(752)  ....................\r\n12    : 84     :     32 : dynamic_fmt.c(743)  ....................\r\n13    : 83     :     32 : dynamic_fmt.c(742)  ....................\r\nAt Program Exit\r\nMemDbg_Validate level 0 checking Passed\r\n\r\n------------------------------\r\nMEMDBG: allocation information (display):\r\n   current normal alloc mem (leaks)4424904  max normal mem allocated: 4953288\r\n   current 'tiny' alloc mem (leaks)0  max  tiny  mem allocated: 2190864\r\n\r\nIndex : alloc# :   Size : File(Line)  [first 20 bytes, or size of bytes]\r\n0     : 96     :  24580 : dynamic_fmt.c(764)  ....................\r\n1     : 95     :  24580 : dynamic_fmt.c(763)  ....................\r\n2     : 94     : 1573376 : dynamic_fmt.c(762)  ....................\r\n3     : 93     : 1573376 : dynamic_fmt.c(761)  ....................\r\n4     : 92     :  98336 : dynamic_fmt.c(760)  ....................\r\n5     : 91     :  98336 : dynamic_fmt.c(759)  ....................\r\n6     : 90     :  98304 : dynamic_fmt.c(757)  ....................\r\n7     : 89     :  98368 : dynamic_fmt.c(756)  ....................\r\n8     : 88     : 393216 : dynamic_fmt.c(755)  ....................\r\n9     : 87     :  24576 : dynamic_fmt.c(754)  ....................\r\n10    : 86     :  24576 : dynamic_fmt.c(753)  ....................\r\n11    : 85     : 393216 : dynamic_fmt.c(752)  ....................\r\n12    : 84     :     32 : dynamic_fmt.c(743)  ....................\r\n13    : 83     :     32 : dynamic_fmt.c(742)  ....................\r\nAt Program Exit\r\nMemDbg_Validate level 0 checking Passed\r\n```\r\n\r\n```\r\n$ for f in `./john --list=format-details --format=h*|cut -f 1`; do ./john --show hashes.$f --format=$f > /dev/null;done\r\n------------------------------\r\nMEMDBG: allocation information (display):\r\n   current normal alloc mem (leaks)1294336  max normal mem allocated: 1822760\r\n   current 'tiny' alloc mem (leaks)0  max  tiny  mem allocated: 2190864\r\n\r\nIndex : alloc# :   Size : File(Line)  [first 20 bytes, or size of bytes]\r\n0     : 84     : 262144 : haval_fmt_plug.c(86)  ....................\r\n1     : 83     : 1032192 : haval_fmt_plug.c(84)  ....................\r\nAt Program Exit\r\nMemDbg_Validate level 0 checking Passed\r\n\r\n------------------------------\r\nMEMDBG: allocation information (display):\r\n   current normal alloc mem (leaks)1294336  max normal mem allocated: 1822792\r\n   current 'tiny' alloc mem (leaks)0  max  tiny  mem allocated: 2190864\r\n\r\nIndex : alloc# :   Size : File(Line)  [first 20 bytes, or size of bytes]\r\n0     : 84     : 262144 : haval_fmt_plug.c(86)  ....................\r\n1     : 83     : 1032192 : haval_fmt_plug.c(84)  ....................\r\nAt Program Exit\r\nMemDbg_Validate level 0 checking Passed\r\n\r\n------------------------------\r\nMEMDBG: allocation information (display):\r\n   current normal alloc mem (leaks)15753216  max normal mem allocated: 16281725\r\n   current 'tiny' alloc mem (leaks)0  max  tiny  mem allocated: 2190864\r\n\r\nIndex : alloc# :   Size : File(Line)  [first 20 bytes, or size of bytes]\r\n0     : 95     : 811008 : HDAA_fmt_plug.c(165)  ....................\r\n1     : 94     : 393216 : HDAA_fmt_plug.c(157)  ....................\r\n2     : 93     : 393216 : HDAA_fmt_plug.c(155)  ....................\r\n3     : 92     : 1572864 : HDAA_fmt_plug.c(153)  ....................\r\n4     : 91     : 1572864 : HDAA_fmt_plug.c(153)  ....................\r\n5     : 90     : 1572864 : HDAA_fmt_plug.c(153)  ....................\r\n6     : 89     : 1572864 : HDAA_fmt_plug.c(153)  ....................\r\n7     : 88     : 1572864 : HDAA_fmt_plug.c(153)  ....................\r\n8     : 87     : 1572864 : HDAA_fmt_plug.c(153)  ....................\r\n9     : 86     : 1572864 : HDAA_fmt_plug.c(153)  ....................\r\n10    : 85     : 1572864 : HDAA_fmt_plug.c(153)  ....................\r\n11    : 84     : 1572864 : HDAA_fmt_plug.c(153)  ....................\r\nAt Program Exit\r\nMemDbg_Validate level 0 checking Passed\r\n\r\n------------------------------\r\nMEMDBG: allocation information (display):\r\n   current normal alloc mem (leaks)8601600  max normal mem allocated: 9130061\r\n   current 'tiny' alloc mem (leaks)0  max  tiny  mem allocated: 2190864\r\n\r\nIndex : alloc# :   Size : File(Line)  [first 20 bytes, or size of bytes]\r\n0     : 88     : 3096576 : hmacMD5_fmt_plug.c(145)  ....................\r\n1     : 87     : 393216 : hmacMD5_fmt_plug.c(128)  ....................\r\n2     : 86     : 393216 : hmacMD5_fmt_plug.c(125)  ....................\r\n3     : 85     : 1572864 : hmacMD5_fmt_plug.c(122)  \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\r\n4     : 84     : 1572864 : hmacMD5_fmt_plug.c(121)  66666666666666666666\r\n5     : 83     : 1572864 : hmacMD5_fmt_plug.c(120)  ....................\r\nAt Program Exit\r\nMemDbg_Validate level 0 checking Passed\r\n\r\n------------------------------\r\nMEMDBG: allocation information (display):\r\n   current normal alloc mem (leaks)5865472  max normal mem allocated: 6393941\r\n   current 'tiny' alloc mem (leaks)0  max  tiny  mem allocated: 2190864\r\n\r\nIndex : alloc# :   Size : File(Line)  [first 20 bytes, or size of bytes]\r\n0     : 88     : 2064384 : hmacSHA1_fmt_plug.c(141)  ....................\r\n1     : 87     : 327680 : hmacSHA1_fmt_plug.c(124)  ....................\r\n2     : 86     : 327680 : hmacSHA1_fmt_plug.c(121)  ....................\r\n3     : 85     : 1048576 : hmacSHA1_fmt_plug.c(118)  \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\r\n4     : 84     : 1048576 : hmacSHA1_fmt_plug.c(117)  66666666666666666666\r\n5     : 83     : 1048576 : hmacSHA1_fmt_plug.c(116)  ....................\r\nAt Program Exit\r\nMemDbg_Validate level 0 checking Passed\r\n\r\n------------------------------\r\nMEMDBG: allocation information (display):\r\n   current normal alloc mem (leaks)25034752  max normal mem allocated: 25563222\r\n   current 'tiny' alloc mem (leaks)0  max  tiny  mem allocated: 2190864\r\n\r\nIndex : alloc# :   Size : File(Line)  [first 20 bytes, or size of bytes]\r\n0     : 88     : 8257536 : hmacSHA224_fmt_plug.c(136)  ....................\r\n1     : 87     : 2097152 : hmacSHA224_fmt_plug.c(119)  ....................\r\n2     : 86     : 2097152 : hmacSHA224_fmt_plug.c(116)  ....................\r\n3     : 85     : 4194304 : hmacSHA224_fmt_plug.c(113)  \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\r\n4     : 84     : 4194304 : hmacSHA224_fmt_plug.c(112)  66666666666666666666\r\n5     : 83     : 4194304 : hmacSHA224_fmt_plug.c(111)  ....................\r\nAt Program Exit\r\nMemDbg_Validate level 0 checking Passed\r\n\r\n------------------------------\r\nMEMDBG: allocation information (display):\r\n   current normal alloc mem (leaks)25034752  max normal mem allocated: 25563245\r\n   current 'tiny' alloc mem (leaks)0  max  tiny  mem allocated: 2190864\r\n\r\nIndex : alloc# :   Size : File(Line)  [first 20 bytes, or size of bytes]\r\n0     : 88     : 8257536 : hmacSHA256_fmt_plug.c(148)  ....................\r\n1     : 87     : 2097152 : hmacSHA256_fmt_plug.c(131)  ....................\r\n2     : 86     : 2097152 : hmacSHA256_fmt_plug.c(128)  ....................\r\n3     : 85     : 4194304 : hmacSHA256_fmt_plug.c(125)  \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\r\n4     : 84     : 4194304 : hmacSHA256_fmt_plug.c(124)  66666666666666666666\r\n5     : 83     : 4194304 : hmacSHA256_fmt_plug.c(123)  ....................\r\nAt Program Exit\r\nMemDbg_Validate level 0 checking Passed\r\nAt Program Exit\r\nMemDbg_Validate level 0 checking Passed\r\n\r\n------------------------------\r\nMEMDBG: allocation information (display):\r\n   current normal alloc mem (leaks)10452992  max normal mem allocated: 10981542\r\n   current 'tiny' alloc mem (leaks)0  max  tiny  mem allocated: 2190864\r\n\r\nIndex : alloc# :   Size : File(Line)  [first 20 bytes, or size of bytes]\r\n0     : 88     : 2064384 : hmacSHA512_fmt_plug.c(152)  ....................\r\n1     : 87     : 1048576 : hmacSHA512_fmt_plug.c(133)  ....................\r\n2     : 86     : 1048576 : hmacSHA512_fmt_plug.c(131)  ....................\r\n3     : 85     : 2097152 : hmacSHA512_fmt_plug.c(129)  \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\r\n4     : 84     : 2097152 : hmacSHA512_fmt_plug.c(128)  66666666666666666666\r\n5     : 83     : 2097152 : hmacSHA512_fmt_plug.c(127)  ....................\r\nAt Program Exit\r\nMemDbg_Validate level 0 checking Passed\r\n\r\n------------------------------\r\nMEMDBG: allocation information (display):\r\n   current normal alloc mem (leaks)4424904  max normal mem allocated: 4953372\r\n   current 'tiny' alloc mem (leaks)0  max  tiny  mem allocated: 2190864\r\n\r\nIndex : alloc# :   Size : File(Line)  [first 20 bytes, or size of bytes]\r\n0     : 96     :  24580 : dynamic_fmt.c(764)  ....................\r\n1     : 95     :  24580 : dynamic_fmt.c(763)  ....................\r\n2     : 94     : 1573376 : dynamic_fmt.c(762)  ....................\r\n3     : 93     : 1573376 : dynamic_fmt.c(761)  ....................\r\n4     : 92     :  98336 : dynamic_fmt.c(760)  ....................\r\n5     : 91     :  98336 : dynamic_fmt.c(759)  ....................\r\n6     : 90     :  98304 : dynamic_fmt.c(757)  ....................\r\n7     : 89     :  98368 : dynamic_fmt.c(756)  ....................\r\n8     : 88     : 393216 : dynamic_fmt.c(755)  ....................\r\n9     : 87     :  24576 : dynamic_fmt.c(754)  ....................\r\n10    : 86     :  24576 : dynamic_fmt.c(753)  ....................\r\n11    : 85     : 393216 : dynamic_fmt.c(752)  ....................\r\n12    : 84     :     32 : dynamic_fmt.c(743)  ....................\r\n13    : 83     :     32 : dynamic_fmt.c(742)  ....................\r\nAt Program Exit\r\nMemDbg_Validate level 0 checking Passed\r\n\r\n------------------------------\r\nMEMDBG: allocation information (display):\r\n   current normal alloc mem (leaks)2490368  max normal mem allocated: 3018752\r\n   current 'tiny' alloc mem (leaks)0  max  tiny  mem allocated: 2190864\r\n\r\nIndex : alloc# :   Size : File(Line)  [first 20 bytes, or size of bytes]\r\n0     : 85     : 524288 : hsrp_fmt_plug.c(98)  ....................\r\n1     : 84     : 131072 : hsrp_fmt_plug.c(96)  ....................\r\n2     : 83     : 1835008 : hsrp_fmt_plug.c(94)  ....................\r\nAt Program Exit\r\nMemDbg_Validate level 0 checking Passed\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/comments/97747684","html_url":"https://github.com/magnumripper/JohnTheRipper/issues/1244#issuecomment-97747684","issue_url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/1244","id":97747684,"user":{"login":"magnumripper","id":1268598,"avatar_url":"https://avatars.githubusercontent.com/u/1268598?v=3","gravatar_id":"","url":"https://api.github.com/users/magnumripper","html_url":"https://github.com/magnumripper","followers_url":"https://api.github.com/users/magnumripper/followers","following_url":"https://api.github.com/users/magnumripper/following{/other_user}","gists_url":"https://api.github.com/users/magnumripper/gists{/gist_id}","starred_url":"https://api.github.com/users/magnumripper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magnumripper/subscriptions","organizations_url":"https://api.github.com/users/magnumripper/orgs","repos_url":"https://api.github.com/users/magnumripper/repos","events_url":"https://api.github.com/users/magnumripper/events{/privacy}","received_events_url":"https://api.github.com/users/magnumripper/received_events","type":"User","site_admin":false},"created_at":"2015-04-30T11:52:36Z","updated_at":"2015-04-30T11:52:36Z","body":"> Most or all of these are probably using mem_alloc() in get_salt() and/or get_binary(), where it should be mem_alloc_tiny().\r\n\r\nNo it's more like the dynamic bug: They are all two-formats-in-one (eg. ripemd-128 and ripemd-160) and when their init() is called second time, the pointers from the first time leak. This is not critial at all but could easily be fixed."}}