core.logic

stack overflow with conda/u

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

(ns test
  (:refer-clojure :exclude [==])
  (:require
   [clojure.core.logic :refer :all]))
 
(defn foo [in out]
  (matcha 
   [in out]
   ([('and a b . ()) ('and x y . ())] (foo a x) (foo b y))
   ([a ('bar ('baz a . ()) . ())])))
 
;; I get a stack overflow with the following, but if I remove one conjunct, then it will run.
 
(run 1 [q] (foo
            '(and p
                  (and p
                       (and p
                            (and p
                                 (and p
                                      (and p
                                           (and p
                                                (and p
                                                     (and p
                                                          (and p
                                                               (and p p)))))))))))
            q))

Activity

David Nolen made changes -
Field Original Value New Value
Summary stack overflow with lists and recursion stack overflow with conda/u
Hide
David Nolen added a comment -

It looks this issue still exists even if you swap the matcha with matche

Show
David Nolen added a comment - It looks this issue still exists even if you swap the matcha with matche
Hide
Austin Haas added a comment -

I think the overflow is occurring during reification.

I was getting this error when returning a result from run, but now that I'm using the same value as the input to another goal there is no overflow.

If you replace q in the foo call with a fresh variable, it will not overflow.

Show
Austin Haas added a comment - I think the overflow is occurring during reification. I was getting this error when returning a result from run, but now that I'm using the same value as the input to another goal there is no overflow. If you replace q in the foo call with a fresh variable, it will not overflow.
Hide
David Nolen added a comment -

This works for me on master. Can you give me more specifics about your setup so I can try to recreate? I'm on OS X 10.8 running JDK 7 64bit.

Show
David Nolen added a comment - This works for me on master. Can you give me more specifics about your setup so I can try to recreate? I'm on OS X 10.8 running JDK 7 64bit.
Hide
Austin Haas added a comment -

I don't see the issue anymore, but I believe I was using Java 1.6 when I reported it and now I am using:

$ java -version
java version "1.7.0_15"
Java(TM) SE Runtime Environment (build 1.7.0_15-b03)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

Show
Austin Haas added a comment - I don't see the issue anymore, but I believe I was using Java 1.6 when I reported it and now I am using: $ java -version java version "1.7.0_15" Java(TM) SE Runtime Environment (build 1.7.0_15-b03) Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)
Hide
David Nolen added a comment -

OK, thanks for the quick response, I'll double check how things look under 1.6.

Show
David Nolen added a comment - OK, thanks for the quick response, I'll double check how things look under 1.6.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: