{"action":"created","issue":{"url":"https://api.github.com/repos/ghcjs/ghcjs/issues/415","labels_url":"https://api.github.com/repos/ghcjs/ghcjs/issues/415/labels{/name}","comments_url":"https://api.github.com/repos/ghcjs/ghcjs/issues/415/comments","events_url":"https://api.github.com/repos/ghcjs/ghcjs/issues/415/events","html_url":"https://github.com/ghcjs/ghcjs/issues/415","id":108543202,"number":415,"title":"TypeError: undefined is not a function: hsprimitive_memset_Word8","user":{"login":"Mikolaj","id":281893,"avatar_url":"https://avatars.githubusercontent.com/u/281893?v=3","gravatar_id":"","url":"https://api.github.com/users/Mikolaj","html_url":"https://github.com/Mikolaj","followers_url":"https://api.github.com/users/Mikolaj/followers","following_url":"https://api.github.com/users/Mikolaj/following{/other_user}","gists_url":"https://api.github.com/users/Mikolaj/gists{/gist_id}","starred_url":"https://api.github.com/users/Mikolaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mikolaj/subscriptions","organizations_url":"https://api.github.com/users/Mikolaj/orgs","repos_url":"https://api.github.com/users/Mikolaj/repos","events_url":"https://api.github.com/users/Mikolaj/events{/privacy}","received_events_url":"https://api.github.com/users/Mikolaj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-27T15:42:09Z","updated_at":"2015-09-28T03:28:33Z","closed_at":null,"body":"With Quick Start from 2 days ago I'm getting:\r\n\r\n```\r\nnode  dist/build/LambdaHack/LambdaHack.jsexe/all.js\r\nuncaught exception in Haskell thread: TypeError: undefined is not a function\r\nTypeError: undefined is not a function\r\n    at h$hsprimitive_memset_Word8 (/mikolaj/r/LambdaHack/dist/build/LambdaHack/LambdaHack.jsexe/all.js:20830:108)\r\n    at h$$kXf (/mikolaj/r/LambdaHack/dist/build/LambdaHack/LambdaHack.jsexe/all.js:713341:5)\r\n    at Immediate.h$mainLoop (/mikolaj/r/LambdaHack/dist/build/LambdaHack/LambdaHack.jsexe/all.js:9102:25)\r\n    at processImmediate [as _immediateCallback] (timers.js:367:17)\r\nthread blocked indefinitely in an STM transaction\r\n```\r\n\r\nand similarly in a chromium browser (under webkit there are no problems):\r\n\r\n```\r\nuncaught exception in Haskell thread: TypeError: undefined is not a function rts.js:8244\r\nTypeError: undefined is not a function\r\n    at h$hsprimitive_memset_Word8 (file:///mikolaj/r/LambdaHack/dist/build/LambdaHack/LambdaHack.jsexe/lib.js:284:108)\r\n    at h$$kXf (file:///mikolaj/r/LambdaHack/dist/build/LambdaHack/LambdaHack.jsexe/out.js:689062:5)\r\n    at h$mainLoop (file:///mikolaj/r/LambdaHack/dist/build/LambdaHack/LambdaHack.jsexe/rts.js:9104:25)\r\n    at file:///mikolaj/r/LambdaHack/dist/build/LambdaHack/LambdaHack.jsexe/rts.js:3485:25\r\n    at runIfPresent (file:///mikolaj/r/LambdaHack/dist/build/LambdaHack/LambdaHack.jsexe/rts.js:3503:21)\r\n    at onGlobalMessage (file:///mikolaj/r/LambdaHack/dist/build/LambdaHack/LambdaHack.jsexe/rts.js:3544:17) \r\n```\r\n\r\nand the offending call  is ```h$hsprimitive_memset_Word8(c, f, b, d)``` in the following context:\r\n\r\n```\r\nfunction h$$kXf()\r\n{\r\n  var a = h$r1;\r\n  var b = h$stack[(h$sp - 5)];\r\n  var c = h$stack[(h$sp - 4)];\r\n  var d = h$stack[(h$sp - 3)];\r\n  var e = h$stack[(h$sp - 2)];\r\n  var f = h$stack[(h$sp - 1)];\r\n  h$sp -= 6;\r\n  if(a)\r\n  {\r\n    h$hsprimitive_memset_Word8(c, f, b, d);\r\n    h$l4(false, ((f + b) | 0), h$ghczmprimZCGHCziTypesziSPEC, e);\r\n    return h$ap_4_3_fast();\r\n  }\r\n  else\r\n  {\r\n    h$r1 = f;\r\n  };\r\n  return h$stack[h$sp];\r\n};\r\n```\r\n\r\nThe test program from https://github.com/ghcjs/ghcjs/issues/387 runs OK for me and returns 0. I'd rather learn if I'm doing something silly before I try to extract a minimal failing example.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ghcjs/ghcjs/issues/comments/143630274","html_url":"https://github.com/ghcjs/ghcjs/issues/415#issuecomment-143630274","issue_url":"https://api.github.com/repos/ghcjs/ghcjs/issues/415","id":143630274,"user":{"login":"luite","id":354096,"avatar_url":"https://avatars.githubusercontent.com/u/354096?v=3","gravatar_id":"","url":"https://api.github.com/users/luite","html_url":"https://github.com/luite","followers_url":"https://api.github.com/users/luite/followers","following_url":"https://api.github.com/users/luite/following{/other_user}","gists_url":"https://api.github.com/users/luite/gists{/gist_id}","starred_url":"https://api.github.com/users/luite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luite/subscriptions","organizations_url":"https://api.github.com/users/luite/orgs","repos_url":"https://api.github.com/users/luite/repos","events_url":"https://api.github.com/users/luite/events{/privacy}","received_events_url":"https://api.github.com/users/luite/received_events","type":"User","site_admin":false},"created_at":"2015-09-28T03:28:33Z","updated_at":"2015-09-28T03:28:33Z","body":"Hmm, four arguments, the one in the JS implementation takes five. Looks likes this may be called on both `Addr#` (`Ptr`) and `ByteArray#` primitives. Can you share the code that uses this?"}}