
Hi all,
I've got some code crashing with "Prelude.foldr1: empty list". In
GHCi, the code uses too much memory (I kill it after it consumes 1GB)
to be able to use :trace and :history, but I just found out about the
-xc RTS option. I tried that, and I get the following:

On 2008.02.26 23:13:59 -0500, Denis Bueno
Hi all,
I've got some code crashing with "Prelude.foldr1: empty list". In GHCi, the code uses too much memory (I kill it after it consumes 1GB) to be able to use :trace and :history, but I just found out about the -xc RTS option. I tried that, and I get the following:
dsat: Prelude.foldr1: empty list Now, manually going through GHC.List (http://haskell.org/ghc/docs/latest/html/libraries/base/src/GHC-List.html) I only found one CAF, namely prel_list_str, at the bottom of the file. However, it is late and I quite possibly missed something. This CAF, of course, doesn't seem a likely culprit. I also stumbled on some discussion of the explicit call stack (http://hackage.haskell.org/trac/ghc/wiki/ExplicitCallStack/StackTraceExperie...) which exemplifies the behavior I've found, but doesn't seem to suggest a way to fix it.
I'm developing on GHC 6.8.2. I've attached my code, the output of a cabal sdist, which requires parse-dimacs [0] and bitset [1] (both cabalised) to build. If you build the executable (with profiling), you should see my behavior by running:
./dist/build/dsat/dsat -verify +RTS -xc
I know that the problem is somewhere in the "Backtracking" section, in the backJump function. But I don't know where.
Any help is appreciated.
-- Denis
Fortuitously, I recently came across a bunch of bioinformatics software in Haskell. One of the libraries was called 'interlude', and it claims to be able to give line locations for errors in the Prelude. I was intending to upload them all as a group once I'd finished, but you might be able to make use of it here. You can find it here: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/interlude-0.1.1. If it does work out for you, be sure to let me know. I haven't run across any Prelude errors in my code since I installed it, so I haven't really tried it out. -- gwern brigand Investigation Firewalls Galil NTIS TDYC Yukon Morse Jazeera INR

On Wed, Feb 27, 2008 at 12:06 AM,
Fortuitously, I recently came across a bunch of bioinformatics software in Haskell. One of the libraries was called 'interlude', and it claims to be able to give line locations for errors in the Prelude. I was intending to upload them all as a group once I'd finished, but you might be able to make use of it here.
You can find it here: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/interlude-0.1.1.
If it does work out for you, be sure to let me know. I haven't run across any Prelude errors in my code since I installed it, so I haven't really tried it out.
Although I had to change my source code a bit (changing calls to e.g. `any' and `all' to have a Foldable prefix), this did work. My error message now is: dsat: Prelude.maximum: empty list which tells me where my bug is. Thanks! -- Denis

Hi Denis,
I was unable to run your program; it looks like there's a missing
module 'Properties'. To include it in the sdist you probably need to
add it under the other-modules field in the .cabal file.
-Judah
2008/2/26 Denis Bueno
Hi all,
I've got some code crashing with "Prelude.foldr1: empty list". In GHCi, the code uses too much memory (I kill it after it consumes 1GB) to be able to use :trace and :history, but I just found out about the -xc RTS option. I tried that, and I get the following:
dsat: Prelude.foldr1: empty list Now, manually going through GHC.List (http://haskell.org/ghc/docs/latest/html/libraries/base/src/GHC-List.html) I only found one CAF, namely prel_list_str, at the bottom of the file. However, it is late and I quite possibly missed something. This CAF, of course, doesn't seem a likely culprit. I also stumbled on some discussion of the explicit call stack (http://hackage.haskell.org/trac/ghc/wiki/ExplicitCallStack/StackTraceExperie...) which exemplifies the behavior I've found, but doesn't seem to suggest a way to fix it.
I'm developing on GHC 6.8.2. I've attached my code, the output of a cabal sdist, which requires parse-dimacs [0] and bitset [1] (both cabalised) to build. If you build the executable (with profiling), you should see my behavior by running:
./dist/build/dsat/dsat -verify +RTS -xc
I know that the problem is somewhere in the "Backtracking" section, in the backJump function. But I don't know where.
Any help is appreciated.
-- Denis
[0] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/parse-dimacs-1.0.... [1] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/bitset-0.5
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Wed, Feb 27, 2008 at 2:01 AM, Judah Jacobson
Hi Denis,
I was unable to run your program; it looks like there's a missing module 'Properties'. To include it in the sdist you probably need to add it under the other-modules field in the .cabal file.
Sorry about this. I'm new to Cabal, and to Haskell in general. Attached is a version that built on my machine independently of the source tree. -- Denis
participants (3)
-
Denis Bueno
-
gwern0@gmail.com
-
Judah Jacobson