Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#440 closed defect (invalid)

'Error: stack overflow' error in unexpected situation

Reported by: Alan Post Owned by:
Priority: major Milestone: 4.9.0
Component: core libraries Version: 4.6.x
Keywords: Cc: alanpost@…
Estimated difficulty:

Description

This ticket is a follow-up to the email thread I posted about this issue.

I'm running chicken 2bb09388cff32b7ecb49f39df0692e2d4db7a0bf (silly link case problems, tiring) from the experimental branch. I'm on OpenBSD 4.8 running in a VMWare virtual machine.

This bug refers to the genturfa'i egg.

For this bug, please check out r21827 from the egg repository, apply the patches attached to this e-mail, and build the egg:

svn co -r21827 https://code.call-cc.org/svn/chicken-eggs/release/4/genturfahi/trunk
cd trunk
patch -p1 < patch-conf    # enable full debugging
patch -p1 < patch-memoize # the do-nothing memoizer
chicken-install -s

Run the genturfahi command-line program after installing the egg:

$ genturfahi

Error: stack overflow

        Call history:

        nunjavni.scm:176: nunjavni-*      
        nunjavni.scm:140: venunjmina-rodanunvalsi         
        morji.scm:47: hash-table-exists?          
        bootstrap.scm:369: genturfahi#morji-nunjavni-valsi        
        morji.scm:47: hash-table-exists?          
        morji.scm:48: hash-table-set!     
        bootstrap.scm:366: genturfahi#morji-nunjavni-je   
        nunjavni.scm:245: venunjmina-rodanunvalsi         
        nunjavni.scm:247: filter          
        morji.scm:47: hash-table-exists?                <--

This error is happening while genturfahi is initializing, the most outward relevant line being bootstrap.scm:366.

If you comment out morji.scm:47 and morji.scm:48, run chicken-install -s, the program will run without producing any output (which is expected.)

I would expect to be able to leave morji.scm:47 and morji.scm:48 uncommented in the code and run genturfahi without generating a stack overflow error.

This problem *also* exists when running the code from csi, without compiling it:

# This command may give an error if csi is an alias that includes
# command-line arguments, as in: alias csi='csi -quiet'.  Run csi 
# without command-line arguments.
#
$ csi chicken-csi.scm

Error: stack overflow

        Call history:

        <eval>    [morji-nunjavni] (not (hash-table-exists? morji sumti))
        <eval>    [morji-nunjavni] (hash-table-exists? morji sumti)
        <eval>    [morji-nunjavni] (hash-table-set! morji sumti javni)
        <eval>    [morji-nunjavni] (apply nunjavni sumti)
        <eval>    [nunjavni-+] (##sys#get-keyword (quote cmene:) tmp268)
        <eval>    [nunjavni-+] (nunjavni-* javni cmene: cmene)
        <eval>    [nunjavni-*] (##sys#get-keyword (quote cmene:) tmp241)
        <eval>    [nunjavni-*] (venunjmina-rodanunvalsi cmene)
        <eval>    [morji-nunjavni] (not (hash-table-exists? morji sumti))
        <eval>    [morji-nunjavni] (hash-table-exists? morji sumti)     <--

This error also goes away if you comment out morji.scm:47 and morji.scm:48.

Attachments (2)

patch-conf (306 bytes) - added by Alan Post 14 years ago.
enable full debug output.
patch-memoize (833 bytes) - added by Alan Post 14 years ago.
patch to make the memoizer a no-op.

Download all attachments as: .zip

Change History (6)

Changed 14 years ago by Alan Post

Attachment: patch-conf added

enable full debug output.

Changed 14 years ago by Alan Post

Attachment: patch-memoize added

patch to make the memoizer a no-op.

comment:1 Changed 14 years ago by Alan Post

Cc: alanpost@… added

comment:2 Changed 14 years ago by felix winkelmann

Resolution: invalid
Status: newclosed

This was caused by circular data in an implicit equal? comparison in a hash-table test. It turned out that keys to the hash-table operation included closures, which can easily contain circular data and which is strictly speaking not legal to do. So this is effectively a bug in the chicken runtime library implemtation for equal?.

I will open a new ticket for changing equal? and close this one as "invalid", since the reason is different from what we initially suspected and because a new ticket will cover this problem.

comment:3 Changed 13 years ago by felix winkelmann

Milestone: 4.7.04.8.0

Milestone 4.7.0 deleted

comment:4 Changed 12 years ago by felix winkelmann

Milestone: 4.8.04.9.0

Milestone 4.8.0 deleted

Note: See TracTickets for help on using tickets.