{"action":"created","issue":{"url":"https://api.github.com/repos/vermaseren/form/issues/46","labels_url":"https://api.github.com/repos/vermaseren/form/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/vermaseren/form/issues/46/comments","events_url":"https://api.github.com/repos/vermaseren/form/issues/46/events","html_url":"https://github.com/vermaseren/form/issues/46","id":104702177,"number":46,"title":"[parform] Crash in #FactDollar","user":{"login":"tueda","id":1481665,"avatar_url":"https://avatars.githubusercontent.com/u/1481665?v=3","gravatar_id":"","url":"https://api.github.com/users/tueda","html_url":"https://github.com/tueda","followers_url":"https://api.github.com/users/tueda/followers","following_url":"https://api.github.com/users/tueda/following{/other_user}","gists_url":"https://api.github.com/users/tueda/gists{/gist_id}","starred_url":"https://api.github.com/users/tueda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tueda/subscriptions","organizations_url":"https://api.github.com/users/tueda/orgs","repos_url":"https://api.github.com/users/tueda/repos","events_url":"https://api.github.com/users/tueda/events{/privacy}","received_events_url":"https://api.github.com/users/tueda/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-03T14:03:42Z","updated_at":"2015-09-03T14:20:38Z","closed_at":null,"body":"This is an example that ParFORM freezes/aborts in #FactDollar. It seems that the problem occurs in workers.\r\n```\r\nS x,y;\r\nS dummy1,dummy2;\r\n*L F = 1+x+y;  * OK\r\nL F = 1-x+y;   * BAD\r\n*L F = 1+x-y;  * BAD\r\n*L F = 1-x-y;  * OK\r\n*L F = -1+x+y; * OK\r\n*L F = -1-x+y; * BAD\r\n*L F = -1+x-y; * BAD\r\n*L F = -1-x-y; * OK\r\nid dummy1 = dummy2;  * <-- any executable statements\r\n.sort\r\n#$F = F;\r\n*.sort;  * <-- (1) workaround\r\n#factdollar $F\r\n\r\n#if `$F[0]' == 1\r\n  #message $F[0] = `$F[0]'\r\n  #message $F = `$F'\r\n#else\r\n  #do i=0,`$F[0]'\r\n    #message $F[`i'] = `$F[`i']'\r\n  #enddo\r\n#endif\r\n.end\r\n```\r\n```\r\n==7665== Invalid read of size 4\r\n==7665==    at 0x4924F7: Generator (proces.c:3013)\r\n==7665==    by 0x42CD68: DollarFactorize (dollar.c:3178)\r\n==7665==    by 0x4866C5: DoFactDollar (pre.c:6239)\r\n==7665==    by 0x48C329: PreProcessor (pre.c:857)\r\n==7665==    by 0x4BC3FE: main (startup.c:1519)\r\n==7665==  Address 0x0 is not stack'd, malloc'd or (recently) free'd\r\n```\r\nInserting `.sort` at line (1) somehow works as a workaround. `ParFORM 4.1 (Aug 18 2015)` didn't have this problem."},"comment":{"url":"https://api.github.com/repos/vermaseren/form/issues/comments/137464153","html_url":"https://github.com/vermaseren/form/issues/46#issuecomment-137464153","issue_url":"https://api.github.com/repos/vermaseren/form/issues/46","id":137464153,"user":{"login":"tueda","id":1481665,"avatar_url":"https://avatars.githubusercontent.com/u/1481665?v=3","gravatar_id":"","url":"https://api.github.com/users/tueda","html_url":"https://github.com/tueda","followers_url":"https://api.github.com/users/tueda/followers","following_url":"https://api.github.com/users/tueda/following{/other_user}","gists_url":"https://api.github.com/users/tueda/gists{/gist_id}","starred_url":"https://api.github.com/users/tueda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tueda/subscriptions","organizations_url":"https://api.github.com/users/tueda/orgs","repos_url":"https://api.github.com/users/tueda/repos","events_url":"https://api.github.com/users/tueda/events{/privacy}","received_events_url":"https://api.github.com/users/tueda/received_events","type":"User","site_admin":false},"created_at":"2015-09-03T14:20:38Z","updated_at":"2015-09-03T14:20:38Z","body":"By the way, it is not nice that `$a[1]' causes a segfault when there is only one factor:\r\n```\r\nS x;\r\n#$a = 1+x;\r\n#factdollar $a\r\n#message `$a[0]'\r\n#message `$a[1]'\r\n.end\r\n```\r\n```\r\n==8363== Invalid read of size 8\r\n==8363==    at 0x447FB0: WriteDollarFactorToBuffer (dollar.c:705)\r\n==8363==    by 0x596328: OpenStream (tools.c:377)\r\n==8363==    by 0x50E155: GetChar (pre.c:271)\r\n==8363==    by 0x5102A4: LoadInstruction (pre.c:1109)\r\n==8363==    by 0x50FFB6: PreProInstruction (pre.c:1029)\r\n==8363==    by 0x50F8EC: PreProcessor (pre.c:857)\r\n==8363==    by 0x5729A4: main (startup.c:1519)\r\n==8363==  Address 0x0 is not stack'd, malloc'd or (recently) free'd\r\n```"}}