lispnik / iup

Common Lisp CFFI bindings to the IUP Portable User Interface library (pre-ALPHA)
Other
139 stars 7 forks source link

SBCL explodes after loading IUP #8

Closed defunkydrummer closed 5 years ago

defunkydrummer commented 5 years ago

Hello Lispnik, i'm in Windows x64 under SBCL 1.3.10 and get the following:

Session:

CL-USER> (ql:quickload
          "tecgraf-libs")
To load "tecgraf-libs":
  Load 1 ASDF system:
    tecgraf-libs
; Loading "tecgraf-libs"
[package tecgraf-libs].
Downloading https://sourceforge.net/projects/iup/files/3.26/Windows%20Libraries/Dynamic/iup-3.26_Win64_dll15_lib.zip...
....
Downloading https://sourceforge.net/projects/canvasdraw/files/5.12/Windows%20Libraries/Dynamic/cd-5.12_Win64_dll15_lib.zip...
Downloading https://sourceforge.net/projects/imtoolkit/files/3.13/Windows%20Libraries/Dynamic/im-3.13_Win64_dll15_lib.zip...
.
Unpacked to #P"c:/Users/fegoavil010/Documents/instalados/lisp-portacle/portacle/projects/tecgraf-libs/libs/"

("tecgraf-libs")
CL-USER> cffi:*foreign-library-directories*
NIL
CL-USER> (push #P"c:/Users/fegoavil010/Documents/instalados/lisp-portacle/portacle/projects/tecgraf-libs/libs/" cffi:*foreign-library-directories*)
(#P"c:/Users/fegoavil010/Documents/instalados/lisp-portacle/portacle/projects/tecgraf-libs/libs/")
CL-USER> (ql:quickload "iup")
To load "iup":
  Load 1 ASDF system:
    iup
; Loading "iup"
.To load "genhash":
  Load 1 ASDF system:
    asdf
  Install 1 Quicklisp release:
    genhash
; Fetching #<URL "http://beta.quicklisp.org/archive/genhash/2018-12-10/genhash-20181210-git.tgz">
; 4.11KB
==================================================
4,210 bytes in 0.04 seconds (108.19KB/sec)
; Loading "genhash"
[package net.hexapodia.hashtables]....
; Loading "iup"
To load "trivial-arguments":
  Load 1 ASDF system:
    asdf
  Install 1 Quicklisp release:
    trivial-arguments
; Fetching #<URL "http://beta.quicklisp.org/archive/trivial-arguments/2018-08-31/trivial-arguments-20180831-git.tgz">
; 5.88KB
==================================================
6,024 bytes in 0.03 seconds (217.88KB/sec)
; Loading "trivial-arguments"
[package trivial-arguments]
; Loading "iup"
[package iup-cffi]................................
[package iup-utils]...............................
[package iup].....................................
..................................................
..................................................
..................

inferior lisp says:

Heap exhausted during garbage collection: 160 bytes available, 528 requested.
 Gen StaPg UbSta LaSta LUbSt Boxed Unboxed LB   LUB  !move  Alloc  Waste   Trig    WP  GCs Mem-age
   0:     0     0     0     0     0     0     0     0     0        0     0 10737418    0   0  0.0000
   1:     0     0     0     0     0     0     0     0     0        0     0 10737418    0   0  0.0000
   2: 30001 30000     0     0 18148  4445    27    18   170 736677312 5124672 375740794    0   1  1.2492
   3: 32767 32752     0     0  7469  1092    98   134    14 284015296 4113728  2000000    0   0  0.0000
   4:     0     0     0     0     0     0     0     0     0        0     0  2000000    0   0  0.0000
   5:     0     0     0     0     0     0     0     0     0        0     0  2000000    0   0  0.0000
   6:     0     0     0     0  1109   210     0     0     0 43220992     0  2000000  930   0  0.0000
   Total bytes allocated    = 1063913600
   Dynamic-space-size bytes = 1073741824
GC control variables:
   *GC-INHIBIT* = true
   *GC-PENDING* = true
   *STOP-FOR-GC-PENDING* = false
fatal error encountered in SBCL pid 18748(tid 74267088):
Heap exhausted, game over.

The system is too badly corrupted or confused to continue at the Lisp
level. If the system had been compiled with the SB-LDB feature, we'd drop
into the LDB low-level debugger now. But there's no LDB in this build, so
we can't really do anything but just exit, sorry.

Process inferior-lisp exited abnormally with code 1

All your base are belong to us. There's no chance to escape make your time.
defunkydrummer commented 5 years ago

Update: But IUP works when using Clozure CL on the same system. The "buttons" example works.

However it fails when loading "iup-controls" system. I'm opening another bug.

lispnik commented 5 years ago

Yeah, I'm not sure what I'm doing that causes SBCL to exhaust heap on compilation. You can work around it by adding --dynamic-space-size 2048 to the command line for SBCL (1024 is the default for x86_64 on Windows). Luckily the defaults work at run time though. I'll leave this open, since it's kind of a bummer, but in the mean time I'll add a note to the docs.

Thanks for 1st project bug report btw!

lispnik commented 5 years ago

Updated docs on master with a note

defunkydrummer commented 5 years ago

Thanks for the quick "customer support"; please take note of the other issues I submitted, particularly the CCL one worries me (I prefer CCL).

lispnik commented 5 years ago

I think a little refactoring in iup/classes.lisp might fix this problem. Currently, there's a lot of code in the body of the defiupclass macro that is would expand and be repeated for each class.

lispnik commented 5 years ago

Screenshot from 2019-07-06 11-35-20 I just setup a new development environment and loaded IUP from scratch. It compiles and loads without blowing up now (at least with SBCL 1.5.4 on x86 64 bit Linux). Could you try it again when you have a chance? If it's OK on Windows SBCL then I'll remove the note from the README and close this issue.

vindarel commented 5 years ago

I confirm on Linux 64bits SBCL 1.4.5-debian. But I needed to clone tecgraf-base and pffft.

lispnik commented 5 years ago

Cool thanks for trying it out @vindarel