{"action":"created","issue":{"url":"https://api.github.com/repos/UU-ComputerScience/uhc/issues/32","labels_url":"https://api.github.com/repos/UU-ComputerScience/uhc/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/UU-ComputerScience/uhc/issues/32/comments","events_url":"https://api.github.com/repos/UU-ComputerScience/uhc/issues/32/events","html_url":"https://github.com/UU-ComputerScience/uhc/issues/32","id":49650695,"number":32,"title":"compiled code is segfaulting","user":{"login":"orchid-hybrid","id":7066225,"avatar_url":"https://avatars.githubusercontent.com/u/7066225?v=3","gravatar_id":"","url":"https://api.github.com/users/orchid-hybrid","html_url":"https://github.com/orchid-hybrid","followers_url":"https://api.github.com/users/orchid-hybrid/followers","following_url":"https://api.github.com/users/orchid-hybrid/following{/other_user}","gists_url":"https://api.github.com/users/orchid-hybrid/gists{/gist_id}","starred_url":"https://api.github.com/users/orchid-hybrid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orchid-hybrid/subscriptions","organizations_url":"https://api.github.com/users/orchid-hybrid/orgs","repos_url":"https://api.github.com/users/orchid-hybrid/repos","events_url":"https://api.github.com/users/orchid-hybrid/events{/privacy}","received_events_url":"https://api.github.com/users/orchid-hybrid/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2014-11-21T03:40:52Z","updated_at":"2015-01-14T11:12:38Z","closed_at":null,"body":"Hello\r\n\r\nI have built UHC from source code using GHC on a 64 bit computer\r\n\r\n```\r\n$ uhc --version\r\nehc-1.1.7.2, revision master@05180a3aff, timestamp 20141121 +0000 030619\r\n```\r\n\r\nbut I tried to compile the demo with `uhc hello.hs`, this seems to work and creates output files but when I run it it crashes:\r\n\r\n```\r\n(gdb) r\r\nProgram received signal SIGSEGV, Segmentation fault.\r\n0x000000000041c748 in gb_InitTables ()\r\n(gdb) bt\r\n#0  0x000000000041c748 in gb_InitTables ()\r\n#1  0x00000000004065a0 in UHC_Base_initModule ()\r\n#2  0x0000000000404935 in main ()\r\n```\r\n\r\nI looked around and found this is in the bytecode interpreter.c file but I don't know what might be going wrong."},"comment":{"url":"https://api.github.com/repos/UU-ComputerScience/uhc/issues/comments/69901743","html_url":"https://github.com/UU-ComputerScience/uhc/issues/32#issuecomment-69901743","issue_url":"https://api.github.com/repos/UU-ComputerScience/uhc/issues/32","id":69901743,"user":{"login":"phile314","id":1640697,"avatar_url":"https://avatars.githubusercontent.com/u/1640697?v=3","gravatar_id":"","url":"https://api.github.com/users/phile314","html_url":"https://github.com/phile314","followers_url":"https://api.github.com/users/phile314/followers","following_url":"https://api.github.com/users/phile314/following{/other_user}","gists_url":"https://api.github.com/users/phile314/gists{/gist_id}","starred_url":"https://api.github.com/users/phile314/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phile314/subscriptions","organizations_url":"https://api.github.com/users/phile314/orgs","repos_url":"https://api.github.com/users/phile314/repos","events_url":"https://api.github.com/users/phile314/events{/privacy}","received_events_url":"https://api.github.com/users/phile314/received_events","type":"User","site_admin":false},"created_at":"2015-01-14T11:12:38Z","updated_at":"2015-01-14T11:12:38Z","body":"I tried to debug the generated executables, but that hasn't really helped so far.... Interestingly, inside the debuger (gdb) the C executable crashes everywhere. I also can see in the debugger that the two versions are not optimized exactly the same way.\r\n\r\nThe crash seems to happen at interpreter.c:1887, backtrace:\r\n\r\n<pre>\r\n#0  gb_InitTables (byteCodes=<optimized out>, byteCodesSz=<optimized out>, cafGlEntryIndices=0xd80000 <UHC_Base_cafGlEntryIndices>, \r\n    cafGlEntryIndicesSz=<optimized out>, globalEntries=<optimized out>, globalEntriesSz=<optimized out>, \r\n    consts=0xd7fbc0 <UHC_Base_constants>, gcStackInfos=0xc1a9c0 <UHC_Base_gcStackInfos>, linkChainInds=0x12b4680, \r\n    callinfos=0xc20a40 <UHC_Base_callinfos>, callinfosSz=2350, functionInfos=0xc1b200 <UHC_Base_functionInfos>, functionInfosSz=2053, \r\n    bytePool=0xbf8380 <UHC_Base_bytePool> \"UHC.Base._'Dict_Constructor\", linkChainOffset=122553, impModules=0x12b4680, impModulesSz=0, \r\n    expNode=0x12b4880 <UHC_Base_expNode>, expNodeSz=604, expNodeOffs=0xd84c40 <UHC_Base_expNode_offs>, \r\n    modTbl=0xbf7380 <Test_moduleEntries>, modTblInx=0) at build/99/rts/bc/bc/interpreter.c:1887\r\n#1  0x000000000040793e in UHC_Base_initModule (modTbl=0xbf7380 <Test_moduleEntries>, modTblInx=0)\r\n    at install/99/lib/pkg//uhcbase-1.1.8.4/99/bc/plain/UHC/Base.c:103203\r\n#2  0x000000000040592c in main (argc=1, argv=0x7fffffffe3f8) at Test.c:890\r\n</pre>\r\n\r\n(To get debug information for the RTS, one can use the --with-gcc-ehc-options=-g configure argument.)\r\n\r\nThe traces are quite big (~30MB), so opening them in the browser may not be the best idea...\r\nWorking f20 trace:\r\nhttp://files.314.ch/trace_B_f20.txt\r\nWorking f20 trace, cut off after where the f21 version crashes:\r\nhttp://files.314.ch/trace_B_f20_cut.txt\r\nCrashing f21 trace:\r\nhttp://files.314.ch/trace_B_f21.txt\r\n\r\n\r\nI also compiled UHC using gcc 3.4 on my notebook, and then the generated executables work.\r\n\r\n@atze Out of curiosity, what GCC version are you using?"}}