Closed saolsen closed 9 years ago
I received a very similar error, but I'm on linux (and racket 6.1.1). So is this a GL version driver error?
Full error: ../private/engine/utils.rkt:211:2: make-gl-shader: 0:1(10): error: GLSL 1.30 is not supported. Supported versions are: 1.10, 1.20, and 1.00 ES in #version 130
in vec2 vert_position; in vec2 vert_texcoord;
smooth out vec2 frag_texcoord;
void main() { gl_Position = vec4(vert_position, 0, 1); frag_texcoord = vert_texcoord; }
Sorry it's taken so long to reply.
OS X support is a priority, but I can't test it. I think I've hacked around the problem, though.
First, I've made sure pict3d raises errors when the OpenGL version is < 3.0. Here's what you should see on OS X:
pict3d-canvas%
, or using pict3d->bitmap
) should raise an error.Second, pict3d's shaders are compatible with GLSL 1.30 through (at least) 3.30 and use no deprecated features, so pict3d now inserts #version <the driver's reported GLSL version>
at the top of the shader code. If the real problem is that your driver supports only GLSL 1.50 (which looks like typical Mac behavior), this hack should fix that.
To help you help me test it, I've added logging support. Can you please update pict3d, run DrRacket from the command line using
PLTSTDERR="error debug@pict3d" drracket
and let me know how it goes? If there's a versioning error, there should be something helpful dumped to the console.
FWIW I get the following error on OS X 10.9.5 when I run the spaceship example.
creating draw-params vector of length 1
creating key vector of length 1
creating weighted transparency blend program
. . ../racket-from-github/racket/racket/share/pkgs/pict3d/pict3d/private/gl/program.rkt:68:0: make-gl-shader: ERROR: 0:1: '' : version '130' is not supported
ERROR: 0:6: 'smooth' : syntax error syntax error
in
#version 130
in vec2 vert_position;
in vec2 vert_texcoord;
smooth out vec2 frag_texcoord;
void main() {
gl_Position = vec4(vert_position, 0, 1);
frag_texcoord = vert_texcoord;
}
After updating (I hadn't noticed your commits during the day) the error has disappeared. Instead the spacehip example provokes a crash (I saw a small black window before the crash).
Process: DrRacket [11585] Path: /Users/USER/*/DrRacket.app/Contents/MacOS/DrRacket Identifier: org.racket-lang.DrRacket Version: 6.1.1.8 (6.1.1.8) Code Type: X86-64 (Native) Parent Process: bash [706] Responsible: Terminal [306] User ID: 502
Date/Time: 2015-02-01 00:32:31.569 +0100 OS Version: Mac OS X 10.9.5 (13F34) Report Version: 11 Anonymous UUID: 43139E67-6221-67E1-5E19-E4C13C941F6D
Sleep/Wake UUID: 82F5C903-19E0-4E3E-8264-36F9F3CD868A
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x000000017e47c000
VM Regions Near 0x17e47c000:
VM_ALLOCATE 000000017a478000-000000017e47c000 [ 64.0M] rw-/rwx SM=PRV
-->
shared memory 0000000185478000-0000000186478000 [ 16.0M] r-x/rwx SM=PRV
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_platform.dylib 0x00007fff90d730fe _platform_memmove$VARIANT$Nehalem + 286 1 Racket 0x00000001031b9e99 do_memop + 1577 2 Racket 0x00000001031b28fa foreign_memcpy + 26 (foreign.c:3033) 3 ??? 0x000000010435223f 0 + 4365558335 4 ??? 0x00000001066e340b 0 + 4402852875 5 Racket 0x0000000102f0ae6a scheme_do_eval + 6314 (schthread.h:394) 6 Racket 0x0000000102f0f72b _scheme_apply_multi_from_native + 459 (schthread.h:394) 7 ??? 0x00000001043575e4 0 + 4365579748 8 ??? 0x000000010435121d 0 + 4365554205 9 ??? 0x000000010435623d 0 + 4365574717 10 ??? 0x00000001043559cb 0 + 4365572555 11 Racket 0x0000000102f0ae6a scheme_do_eval + 6314 (schthread.h:394) 12 Racket 0x0000000102f0f72b _scheme_apply_multi_from_native + 459 (schthread.h:394) 13 ??? 0x0000000104348056 0 + 4365516886 14 Racket 0x0000000102f0ae6a scheme_do_eval + 6314 (schthread.h:394) 15 Racket 0x0000000102f44b72 do_call_with_sema + 1522 (schthread.h:391) 16 ??? 0x0000000104348114 0 + 4365517076 17 Racket 0x0000000102f0ae6a scheme_do_eval + 6314 (schthread.h:394) 18 Racket 0x0000000102f0f72b _scheme_apply_multi_from_native + 459 (schthread.h:394) 19 ??? 0x0000000104348056 0 + 4365516886 20 Racket 0x0000000102f34f7d _apply_native + 237 (schthread.h:394) 21 Racket 0x0000000102f38569 scheme_apply_chaperone + 3449 (fun.c:3842) 22 Racket 0x0000000102f0b061 scheme_do_eval + 6817 (eval.c:3125) 23 Racket 0x0000000102f0f971 _scheme_apply_from_native + 545 (schthread.h:394) 24 ??? 0x000000010435163e 0 + 4365555262 25 Racket 0x0000000102f0ae6a scheme_do_eval + 6314 (schthread.h:394) 26 Racket 0x0000000102f0f72b _scheme_apply_multi_from_native + 459 (schthread.h:394) 27 ??? 0x0000000104348056 0 + 4365516886 28 Racket 0x0000000102f0ae6a scheme_do_eval + 6314 (schthread.h:394) 29 Racket 0x0000000102f42a01 time_apply + 849 (fun.c:9950) 30 ??? 0x00000001081044c9 0 + 4430251209 31 Racket 0x0000000102f0ae6a scheme_do_eval + 6314 (schthread.h:394) 32 Racket 0x0000000102f0f72b _scheme_apply_multi_from_native + 459 (schthread.h:394) 33 ??? 0x0000000104348056 0 + 4365516886 34 Racket 0x0000000102f0ae6a scheme_do_eval + 6314 (schthread.h:394) 35 Racket 0x0000000102f299a0 apply_k + 192 (fun.c:1503) 36 Racket 0x0000000102f3b893 scheme_top_level_do_worker + 1907 (fun.c:1327) 37 Racket 0x0000000103193077 start_child + 871 (thread.c:3125) 38 Racket 0x0000000103196484 make_subprocess + 660 (thread.c:3221) 39 Racket 0x0000000103196758 scheme_thread_w_details + 488 (thread.c:3421) 40 ??? 0x00007fff5cd5a440 0 + 140734750893120
Thread 1: 0 libsystem_kernel.dylib 0x00007fff955e9a1a mach_msg_trap + 10 1 libsystem_kernel.dylib 0x00007fff955e8d18 mach_msg + 64 2 Racket 0x00000001031d56b6 exception_thread + 166 (vm_osx.c:359) 3 libsystem_pthread.dylib 0x00007fff8f7c2899 _pthread_body + 138 4 libsystem_pthread.dylib 0x00007fff8f7c272a _pthread_start + 137 5 libsystem_pthread.dylib 0x00007fff8f7c6fc9 thread_start + 13
Thread 2: 0 libsystem_kernel.dylib 0x00007fff955eda3a __semwait_signal + 10 1 libsystem_c.dylib 0x00007fff8d272dc0 nanosleep + 200 2 libsystem_c.dylib 0x00007fff8d272cb2 usleep + 54 3 Racket 0x00000001030c0efb green_thread_timer + 43 (port.c:11023) 4 Racket 0x0000000103051595 mzrt_thread_stub + 85 (mzrt.c:170) 5 libsystem_pthread.dylib 0x00007fff8f7c2899 _pthread_body + 138 6 libsystem_pthread.dylib 0x00007fff8f7c272a _pthread_start + 137 7 libsystem_pthread.dylib 0x00007fff8f7c6fc9 thread_start + 13
Thread 3:: Dispatch queue: com.apple.libdispatch-manager 0 libsystem_kernel.dylib 0x00007fff955ee662 kevent64 + 10 1 libdispatch.dylib 0x00007fff9352b421 _dispatch_mgr_invoke + 239 2 libdispatch.dylib 0x00007fff9352b136 _dispatch_mgr_thread + 52
Thread 4:: com.apple.CFSocket.private 0 libsystem_kernel.dylib 0x00007fff955ed9aa select + 10 1 com.apple.CoreFoundation 0x00007fff8f1eda03 CFSocketManager + 867 2 libsystem_pthread.dylib 0x00007fff8f7c2899 _pthread_body + 138 3 libsystem_pthread.dylib 0x00007fff8f7c272a _pthread_start + 137 4 libsystem_pthread.dylib 0x00007fff8f7c6fc9 thread_start + 13
Thread 5: 0 libsystem_kernel.dylib 0x00007fff955e9a1a mach_msg_trap + 10 1 libsystem_kernel.dylib 0x00007fff955e8d18 mach_msg + 64 2 com.apple.CoreFoundation 0x00007fff8f1a1f15 CFRunLoopServiceMachPort + 181 3 com.apple.CoreFoundation 0x00007fff8f1a1539 CFRunLoopRun + 1161 4 com.apple.CoreFoundation 0x00007fff8f1a0e75 CFRunLoopRunSpecific + 309 5 com.apple.AppKit 0x00007fff97a7805e _NSEventThread + 144 6 libsystem_pthread.dylib 0x00007fff8f7c2899 _pthread_body + 138 7 libsystem_pthread.dylib 0x00007fff8f7c272a _pthread_start + 137 8 libsystem_pthread.dylib 0x00007fff8f7c6fc9 thread_start + 13
Thread 6: 0 libsystem_kernel.dylib 0x00007fff955edcc2 __sigwait + 10 1 libsystem_pthread.dylib 0x00007fff8f7c6923 sigwait + 61 2 Racket 0x00000001030b9bb3 mz_proc_thread_signal_worker + 227 (place.c:876) 3 Racket 0x0000000103051595 mzrt_thread_stub + 85 (mzrt.c:170) 4 libsystem_pthread.dylib 0x00007fff8f7c2899 _pthread_body + 138 5 libsystem_pthread.dylib 0x00007fff8f7c272a _pthread_start + 137 6 libsystem_pthread.dylib 0x00007fff8f7c6fc9 thread_start + 13
Thread 7: 0 libsystem_kernel.dylib 0x00007fff955ed716 __psynch_cvwait + 10 1 libsystem_pthread.dylib 0x00007fff8f7c4c3b _pthread_cond_wait + 727 2 Racket 0x00000001030c0b4b do_watch + 75 (port.c:11199) 3 libsystem_pthread.dylib 0x00007fff8f7c2899 _pthread_body + 138 4 libsystem_pthread.dylib 0x00007fff8f7c272a _pthread_start + 137 5 libsystem_pthread.dylib 0x00007fff8f7c6fc9 thread_start + 13
Thread 8: 0 libsystem_kernel.dylib 0x00007fff955ed9aa __select + 10 1 Racket 0x00000001030d1c27 default_sleep + 631 (schthread.h:391) 2 Racket 0x0000000103189bbc check_sleep + 2348 (thread.c:4373) 3 Racket 0x000000010318e58c scheme_thread_block + 3756 (thread.c:5116) 4 Racket 0x000000010318ee66 scheme_block_until + 406 (thread.c:5253) 5 Racket 0x00000001030bebe6 place_receive + 342 (place.c:3624) 6 ??? 0x0000000104348114 0 + 4365517076 7 ??? 0x00000001043559cb 0 + 4365572555 8 Racket 0x0000000102f0ae6a scheme_do_eval + 6314 (schthread.h:394) 9 Racket 0x0000000102f3492b scheme_finish_apply_for_prompt + 603 (schthread.h:391) 10 Racket 0x0000000102f34ca0 scheme_apply_for_prompt + 96 (fun.c:6452) 11 Racket 0x0000000102f3d602 call_with_prompt + 1922 (fun.c:6951) 12 ??? 0x0000000104348114 0 + 4365517076 13 Racket 0x0000000102f0ae6a scheme_do_eval + 6314 (schthread.h:394) 14 Racket 0x0000000102f299a0 apply_k + 192 (fun.c:1503) 15 Racket 0x0000000102f3b893 scheme_top_level_do_worker + 1907 (fun.c:1327) 16 Racket 0x0000000103193077 start_child + 871 (thread.c:3125) 17 Racket 0x0000000103196484 make_subprocess + 660 (thread.c:3221) 18 Racket 0x0000000103196758 scheme_thread_w_details + 488 (thread.c:3421) 19 ??? 0x0000000105e5ba10 0 + 4393908752
Thread 9: 0 libsystem_kernel.dylib 0x00007fff955ed716 __psynch_cvwait + 10 1 libsystem_pthread.dylib 0x00007fff8f7c4c3b _pthread_cond_wait + 727 2 Racket 0x00000001030c0f45 green_thread_timer + 117 (port.c:11032) 3 Racket 0x0000000103051595 mzrt_thread_stub + 85 (mzrt.c:170) 4 libsystem_pthread.dylib 0x00007fff8f7c2899 _pthread_body + 138 5 libsystem_pthread.dylib 0x00007fff8f7c272a _pthread_start + 137 6 libsystem_pthread.dylib 0x00007fff8f7c6fc9 thread_start + 13
Thread 10: 0 libsystem_kernel.dylib 0x00007fff955ede6a __workq_kernreturn + 10 1 libsystem_pthread.dylib 0x00007fff8f7c3f08 _pthread_wqthread + 330 2 libsystem_pthread.dylib 0x00007fff8f7c6fb9 start_wqthread + 13
Thread 11: 0 libsystem_kernel.dylib 0x00007fff955ede6a __workq_kernreturn + 10 1 libsystem_pthread.dylib 0x00007fff8f7c3f08 _pthread_wqthread + 330 2 libsystem_pthread.dylib 0x00007fff8f7c6fb9 start_wqthread + 13
Thread 0 crashed with X86 Thread State (64-bit): rax: 0x000000017a478008 rbx: 0x0000000000000002 rcx: 0x0000000000000008 rdx: 0xfffffffffffffff8 rdi: 0x000000017a47bf90 rsi: 0x000000017e47bfd0 rbp: 0x00007fff5cd583e0 rsp: 0x00007fff5cd583e0 r8: 0x0000000000000003 r9: 0x00000001129adcb8 r10: 0x000000010326ec98 r11: 0xfffffffffc000000 r12: 0x0000000000000002 r13: 0x0000000000000002 r14: 0x0000000000000000 r15: 0x0000000004000000 rip: 0x00007fff90d730fe rfl: 0x0000000000010283 cr2: 0x000000017e47c000
Logical CPU: 0 Error Code: 0x00000004 Trap Number: 14
Binary Images:
0x102ea3000 - 0x102eaaff7 +org.racket-lang.DrRacket (6.1.1.8 - 6.1.1.8) <09E9F572-60F1-4113-9A80-287BBCF8F1F1> /Users/USER//DrRacket.app/Contents/MacOS/DrRacket
0x102eb0000 - 0x103250fe7 +Racket (0)
External Modification Summary: Calls made by other processes targeting this process: task_for_pid: 8 thread_create: 0 thread_set_state: 0 Calls made by this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by all processes on this machine: task_for_pid: 67278 thread_create: 1 thread_set_state: 0
VM Region Summary: ReadOnly portion of Libraries: Total=180.5M resident=58.7M(33%) swapped_out_or_unallocated=121.8M(67%) Writable regions: Total=690.9M written=401.8M(58%) resident=148.6M(22%) swapped_out=384.8M(56%) unallocated=542.2M(78%)
REGION TYPE VIRTUAL =========== ======= CG backing stores 6060K CG image 1108K CG raster data 24K CG shared images 244K CoreGraphics 12K CoreImage 8K Dispatch continuations 8192K IOKit 16.1M Kernel Alloc Once 8K MALLOC 172.7M MALLOC (admin) 32K Memory Tag 242 12K OpenCL 24K OpenGL GLSL 5632K SQLite page cache 384K STACK GUARD 56.0M Stack 27.7M VM_ALLOCATE 458.3M DATA 20.8M IMAGE 528K LINKEDIT 68.9M PLTSCHEME 8K TEXT 111.6M UNICODE 544K mapped file 125.1M shared memory 1.1G =========== ======= TOTAL 2.2G
I think I may have had an unsigned short overflow, or your system may have had a hard time with ~4MB VBOs. (It shouldn't, but there's no guaranteed minimum.) I've made a small change to the limits: now max 16K vertices (down from 64K), which entails ~1MB VBOs. Can you try again?
If it doesn't work, I'll audit the uses of memcpy and maybe futz around with alignment.
It works!
/Jens Axel
2015-02-01 13:25 GMT+01:00 Neil Toronto notifications@github.com:
I think I may have had an unsigned short overflow, or your system may have had a hard time with ~4MB VBOs. (It shouldn't, but there's no guaranteed minimum.) I've made a small change to the limits: now max 16K vertices (down from 64K), which entails ~1MB VBOs. Can you try again?
If it doesn't work, I'll audit the uses of memcpy and maybe futz around with alignment.
— Reply to this email directly or view it on GitHub https://github.com/ntoronto/pict3d/issues/5#issuecomment-72362778.
Jens Axel Søgaard
Awesome!
That was testing two things: short overflow and VBO size. Can you open "pict3d/private/engine/draw-pass.rkt" and change max-shape-vertex-count
to 32768
and try it again?
If you have the time to test it, I'd really like to know the smallest value that causes a crash.
After the change to 32768 the spaceship example runs fine as is. I tried run-anim and saw the balls around light animation, but then DrRacket hangs when I close the animation window.
Between the GLSL #version
hack and keeping the number of vertices below 32768 to avoid signed 16-bit int overflow, I think this one is fixed.
I see OSX support isn't on the TODO list. Is that because it's supposed to be done or just no longer a priority? I installed with
raco pkg install pict3d
(on today's snapshot build of racket v6.1.1.3) When I tried to run spaceship.rkt I get this error.