| sjanssen | that backtrace seems to indicate that you've crashed inside Haskell code, not the C library |
| rhz_ | ok.. |
| sjanssen | oh wait, this is way simpler than I thought! rhz_: the C call isn't happening before you peek off the array |
| rhz_ | i thought something like that could be happening laziness... |
| sjanssen | yeah, you probably shouldn't be using the 'call' thing is there another c2hs directive similar to call that generates an IO function? rhz_: you're forgetting to free some of the stuff you allocate, by the way |
| rhz_ | yes true |
| sjanssen | maybe it should just be 'call' instead of 'call fun'? I really don't know c2hs well |
| chessguy | ugh |
| rhz_ | well that puts the c function call inside the IO monad. That may solve this problem, but I don't want it inside the IO monad. |
| sjanssen | rhz_: it must be, to guarantee sequencing is solve_gp supposed to be the nice Haskell wrapper around the lower level C function? |
| rhz_ | that is basically the idea.. |
| sjanssen | okay, then why shouldn't solve_simple_quadprog be in the IO monad? |
| rhz_ | good point |
| sjanssen | you're already doing your marshaling in IO (with an unsafePerformIO around it) |
| rhz_ | Changed it as suggested. But still seg faults.. :( the backtrace is the same. looks the same |
| sjanssen | so it's no longer "let result = ...", but "result <- ..."? |
| rhz_ | it is: result <- {# call solve_simple_quadprog #} matArrArr vecArr (fromIntegral n) xArr sjanssen: besides if your previous comment about it peeking the array before the c function is called was right it still wouldn't explain why the seg fault. Seg faults don't usually occur from reading from memory, only from writing to memory don't they? |
| sjanssen | nah, a seg fault can happen when you read from invalid memory |
| rhz_ | If I put print "hello" at the top of the do block then it seg faults before saying hello.. |
| sorear | hello! ouch, segfault |
| rhz_ | hi.. |
| action | sorear reads the @where logs |
| sorear | reads the @where logs rhz_: I just joined |
| rhz_ | ok |
| sjanssen | rhz_: at the beginning of solve_qp? |
| rhz_ | yep |
| sjanssen | humm |
| rhz_ | that might mean my ghc has bugs.. |
| dmead | or your C is wrong/ish can i take a look? |
| rhz_ | ok |