[MacRuby-devel] OpenGL Bus Error

John Shea johnmacshea at gmail.com
Mon May 4 22:40:24 PDT 2009


Hi Timothy,

maybe you have figured it all out by now - but when doing openGL stuff  
it is usually in the context (literally and metaphorically) of an  
NSOpenGLView, you also have to overwrite the initWithFrame method and  
a few other methods in this class. Within the init method you set up  
the pixel depth, buffer type etc, and you have to make the  
openGLContext the current context.

I can send you a small Xcode sample if you like.

Cheers,
J


On May 4, 2009, at 11:36 PM, Timothy McDowell wrote:

> I was using the 'macirb' and this is what I got:
>
> I had entered this:
> dawnmcds-powerbook-g4-12:~ Tim$ macirb
> irb(main):001:0> framework 'cocoa'
> => true
> irb(main):002:0> framework 'opengl'
> => true
> irb(main):003:0> a = NSSize.new
> => #<NSSize width=0.0 height=0.0>
> irb(main):004:0> a
> => #<NSSize width=0.0 height=0.0>
> irb(main):005:0> a.width
> => 0.0
> irb(main):007:0> a.width = 640
> => 640
> irb(main):008:0> a.height = 480
> => 480
> irb(main):009:0> a
> => #<NSSize width=640.0 height=480.0>
> irb(main):010:0> glMatrixMode(GL_PROJECTION)
>
> and then the glMatrixMode call got me this bus error:
>
> (irb):10: [BUG] Bus Error
> MacRuby version 0.4 (ruby 1.9.1) [universal-darwin9.0, ppc]
>
> -- stack frame ------------
> 0000 (0x30040): 00000004
> 0001 (0x30044): 00000000
> 0002 (0x30048): 00000004
> 0003 (0x3004c): 00000000
> 0004 (0x30050): 00000004
> 0005 (0x30054): 00000000
> 0006 (0x30058): 00571940
> 0007 (0x3005c): 010cb370
> 0008 (0x30060): 0128e100
> 0009 (0x30064): 00000004
> 0010 (0x30068): 01411e60
> 0011 (0x3006c): 00000004
> 0012 (0x30070): 0056de80
> 0013 (0x30074): 00000004
> 0014 (0x30078): 000aff74
> 0015 (0x3007c): 00000004
> 0016 (0x30080): 01411e8c
> 0017 (0x30084): 0128e100
> 0018 (0x30088): 00000004
> 0019 (0x3008c): 01411f60
> 0020 (0x30090): 01069660
> 0021 (0x30094): 00000004
> 0022 (0x30098): 000afe94
> 0023 (0x3009c): 00000004
> 0024 (0x300a0): 0057a6f0
> 0025 (0x300a4): 00000004
> 0026 (0x300a8): 000afe5c
> 0027 (0x300ac): 00000004
> 0028 (0x300b0): 00030098 (= 22)
> 0029 (0x300b4): 00000004
> 0030 (0x300b8): 00000004
> 0031 (0x300bc): 000afdb4
> 0032 (0x300c0): 0144aab0
> 0033 (0x300c4): 00000004
> 0034 (0x300c8): 000300b0 (= 28)
> 0035 (0x300cc): 01438510
> 0036 (0x300d0): 00000015
> 0037 (0x300d4): 00000004
> 0038 (0x300d8): 01262e44
> 0039 (0x300dc): 00000004
> 0040 (0x300e0): 0056e740
> 0041 (0x300e4): 0056e110
> 0042 (0x300e8): 00000004
> 0043 (0x300ec): 000afcd4
> 0044 (0x300f0): 00000004
> 0045 (0x300f4): 00000004
> 0046 (0x300f8): 00000004
> 0047 (0x300fc): 00000004
> 0048 (0x30100): 00000004
> 0049 (0x30104): 00000004
> 0050 (0x30108): 00000004
> 0051 (0x3010c): 000300d8 (= 38)
> 0052 (0x30110): 0128dc30
> 0053 (0x30114): 01438510
> 0054 (0x30118): 00000015
> 0055 (0x3011c): 00000004
> 0056 (0x30120): 00000000
> 0057 (0x30124): 00000004
> 0058 (0x30128): 0128bf20
> 0059 (0x3012c): 0128dc30
> 0060 (0x30130): 01438510
> 0061 (0x30134): 0127c220
> 0062 (0x30138): 00000015
> 0063 (0x3013c): 00000004
> 0064 (0x30140): 00000000
> 0065 (0x30144): 00000004
> 0066 (0x30148): 01438510
> 0067 (0x3014c): 012b5910
> 0068 (0x30150): 0127c220
> 0069 (0x30154): 00000015
> 0070 (0x30158): 00000004
> 0071 (0x3015c): 00000000
> 0072 (0x30160): 00000004
> 0073 (0x30164): 00000000
> 0074 (0x30168): 00000004
> 0075 (0x3016c): 0144b180
> 0076 (0x30170): 00000004
> 0077 (0x30174): 00002e03
> 0078 (0x30178): 00000004
> 0079 (0x3017c): 00000000 <- lfp <- dfp
> -- control frame ----------
> c:0024 p:---- s:0080 b:0080 l:000079 d:000079 CFUNC  :glMatrixMode
> c:0023 p:0014 s:0076 b:0076 l:000214 d:001f64 EVAL   (irb):10
> c:0022 p:---- s:0074 b:0074 l:000073 d:000073 FINISH :empty?
> c:0021 p:---- s:0072 b:0072 l:000071 d:000071 CFUNC  :eval
> c:0020 p:0023 s:0065 b:0065 l:000064 d:000064 METHOD /Library/ 
> Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/irb/ 
> workspace.rb:80
> c:0019 p:0025 s:0058 b:0057 l:000056 d:000056 METHOD /Library/ 
> Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/irb/ 
> context.rb:218
> c:0018 p:0024 s:0052 b:0052 l:0024d4 d:000051 BLOCK  /Library/ 
> Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/irb.rb: 
> 149
> c:0017 p:0025 s:0044 b:0044 l:000043 d:000043 METHOD /Library/ 
> Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/irb.rb: 
> 263
> c:0016 p:0009 s:0039 b:0039 l:0024d4 d:000038 BLOCK  /Library/ 
> Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/irb.rb: 
> 146
> c:0015 p:0110 s:0035 b:0035 l:000022 d:000034 BLOCK  /Library/ 
> Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/irb/ 
> ruby-lex.rb:244
> c:0014 p:---- s:0034 b:0034 l:000033 d:000033 FINISH :block_given?
> c:0013 p:---- s:0032 b:0032 l:000031 d:000031 CFUNC  :loop
> c:0012 p:0007 s:0029 b:0029 l:000022 d:000028 BLOCK  /Library/ 
> Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/irb/ 
> ruby-lex.rb:230
> c:0011 p:---- s:0029 b:0029 l:000028 d:000028 FINISH :each
> c:0010 p:---- s:0027 b:0027 l:000026 d:000026 CFUNC  :catch
> c:0009 p:0017 s:0023 b:0023 l:000022 d:000022 METHOD /Library/ 
> Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/irb/ 
> ruby-lex.rb:229
> c:0008 p:0034 s:0020 b:0020 l:0024d4 d:0024d4 METHOD /Library/ 
> Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/irb.rb: 
> 145
> c:0007 p:0009 s:0017 b:0017 l:00130c d:000016 BLOCK  /Library/ 
> Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/irb.rb:69
> c:0006 p:---- s:0017 b:0017 l:000016 d:000016 FINISH :(null)
> c:0005 p:---- s:0015 b:0015 l:000014 d:000014 CFUNC  :catch
> c:0004 p:0147 s:0011 b:0011 l:00130c d:00130c METHOD /Library/ 
> Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/irb.rb:68
> c:0003 p:0033 s:0006 b:0006 l:000005 d:000005 TOP    /usr/local/bin/ 
> macirb:12
> c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH :inherited:
> c:0001 p:0000 s:0002 b:0002 l:000001 d:000001 TOP
> ---------------------------
> DBG> : "(irb):10:in `glMatrixMode'"
> DBG> : "(irb):10:in `irb_binding'"
> DBG> : "/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/irb/workspace.rb:80:in `eval'"
> DBG> : "/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/irb/workspace.rb:80:in `evaluate'"
> DBG> : "/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/irb/context.rb:218:in `evaluate'"
> DBG> : "/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/irb.rb:149:in `block (2 levels) in eval_input'"
> DBG> : "/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/irb.rb:263:in `signal_status'"
> DBG> : "/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/irb.rb:146:in `block in eval_input'"
> DBG> : "/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/irb/ruby-lex.rb:244:in `block (2 levels) in  
> each_top_level_statement'"
> DBG> : "/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/irb/ruby-lex.rb:230:in `loop'"
> DBG> : "/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/irb/ruby-lex.rb:230:in `block in each_top_level_statement'"
> DBG> : "/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/irb/ruby-lex.rb:229:in `catch'"
> DBG> : "/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/irb/ruby-lex.rb:229:in `each_top_level_statement'"
> DBG> : "/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/irb.rb:145:in `eval_input'"
> DBG> : "/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/irb.rb:69:in `block in start'"
> DBG> : "/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/irb.rb:68:in `catch'"
> DBG> : "/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/irb.rb:68:in `start'"
> DBG> : "/usr/local/bin/macirb:12:in `<main>'"
> -- backtrace of native function call (Use addr2line) --
> 0x2ec838
> 0x20778c
> 0x2077f8
> 0x2a2934
> 0x941fc99c
> -------------------------------------------------------
> Abort trap
>
> Any help? I installed with the PPC instructions on the macruby wiki.
>
> -- 
> --Timothy.
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel



More information about the MacRuby-devel mailing list