cbaggers / cepl.examples

Some examples for the CEPL library
GNU General Public License v3.0
44 stars 14 forks source link

bloom.lisp crashes on compile #2

Closed stacksmith closed 6 years ago

stacksmith commented 8 years ago

The crash seems to be in (defvar* fbos ...) The individual (make-fbo...) and (sample ...) commands compile fine from REPL, one by one... Has the syntax changed for defvar*? It is a monster macro and I can't follow it enough to debug right now. Here is the output compiling the defvar*:

Unhandled memory fault at #xA40.
   [Condition of type SB-SYS:MEMORY-FAULT-ERROR]

Restarts:
 0: [ABORT] Abort compilation.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT] abort thread (#<THREAD "worker" RUNNING {1008952CF3}>)

Backtrace:
  0: (SB-SYS:MEMORY-FAULT-ERROR)
  1: ("foreign function: call_into_lisp")
  2: ("foreign function: post_signal_tramp")
  3: ("foreign function: #x7FFFF12A3989")
  4: (CEPL.TEXTURES::GEN-TEXTURE)
  5: (CEPL.TEXTURES::%MAKE-TEXTURE #<TEXTURE :UNINITIALIZED> (512 512) NIL 1 NIL NIL NIL NIL T NIL :RGBA8 NIL T)
  6: (MAKE-TEXTURE NIL :DIMENSIONS (512 512) :ELEMENT-TYPE :RGBA8 :MIPMAP NIL :LAYER-COUNT 1 :CUBES NIL :RECTANGLE NIL :MULTISAMPLE NIL :IMMUTABLE T :BUFFER-STORAGE NIL :GENERATE-MIPMAPS T :PIXEL-FORMAT NI..
  7: (CEPL.FBOS::%GEN-TEXTURES (0 :DIMENSIONS (512 512)))
  8: (CEPL.FBOS::FBO-GEN-ATTACH #<FBO :UNINITIALIZED> T (0 :DIMENSIONS (512 512)))
  9: (MAKE-FBO (0 :DIMENSIONS (512 512)))
 10: (SB-FASL::LOAD-FASL-GROUP #S(SB-FASL::FASL-INPUT :STREAM #<SB-SYS:FD-STREAM for "file /tmp/fileAwZybu.fasl" {100956EFE3}> :TABLE #(563 #<PACKAGE "SB-KERNEL"> SB-KERNEL::%DEFSTRUCT-PACKAGE-LOCKS #<PACK..
 11: (SB-FASL::LOAD-AS-FASL #<SB-SYS:FD-STREAM for "file /tmp/fileAwZybu.fasl" {100956EFE3}> NIL NIL)
cbaggers commented 8 years ago

Had cepl:repl been run at this point?

Either way it is a bug on my part. Creating a CEPL fbo should work before GL is initialized as it should defer the actual allocation to the cepl's internal 'GL initialized' event.

stacksmith commented 8 years ago

With the latest git repo, and cepl:repl up, the error is

check-framebuffer-status: Code::ZERO
"An error occurred"
   [Condition of type SIMPLE-ERROR]

Restarts:
 0: [*ABORT] Return to SLIME's top level.
 1: [ABORT] abort thread (#<THREAD "worker" RUNNING {1004817A63}>)

Backtrace:
  0: (CHECK-FRAMEBUFFER-STATUS #<FBO COLOR-ATTACHMENTS (0)>)
  1: (CEPL.FBOS::MAKE-FBO-NOW #<FBO COLOR-ATTACHMENTS (0)>)
  2: (MAKE-FBO (0 :DIMENSIONS (512 512)))
  3: (SB-FASL::LOAD-FASL-GROUP #S(SB-FASL::FASL-INPUT :STREAM #<SB-SYS:FD-STREAM for "file /home/stack/Documents/lisp/cepl.examples/examples/bloom.fasl" {10048360C3}> :TABLE #(1188 SET *PACKAGE* "CEPL.EXAM..
  4: (SB-FASL::LOAD-AS-FASL #<SB-SYS:FD-STREAM for "file /home/stack/Documents/lisp/cepl.examples/examples/bloom.fasl" {10048360C3}> NIL NIL)
  5: ((FLET SB-FASL::LOAD-STREAM :IN LOAD) #<SB-SYS:FD-STREAM for "file /home/stack/Documents/lisp/cepl.examples/examples/bloom.fasl" {10048360C3}> T)
  6: (LOAD #P"/home/stack/Documents/lisp/cepl.examples/examples/bloom.fasl" :VERBOSE NIL :PRINT NIL :IF-DOES-NOT-EXIST T :EXTERNAL-FORMAT :DEFAULT)
cbaggers commented 8 years ago

I can reproduce this error. I'll look into it

cbaggers commented 8 years ago

Would you mind trying out the following.

For me this works. I also see (for me) that starting slime, NOT starting CEPL, compiling bloom.lisp and then starting CEPL works.

What this means it is a threading issue that arises from how slime works. I'm going to email you about this as I need to make better defaults for CEPL but in a way that doesnt impact the user too much

stacksmith commented 8 years ago

OK, that sequence does work.

cbaggers commented 6 years ago

I got rid of defvar* as it was more trouble that it was worth