Segmentation Fault in Linux
-
- Snes9x White Belt
- Posts: 13
- Joined: Tue Feb 16, 2010 3:38 am
Segmentation Fault in Linux
I wonder if the latest version of snes9x-gtk requires OpenGL 2 since every time I choose OpenGL for hardware aceleration I get no graphics on screen (audio plays just fine) and if I activate either "alllow non power of two textures" and/or "use pixel buffer objects" the window closes with only a "segmentation fault" as error message.
I compiled my own binary without any problems.
My OpenGL version is 1.5 (works ok with Google Earth and Stella) and I am using Puppy Linux 4.1.2 w/GCC 4.2.2 on a one Ghz (fsb 133) pIII with an nvidia vanta card (using the latest nvidia drivers released for it).
Edit: I forgot to mention I am using SDL 1.2.14
I compiled my own binary without any problems.
My OpenGL version is 1.5 (works ok with Google Earth and Stella) and I am using Puppy Linux 4.1.2 w/GCC 4.2.2 on a one Ghz (fsb 133) pIII with an nvidia vanta card (using the latest nvidia drivers released for it).
Edit: I forgot to mention I am using SDL 1.2.14
-
- Snes9x White Belt
- Posts: 13
- Joined: Tue Feb 16, 2010 3:38 am
Here it is:BearOso wrote:Could you post the output of your "glxinfo" command?
Code: Select all
name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: NVIDIA Corporation
server glx version string: 1.3
server glx extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer, GLX_SGI_video_sync, GLX_SGI_swap_control
client glx vendor string: NVIDIA Corporation
client glx version string: 1.3
client glx extensions:
GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_visual_info,
GLX_EXT_visual_rating, GLX_EXT_import_context, GLX_SGI_video_sync,
GLX_NV_swap_group, GLX_NV_video_out, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
GLX_SGI_swap_control, GLX_NV_float_buffer
GLX version: 1.3
GLX extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer, GLX_SGI_video_sync, GLX_SGI_swap_control,
GLX_ARB_get_proc_address
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: RIVA TNT2/AGP/SSE
OpenGL version string: 1.5.3 NVIDIA 71.86.06
OpenGL extensions:
GL_ARB_imaging, GL_ARB_multitexture, GL_ARB_point_parameters,
GL_ARB_texture_env_add, GL_ARB_texture_mirrored_repeat,
GL_ARB_transpose_matrix, GL_ARB_vertex_buffer_object, GL_ARB_window_pos,
GL_EXT_texture_env_add, GL_EXT_abgr, GL_EXT_bgra,
GL_EXT_compiled_vertex_array, GL_EXT_draw_range_elements,
GL_EXT_fog_coord, GL_EXT_multi_draw_arrays, GL_EXT_packed_pixels,
GL_EXT_pixel_buffer_object, GL_EXT_point_parameters,
GL_EXT_rescale_normal, GL_EXT_secondary_color,
GL_EXT_separate_specular_color, GL_EXT_stencil_wrap,
GL_EXT_texture_edge_clamp, GL_EXT_texture_env_combine,
GL_EXT_texture_lod_bias, GL_EXT_texture_object, GL_EXT_vertex_array,
GL_IBM_rasterpos_clip, GL_IBM_texture_mirrored_repeat,
GL_KTX_buffer_region, GL_NV_blend_square, GL_NV_fog_distance,
GL_NV_light_max_exponent, GL_NV_packed_depth_stencil,
GL_NV_texgen_reflection, GL_NV_texture_env_combine4, GL_SGIS_multitexture,
GL_SUN_slice_accum
visual x bf lv rg d st colorbuffer ax dp st accumbuffer ms cav
id dep cl sp sz l ci b ro r g b a bf th cl r g b a ns b eat
----------------------------------------------------------------------
0x21 16 tc 0 16 0 r y . 5 6 5 0 4 16 0 16 16 16 16 0 0 None
0x22 16 dc 0 16 0 r y . 5 6 5 0 4 16 0 16 16 16 16 0 0 None
0x23 16 tc 0 16 0 r . . 5 6 5 0 4 16 0 16 16 16 16 0 0 None
0x24 16 tc 0 16 0 r y . 5 6 5 0 4 0 0 16 16 16 16 0 0 None
0x25 16 tc 0 16 0 r . . 5 6 5 0 4 0 0 16 16 16 16 0 0 None
0x26 16 dc 0 16 0 r . . 5 6 5 0 4 16 0 16 16 16 16 0 0 None
0x27 16 dc 0 16 0 r y . 5 6 5 0 4 0 0 16 16 16 16 0 0 None
0x28 16 dc 0 16 0 r . . 5 6 5 0 4 0 0 16 16 16 16 0 0 None
Is this all the visuals you're getting, or did you truncate the list? There are no 24/32 bit visuals here, and that will certainly cause problems with reuse of the GDK window.mangamuscle wrote:Code: Select all
visual x bf lv rg d st colorbuffer ax dp st accumbuffer ms cav id dep cl sp sz l ci b ro r g b a bf th cl r g b a ns b eat ---------------------------------------------------------------------- 0x21 16 tc 0 16 0 r y . 5 6 5 0 4 16 0 16 16 16 16 0 0 None 0x22 16 dc 0 16 0 r y . 5 6 5 0 4 16 0 16 16 16 16 0 0 None 0x23 16 tc 0 16 0 r . . 5 6 5 0 4 16 0 16 16 16 16 0 0 None 0x24 16 tc 0 16 0 r y . 5 6 5 0 4 0 0 16 16 16 16 0 0 None 0x25 16 tc 0 16 0 r . . 5 6 5 0 4 0 0 16 16 16 16 0 0 None 0x26 16 dc 0 16 0 r . . 5 6 5 0 4 16 0 16 16 16 16 0 0 None 0x27 16 dc 0 16 0 r y . 5 6 5 0 4 0 0 16 16 16 16 0 0 None 0x28 16 dc 0 16 0 r . . 5 6 5 0 4 0 0 16 16 16 16 0 0 None
-
- Snes9x White Belt
- Posts: 13
- Joined: Tue Feb 16, 2010 3:38 am
Yeah, that is the complete list. ATM I need to use a 16-bit resolution screen mode since I am using a TV (full HD) as a monitor and I thought 16 bit was enough for snes since it had a 15 bit color palette.BearOso wrote:Is this all the visuals you're getting, or did you truncate the list? There are no 24/32 bit visuals here, and that will certainly cause problems with reuse of the GDK window.
Edit: I tried to use fullscreen mode to no avail, it seems it does not change the bit depth to 24 or 32 bits.
Unfortunately, changing the display depth probably won't make a difference unless the nvidia drivers limit the available GLX visuals to that. GDK always creates a truecolor (24/32 bit) visual, and the OpenGL code in the program reuses the window GDK creates for its display. What might be happening is that the lack of a truecolor GLX framebuffer is preventing output to a truecolor visual.
I could probably get around this by creating a sub-window like with Xv. Can you try running bsnes and seeing if the OpenGL driver there produces an image? (obviously it isn't going to run at full speed)
I could probably get around this by creating a sub-window like with Xv. Can you try running bsnes and seeing if the OpenGL driver there produces an image? (obviously it isn't going to run at full speed)
-
- Snes9x Brown Belt
- Posts: 1158
- Joined: Mon Jan 10, 2005 6:34 am
Re: Segmentation Fault in Linux
The latter two features (the options you put in quotes) are specifically not available for your old hardware. You would need an FX card or better to even have the options.mangamuscle wrote:I wonder if the latest version of snes9x-gtk requires OpenGL 2 since every time I choose OpenGL for hardware aceleration I get no graphics on screen (audio plays just fine) and if I activate either "alllow non power of two textures" and/or "use pixel buffer objects" the window closes with only a "segmentation fault" as error message.
I compiled my own binary without any problems.
My OpenGL version is 1.5 (works ok with Google Earth and Stella) and I am using Puppy Linux 4.1.2 w/GCC 4.2.2 on a one Ghz (fsb 133) pIII with an nvidia vanta card (using the latest nvidia drivers released for it).
Edit: I forgot to mention I am using SDL 1.2.14
Continuing FF4 Research...
-
- Snes9x White Belt
- Posts: 13
- Joined: Tue Feb 16, 2010 3:38 am
I managed to change the color depth to 24 bit (for some reason 32 bit is unattainable in X) but even then I got no video output. This seems weird to me, here is the new info glxinfo gave in 24 bit mode:BearOso wrote:Unfortunately, changing the display depth probably won't make a difference unless the nvidia drivers limit the available GLX visuals to that. GDK always creates a truecolor (24/32 bit) visual, and the OpenGL code in the program reuses the window GDK creates for its display. What might be happening is that the lack of a truecolor GLX framebuffer is preventing output to a truecolor visual.
Code: Select all
visual x bf lv rg d st colorbuffer ax dp st accumbuffer ms cav
id dep cl sp sz l ci b ro r g b a bf th cl r g b a ns b eat
----------------------------------------------------------------------
0x21 24 tc 0 32 0 r y . 8 8 8 0 4 24 8 16 16 16 16 0 0 None
0x22 24 dc 0 32 0 r y . 8 8 8 0 4 24 8 16 16 16 16 0 0 None
0x23 24 tc 0 32 0 r y . 8 8 8 8 4 24 8 16 16 16 16 0 0 None
0x24 24 tc 0 32 0 r . . 8 8 8 0 4 24 8 16 16 16 16 0 0 None
0x25 24 tc 0 32 0 r . . 8 8 8 8 4 24 8 16 16 16 16 0 0 None
0x26 24 tc 0 32 0 r y . 8 8 8 0 4 0 0 16 16 16 16 0 0 None
0x27 24 tc 0 32 0 r y . 8 8 8 8 4 0 0 16 16 16 16 0 0 None
0x28 24 tc 0 32 0 r . . 8 8 8 0 4 0 0 16 16 16 16 0 0 None
0x29 24 tc 0 32 0 r . . 8 8 8 8 4 0 0 16 16 16 16 0 0 None
0x2a 24 dc 0 32 0 r y . 8 8 8 8 4 24 8 16 16 16 16 0 0 None
0x2b 24 dc 0 32 0 r . . 8 8 8 0 4 24 8 16 16 16 16 0 0 None
0x2c 24 dc 0 32 0 r . . 8 8 8 8 4 24 8 16 16 16 16 0 0 None
0x2d 24 dc 0 32 0 r y . 8 8 8 0 4 0 0 16 16 16 16 0 0 None
0x2e 24 dc 0 32 0 r y . 8 8 8 8 4 0 0 16 16 16 16 0 0 None
0x2f 24 dc 0 32 0 r . . 8 8 8 0 4 0 0 16 16 16 16 0 0 None
0x30 24 dc 0 32 0 r . . 8 8 8 8 4 0 0 16 16 16 16 0 0 None
I tried my best, but I cannot compile bsnes on this pc (only 4 gb hard disk, running low in free space) and I searched precompiled binaries but either they required glibc 2.7 or (version 0.55) ran without showing any video or sound at all (changed the available drivers in bsnes preferences menu to no avail).I could probably get around this by creating a sub-window like with Xv. Can you try running bsnes and seeing if the OpenGL driver there produces an image? (obviously it isn't going to run at full speed)
I undestand, but I think both options should be detected to be unavailable and presented as greyed out (unselectable).Deathlike2 wrote:The latter two features (the options you put in quotes) are specifically not available for your old hardware. You would need an FX card or better to even have the options.
-
- Snes9x Brown Belt
- Posts: 1158
- Joined: Mon Jan 10, 2005 6:34 am
Simple reason: I can't check the extension string until the OpenGL driver is loaded, and it isn't loaded until the user hits Apply or OK to actually set the driver. The options aren't used if the extensions aren't found, though. I suppose the extension string check is what's somehow causing the segmentation fault.Deathlike2 wrote:Yea, sure. Obviously the options should be available when the extensions are available.
This is probably related. I'll have to look and see what Stella does differently.mangamuscle wrote:I tried my best, but I cannot compile bsnes on this pc (only 4 gb hard disk, running low in free space) and I searched precompiled binaries but either they required glibc 2.7 or (version 0.55) ran without showing any video or sound at all (changed the available drivers in bsnes preferences menu to no avail).
I've updated the OpenGL driver in SVN. Instructions for checkout are here: http://code.google.com/p/snes9x-gtk/source/checkout. Since you mentioned you compiled your binary, I'm assuming you can compile this source, too.
This revision adds more robust error-checking. It's not going to fix anything, but if you run it from a terminal window, it'll tell you what I need to fix.
This revision adds more robust error-checking. It's not going to fix anything, but if you run it from a terminal window, it'll tell you what I need to fix.
-
- Snes9x White Belt
- Posts: 13
- Joined: Tue Feb 16, 2010 3:38 am
I downloaded r292 and compiled it (needed some configuration files from the previous source I downloaded) and when I try to activate OpenGL mode all I get is an anti-climatic glxMakeCurrent Failed at the terminal window followed by the usual Segmentation Fault. I hope this proves to be useful.BearOso wrote:This revision adds more robust error-checking. It's not going to fix anything, but if you run it from a terminal window, it'll tell you what I need to fix.
You're supposed to run the included autogen.sh script to generate those configuration files. 
I imagine the glXMakeCurrent failing was a BadMatch between the visuals. I've changed the code to create a new window with the visual rather than assuming it can do the color conversion. Could you try the latest SVN and see if it works now?

I imagine the glXMakeCurrent failing was a BadMatch between the visuals. I've changed the code to create a new window with the visual rather than assuming it can do the color conversion. Could you try the latest SVN and see if it works now?
-
- Snes9x White Belt
- Posts: 13
- Joined: Tue Feb 16, 2010 3:38 am
I downloaded the r293 source, ran autogen.sh, ./configure and make but I keep getting an error when compiling:BearOso wrote: Could you try the latest SVN and see if it works now?
make[1]: *** No rule to make target `fxemu2b.o', needed by `snes9x-gtk'. Stop.
I did my best to try to fix it but I could not find the bloody bug

-
- Snes9x White Belt
- Posts: 13
- Joined: Tue Feb 16, 2010 3:38 am
I had deleted the directory where I downloaded r292 before downloading r293, so I just added --without-assembler and it compiled painlessly. OpenGL now shows graphics and the options "Allow non power of two textures" and "use pixel shader objets" do not crash the application (I don't know if they are really doing anything, frame rate is too bumpy). The only way I could crash the application was by selecting 32-bit (GL_BGRA) in the pixel-buffer format. In a few minutes I will test if this pattern repeats if I downgrade screen resolution to 16 bit (breakfast comes first!).BearOso wrote:For now, just add --without-assembler to the configure script. And make sure that it's a clean checkout, not on top of an older version.
Acivating the GLSL shader option also crashes the application, but that was kind of expeting it to.
You _are_ getting pixel-buffer-objects support. It's in your extension string. (Note that this isn't shaders--it's just a fast way of uploading data) I think I know why it's crashing with 32-bit format, but there's really no way of checking whether or not the card supports it.mangamuscle wrote: I had deleted the directory where I downloaded r292 before downloading r293, so I just added --without-assembler and it compiled painlessly. OpenGL now shows graphics and the options "Allow non power of two textures" and "use pixel shader objets" do not crash the application (I don't know if they are really doing anything, frame rate is too bumpy). The only way I could crash the application was by selecting 32-bit (GL_BGRA) in the pixel-buffer format.
It shouldn't have crashed there. I copied-and-pasted a section of code and forgot to change the string.In a few minutes I will test if this pattern repeats if I downgrade screen resolution to 16 bit (breakfast comes first!).
Acivating the GLSL shader option also crashes the application, but that was kind of expeting it to.
-
- Snes9x White Belt
- Posts: 13
- Joined: Tue Feb 16, 2010 3:38 am
*after some tacos, cake and coffe for breakfast*
I think I misreported that, it is not crashing if I select 16 or 24 or 32 pixel-buffer format, until I load a game. In 16 bit depth resolution it crashes when I slect 16 bit pixel-buffer format (wtf!?) and in 24 bit depth resolution it crashes when in 16 or 32 bit pixel-buffer format O_o;BearOso wrote:I think I know why it's crashing with 32-bit format, but there's really no way of checking whether or not the card supports it.
... it definetively is crashing when I choose "Use GLSL shaders" (mind you, I do not load any vertex or fragment shader as I have neither), the problem is that the crashing is not consistent, sometimes it crashes the first time, other times I have to do it five times (when testing this option I did not had a game loaded). The only consistent behavior i that every time I try to activate it, it displays in the terminal window Cannot load GLSL shader functions.It shouldn't have crashed there. I copied-and-pasted a section of code and forgot to change the string.
What I meant was that I fixed the bug and posted the change to SVN. If you try that code, it'll properly detect that the extension isn't there and not crash.mangamuscle wrote: ... it definetively is crashing when I choose "Use GLSL shaders" (mind you, I do not load any vertex or fragment shader as I have neither), the problem is that the crashing is not consistent, sometimes it crashes the first time, other times I have to do it five times (when testing this option I did not had a game loaded). The only consistent behavior i that every time I try to activate it, it displays in the terminal window Cannot load GLSL shader functions.
As far as the PBO depth issue is concerned--I'm not sure what the exact problem is, but the extension string is probably lying when it claims GL_EXT_pixel_buffer_object and GL_EXT_bgra because otherwise the 32-bit format would work every time.
-
- Snes9x White Belt
- Posts: 13
- Joined: Tue Feb 16, 2010 3:38 am
Yep, downloaded r295 and no more crashes when trying to activate this option, albeit it would be nice if the Cannot load GLSL shader functions. appeared in a windows instead of in the terminal.BearOso wrote:What I meant was that I fixed the bug and posted the change to SVN. If you try that code, it'll properly detect that the extension isn't there and not crash.
Though I still needed --without-assembler to create the binary; I forgot to mention last time, but when I use autogen.sh I get this error messages:
Code: Select all
Please add the files
codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.m4
progtest.m4
from the /aclocal directory to your autoconf macro directory
or directly to your aclocal.m4 file.
You will also need config.guess and config.sub, which you can get from
ftp://ftp.gnu.org/pub/gnu/config/.
/usr/share/aclocal/nspr.m4:8: warning: underquoted definition of AM_PATH_NSPR
run info '(automake)Extending aclocal'
or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
/usr/share/aclocal/audiofile.m4:12: warning: underquoted definition of AM_PATH_AUDIOFILE
If I were using an ATI card I would say you are right, but NVIDIA's drivers are accurate AFAIK. I suppose there must be a reason that explains this odd behavior ... is there an SDL or OpenGL guru in the audience?As far as the PBO depth issue is concerned--I'm not sure what the exact problem is, but the extension string is probably lying when it claims GL_EXT_pixel_buffer_object and GL_EXT_bgra because otherwise the 32-bit format would work every time.