{"action":"created","issue":{"url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/1043","labels_url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/1043/labels{/name}","comments_url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/1043/comments","events_url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/1043/events","html_url":"https://github.com/magnumripper/JohnTheRipper/issues/1043","id":56629201,"number":1043,"title":"-fork may be borking .pot file (and other FILE io) on jumbo.","user":{"login":"jfoug","id":1270024,"avatar_url":"https://avatars.githubusercontent.com/u/1270024?v=3","gravatar_id":"","url":"https://api.github.com/users/jfoug","html_url":"https://github.com/jfoug","followers_url":"https://api.github.com/users/jfoug/followers","following_url":"https://api.github.com/users/jfoug/following{/other_user}","gists_url":"https://api.github.com/users/jfoug/gists{/gist_id}","starred_url":"https://api.github.com/users/jfoug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfoug/subscriptions","organizations_url":"https://api.github.com/users/jfoug/orgs","repos_url":"https://api.github.com/users/jfoug/repos","events_url":"https://api.github.com/users/jfoug/events{/privacy}","received_events_url":"https://api.github.com/users/jfoug/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/magnumripper/JohnTheRipper/labels/bug","name":"bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-02-05T05:28:08Z","updated_at":"2015-02-05T07:12:25Z","closed_at":null,"body":"Issue found with TS.  Started as a stdout only problem, but appears to be .pot file being truncated when -fork is being used.\r\n\r\na fflush() was needed for the stdout problem. That may be the issue needed on all FILE io when in fork mode.  Time will tell.\r\n\r\nThis is an example showing the symptom:\r\n\r\n```\r\n$ ./jtrts.pl -b=/JtR/bleed/run -passthru=-fork=2\r\n-------------------------------------------------------------------------------\r\n- JtR-TestSuite (jtrts). Version 1.13, Dec 21, 2014.  By, Jim Fougeron & others\r\n- Testing:  John the Ripper password cracker, version 1.8.0.2-jumbo-1-bleeding_omp_memdbg_asan [linux-gnu 64-bit SSE4.1-autoconf]\r\n--------------------------------------------------------------------------------\r\n\r\nJohn Jumbo build detected.\r\n\r\nform=dynamic_0                    guesses: 1502 0:00:00:00 DONE  [PASSED]\r\n.pot CHK:dynamic_0                guesses: 1500 0:00:00:00 DONE  [PASSED] (1500 val-pwd)\r\n\r\n.....\r\nform=dynamic_15                   guesses: 1500 -show= 752 0:00:00:03 DONE : Expected count(s) (1500)  [!!!FAILED!!!]\r\n.pot CHK:dynamic_15               guesses:  752 -show= 752 0:00:00:00 DONE : Expected count(s) (1500)  [!!!FAILED!!!]  (752 val-pwd)\r\n```\r\n\r\nIn this case, the -show only gave us 752, which was what was in the .pot file.  Upon the .pot check, it also shows us that only 752 lines were in the .pot, and on re-run john worked with them, so this does not appear to be any 'bug' in the test suite.  This only appears to happen in -fork mode.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/comments/73004026","html_url":"https://github.com/magnumripper/JohnTheRipper/issues/1043#issuecomment-73004026","issue_url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/1043","id":73004026,"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-02-05T07:12:25Z","updated_at":"2015-02-05T07:12:25Z","body":">```\r\nA process may only hold one type of lock (shared\t or  exclusive)\t on  a\r\nfile.   Subsequent flock() calls on an already locked file will convert\r\nan existing lock to the new lock mode.\r\n```\r\n\r\nOnly process A (or perhaps a subthread of process A but we don't have threads doing file IO) can blow its own lock the way you describe. Otherwise we could give up locking completely.\r\n\r\n>  It could be that one process has already written into the .pot file, the other starts up, and blows the lock type by trying to load the .pot file?\r\n\r\nIf process A has a lock, process B can not blow it."}}