Hi, This is my first time using jhc; I installed the jhc-0.7.1 tarball. Below program gives a segfault at runtime:
module Main (main) where
data Tree = Leaf | Branch [Tree]
mkTree :: Int -> Tree mkTree 0 = Leaf mkTree _ = Branch [mkTree 0]
leaves :: Tree -> Int leaves Leaf = 1 leaves (Branch ts) = sum $ map leaves ts
main :: IO () main = print . leaves . mkTree $ 1
$ rm -R ~/.jhc/ && jhc -o jhctest Test.lhs && ./jhctest jhc 0.7.1 (0.7.0-13) <snip> Running: gcc '-std=gnu99' -D_GNU_SOURCE '-falign-functions=4' -ffast-math -Wshadow -Wextra -Wall -Wno-unused-parameter -o jhctest jhctest_code.c -DNDEBUG -O3 Segmentation fault $ uname -a Linux 2.6.30-gentoo-r4 #3 SMP x86_64 Intel(R) Core(TM)2 CPU 6300 @ 1.86GHz GenuineIntel GNU/Linux And with "-f debug -d c": $ ./jhctest jhctest: jhctest_code.c:809: promote: Assertion `!(((uintptr_t)(s)) & 0x1)' failed. Aborted It throws an exception: static inline wptr_t A_STD A_UNUSED A_HOT promote(sptr_t s) { assert(!ISLAZY(s)); // <- *HERE* assert(jhc_valid_whnf((wptr_t)s)); return (wptr_t)s; } -- Gökhan San
On Mon, Aug 31, 2009 at 05:29:18PM +0200, Gökhan San wrote:
This is my first time using jhc; I installed the jhc-0.7.1 tarball. Below program gives a segfault at runtime:
Oddly enough, I just discovered this same bug last night! But your test case that reproduces it is a lot simpler than the program I had, which will make tracking it down a lot easier. The issue is somewhere in Util.UnionSolve or how UnionSolve is being used in Grin.NodeAnalyze. I will look into it more today and hopefully release a patch in not long. thanks for the report! This will be helpful! John -- John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/
Hi, the most recent patch sent to the list fixes this bug. Thanks for the report! I was having trouble tracking down the issue without the small test case of yours. John -- John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/
participants (2)
-
gsan@stillpsycho.net -
John Meacham