comp.lang.ada
 help / color / mirror / Atom feed
* OpenGL gl.getstring produces erroneous memory access under GLOBE_3D on Mac
@ 2016-09-26  4:10 Roger
  2016-09-26  7:18 ` Simon Wright
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Roger @ 2016-09-26  4:10 UTC (permalink / raw)


Mac OSX 10.11.6
XCode 8.0
GNAT GPL 2016 (20160515-49)
globe_3d_release_2016-07-05

I have been writing quite a lot of OPenGL in Ada using GLOBE_3D.

However, I have just tried to "Checking for OpenGL functionality" as described in Apple's OpenGL Programming Guide for Mac.
However,  gl.GetString(GL.VENDOR) and other calls to  gl.GetString result in:
raised CONSTRAINT_ERROR : erroneous memory access

even if gl.GetString(GL.VENDOR)  is in the only instruction in the program.

Any ideas on what's causing this will be appreciated.

Roger

 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: OpenGL gl.getstring produces erroneous memory access under GLOBE_3D on Mac
  2016-09-26  4:10 OpenGL gl.getstring produces erroneous memory access under GLOBE_3D on Mac Roger
@ 2016-09-26  7:18 ` Simon Wright
  2016-09-26  9:31   ` G.B.
  2016-09-26 10:15 ` gautier_niouzes
  2016-09-27 15:57 ` Roger
  2 siblings, 1 reply; 8+ messages in thread
From: Simon Wright @ 2016-09-26  7:18 UTC (permalink / raw)


Roger <rogermc@grapevine.com.au> writes:

> Mac OSX 10.11.6
> XCode 8.0
> GNAT GPL 2016 (20160515-49)
> globe_3d_release_2016-07-05

> However, I have just tried to "Checking for OpenGL functionality" as
> described in Apple's OpenGL Programming Guide for Mac.  However,
> gl.GetString(GL.VENDOR) and other calls to gl.GetString result in:
> raised CONSTRAINT_ERROR : erroneous memory access
>
> even if gl.GetString(GL.VENDOR) is in the only instruction in the
> program.

Same here.

Running under gdb I get

Program received signal SIGSEGV, Segmentation fault.
0x00007fff92286c30 in glGetString ()
   from /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
(gdb) bt
#0  0x00007fff92286c30 in glGetString ()
   from /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
#1  0x000000010000602a in gl.getstring (name=vendor)
    at /Users/simon/adapilot/local/sjw/GLOBE_3D/bindings/gl.ads:3780
#2  0x0000000100006b8c in gl.getstring (name=vendor)
    at /Users/simon/adapilot/local/sjw/GLOBE_3D/bindings/gl.adb:66
#3  0x00000001000011d4 in t () at /Users/simon/adapilot/local/sjw/GLOBE_3D/t.adb:4

so I think you've come across a bug in Apple's libGL.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: OpenGL gl.getstring produces erroneous memory access under GLOBE_3D on Mac
  2016-09-26  7:18 ` Simon Wright
@ 2016-09-26  9:31   ` G.B.
  0 siblings, 0 replies; 8+ messages in thread
From: G.B. @ 2016-09-26  9:31 UTC (permalink / raw)


On 26.09.16 09:18, Simon Wright wrote:
> Roger <rogermc@grapevine.com.au> writes:
>
>> Mac OSX 10.11.6
>> XCode 8.0
>> GNAT GPL 2016 (20160515-49)
>> globe_3d_release_2016-07-05
>
>> However, I have just tried to "Checking for OpenGL functionality" as
>> described in Apple's OpenGL Programming Guide for Mac.  However,
>> gl.GetString(GL.VENDOR) and other calls to gl.GetString result in:
>> raised CONSTRAINT_ERROR : erroneous memory access
>>
>> even if gl.GetString(GL.VENDOR) is in the only instruction in the
>> program.
>
> Same here.
>
> Running under gdb I get
>
> Program received signal SIGSEGV, Segmentation fault.

> so I think you've come across a bug in Apple's libGL.
>


Similarly, a minimal C program produces Segmentation fault: 11.
However, some SO hints seem to say that for glGetString to work,
a context needs to have been created. I don't know what that means.


-- 
"HOTDOGS ARE NOT BOOKMARKS"
Springfield Elementary teaching staff


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: OpenGL gl.getstring produces erroneous memory access under GLOBE_3D on Mac
  2016-09-26  4:10 OpenGL gl.getstring produces erroneous memory access under GLOBE_3D on Mac Roger
  2016-09-26  7:18 ` Simon Wright
@ 2016-09-26 10:15 ` gautier_niouzes
  2016-09-26 10:21   ` Aurele
                     ` (2 more replies)
  2016-09-27 15:57 ` Roger
  2 siblings, 3 replies; 8+ messages in thread
From: gautier_niouzes @ 2016-09-26 10:15 UTC (permalink / raw)


What happens if you run get_gl_info.adb (*) ?
Perhaps there is some initialization needed (in get_gl_info.adb, done through 
GLUT.Init and GLUT.InitDisplayMode).
HTH
Gautier
___
(*) https://sourceforge.net/p/globe3d/code/HEAD/tree/tools/get_gl_info.adb


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: OpenGL gl.getstring produces erroneous memory access under GLOBE_3D on Mac
  2016-09-26 10:15 ` gautier_niouzes
@ 2016-09-26 10:21   ` Aurele
  2016-09-27  2:42   ` Roger
  2016-09-27  3:03   ` Roger
  2 siblings, 0 replies; 8+ messages in thread
From: Aurele @ 2016-09-26 10:21 UTC (permalink / raw)


Not entirely sure if this helps but "glGetString( GL_VENDOR )" works perfectly well on Window (tested on 64-bit Win10), no initialization needed.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: OpenGL gl.getstring produces erroneous memory access under GLOBE_3D on Mac
  2016-09-26 10:15 ` gautier_niouzes
  2016-09-26 10:21   ` Aurele
@ 2016-09-27  2:42   ` Roger
  2016-09-27  3:03   ` Roger
  2 siblings, 0 replies; 8+ messages in thread
From: Roger @ 2016-09-27  2:42 UTC (permalink / raw)


On Monday, September 26, 2016 at 8:15:04 PM UTC+10, gautier...@hotmail.com wrote:
> What happens if you run get_gl_info.adb (*) ?
> Perhaps there is some initialization needed (in get_gl_info.adb, done through 
> GLUT.Init and GLUT.InitDisplayMode).
> HTH
> Gautier
> ___
> (*) https://sourceforge.net/p/globe3d/code/HEAD/tree/tools/get_gl_info.adb

I built and ran get_gl_info which produced the following gl_info_text
GL.GetString:
  VENDOR: [Intel Inc.]
  RENDERER: [Intel HD Graphics 3000 OpenGL Engine]
  VERSION: [2.1 INTEL-10.0.51]
  EXTENSIONS: [GL_ARB_color_buffer_float
GL_ARB_depth_buffer_float
GL_ARB_depth_clamp
GL_ARB_depth_texture
GL_ARB_draw_buffers
GL_ARB_draw_elements_base_vertex
GL_ARB_draw_instanced
GL_ARB_fragment_program
GL_ARB_fragment_program_shadow
GL_ARB_fragment_shader
GL_ARB_framebuffer_object
GL_ARB_framebuffer_sRGB
GL_ARB_half_float_pixel
GL_ARB_half_float_vertex
GL_ARB_instanced_arrays
GL_ARB_multisample
GL_ARB_multitexture
GL_ARB_occlusion_query
GL_ARB_pixel_buffer_object
GL_ARB_point_parameters
GL_ARB_point_sprite
GL_ARB_provoking_vertex
GL_ARB_seamless_cube_map
GL_ARB_shader_objects
GL_ARB_shader_texture_lod
GL_ARB_shading_language_100
GL_ARB_shadow
GL_ARB_sync
GL_ARB_texture_border_clamp
GL_ARB_texture_compression
GL_ARB_texture_compression_rgtc
GL_ARB_texture_cube_map
GL_ARB_texture_env_add
GL_ARB_texture_env_combine
GL_ARB_texture_env_crossbar
GL_ARB_texture_env_dot3
GL_ARB_texture_float
GL_ARB_texture_mirrored_repeat
GL_ARB_texture_non_power_of_two
GL_ARB_texture_rectangle
GL_ARB_texture_rg
GL_ARB_transpose_matrix
GL_ARB_vertex_array_bgra
GL_ARB_vertex_blend
GL_ARB_vertex_buffer_object
GL_ARB_vertex_program
GL_ARB_vertex_shader
GL_ARB_window_pos
GL_EXT_abgr
GL_EXT_bgra
GL_EXT_blend_color
GL_EXT_blend_equation_separate
GL_EXT_blend_func_separate
GL_EXT_blend_minmax
GL_EXT_blend_subtract
GL_EXT_clip_volume_hint
GL_EXT_debug_label
GL_EXT_debug_marker
GL_EXT_draw_buffers2
GL_EXT_draw_range_elements
GL_EXT_fog_coord
GL_EXT_framebuffer_blit
GL_EXT_framebuffer_multisample
GL_EXT_framebuffer_object
GL_EXT_framebuffer_sRGB
GL_EXT_geometry_shader4
GL_EXT_gpu_program_parameters
GL_EXT_gpu_shader4
GL_EXT_multi_draw_arrays
GL_EXT_packed_depth_stencil
GL_EXT_packed_float
GL_EXT_provoking_vertex
GL_EXT_rescale_normal
GL_EXT_secondary_color
GL_EXT_separate_specular_color
GL_EXT_shadow_funcs
GL_EXT_stencil_two_side
GL_EXT_stencil_wrap
GL_EXT_texture_array
GL_EXT_texture_compression_dxt1
GL_EXT_texture_compression_s3tc
GL_EXT_texture_env_add
GL_EXT_texture_filter_anisotropic
GL_EXT_texture_integer
GL_EXT_texture_lod_bias
GL_EXT_texture_rectangle
GL_EXT_texture_shared_exponent
GL_EXT_texture_sRGB
GL_EXT_texture_sRGB_decode
GL_EXT_timer_query
GL_EXT_transform_feedback
GL_EXT_vertex_array_bgra
GL_APPLE_aux_depth_stencil
GL_APPLE_client_storage
GL_APPLE_element_array
GL_APPLE_fence
GL_APPLE_float_pixels
GL_APPLE_flush_buffer_range
GL_APPLE_flush_render
GL_APPLE_object_purgeable
GL_APPLE_packed_pixels
GL_APPLE_pixel_buffer
GL_APPLE_rgb_422
GL_APPLE_row_bytes
GL_APPLE_specular_vector
GL_APPLE_texture_range
GL_APPLE_transform_hint
GL_APPLE_vertex_array_object
GL_APPLE_vertex_array_range
GL_APPLE_vertex_point_size
GL_APPLE_vertex_program_evaluators
GL_APPLE_ycbcr_422
GL_ATI_separate_stencil
GL_ATI_texture_env_combine3
GL_ATI_texture_float
GL_ATI_texture_mirror_once
GL_IBM_rasterpos_clip
GL_NV_blend_square
GL_NV_conditional_render
GL_NV_depth_clamp
GL_NV_fog_distance
GL_NV_light_max_exponent
GL_NV_texgen_reflection
GL_NV_texture_barrier
GL_SGIS_generate_mipmap
GL_SGIS_texture_edge_clamp
GL_SGIS_texture_lod
]
GLUT.Get(WINDOW_NUM_SAMPLES): 4

Can OpenGL Extensions viewer help?
It seems to provide similar information.
Thanks,
Roger

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: OpenGL gl.getstring produces erroneous memory access under GLOBE_3D on Mac
  2016-09-26 10:15 ` gautier_niouzes
  2016-09-26 10:21   ` Aurele
  2016-09-27  2:42   ` Roger
@ 2016-09-27  3:03   ` Roger
  2 siblings, 0 replies; 8+ messages in thread
From: Roger @ 2016-09-27  3:03 UTC (permalink / raw)


On Monday, September 26, 2016 at 8:15:04 PM UTC+10, gautier...@hotmail.com wrote:
> What happens if you run get_gl_info.adb (*) ?
> Perhaps there is some initialization needed (in get_gl_info.adb, done through 
> GLUT.Init and GLUT.InitDisplayMode).
> HTH
> Gautier
> ___
> (*) https://sourceforge.net/p/globe3d/code/HEAD/tree/tools/get_gl_info.adb

I tried:
 GLUT.Init;
 GLUT.InitDisplayMode(GLUT.SINGLE);
 strVersionptr := gl.GetString(GL.VENDOR);

but the same problem occurred.
I'm wondering if it wants a window set up?
I don't think it should, as output to console is needed?
I not really sure what the InitDisplayMode should be set to; but I think GLUT.SINGLE should be OK!


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: OpenGL gl.getstring produces erroneous memory access under GLOBE_3D on Mac
  2016-09-26  4:10 OpenGL gl.getstring produces erroneous memory access under GLOBE_3D on Mac Roger
  2016-09-26  7:18 ` Simon Wright
  2016-09-26 10:15 ` gautier_niouzes
@ 2016-09-27 15:57 ` Roger
  2 siblings, 0 replies; 8+ messages in thread
From: Roger @ 2016-09-27 15:57 UTC (permalink / raw)


On Monday, September 26, 2016 at 2:10:42 PM UTC+10, Roger wrote:
> Mac OSX 10.11.6
> XCode 8.0
> GNAT GPL 2016 (20160515-49)
> globe_3d_release_2016-07-05
> 
> I have been writing quite a lot of OPenGL in Ada using GLOBE_3D.
> 
> However, I have just tried to "Checking for OpenGL functionality" as described in Apple's OpenGL Programming Guide for Mac.
> However,  gl.GetString(GL.VENDOR) and other calls to  gl.GetString result in:
> raised CONSTRAINT_ERROR : erroneous memory access
> 
> even if gl.GetString(GL.VENDOR)  is in the only instruction in the program.
> 
> Any ideas on what's causing this will be appreciated.
> 
> Roge
Now it works!
It just needed  a window to be declared:
GLUT.CreateWindow( "Test" )


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-09-27 15:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-26  4:10 OpenGL gl.getstring produces erroneous memory access under GLOBE_3D on Mac Roger
2016-09-26  7:18 ` Simon Wright
2016-09-26  9:31   ` G.B.
2016-09-26 10:15 ` gautier_niouzes
2016-09-26 10:21   ` Aurele
2016-09-27  2:42   ` Roger
2016-09-27  3:03   ` Roger
2016-09-27 15:57 ` Roger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox