Bug 25719 - progs/perf/genmipmap segfaults in glGenerateMipmap()
Summary: progs/perf/genmipmap segfaults in glGenerateMipmap()
Status: RESOLVED NOTOURBUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-18 18:50 UTC by Will Dyson
Modified: 2010-11-23 12:26 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Will Dyson 2009-12-18 18:50:14 UTC
Mesa is git master at bf611cef29d664c2c2b56d2175c3a966c720e8b8. Using the r600 driver and 2.6.32+drm-radeon-testing with KMS enabled, but this happens even when I set LIBGL_SOFTWARE_RENDERING=true.

progs/perf/genmipmaps segfaults on the very first call to glGenerateMipmap().

Here is the backtrace:

#0  0x0000000000000000 in ?? ()
#1  0x000000000042b9df in GenMipmap (count=2) at genmipmap.c:84
#2  0x000000000042bc07 in PerfMeasureRate (f=0x42b970 <GenMipmap>) at common.c:76
#3  0x000000000042b910 in PerfDraw () at genmipmap.c:128
#4  0x000000000042be69 in Draw () at glmain.c:186
#5  0x00007ffff7bbc79d in fghRedrawWindow (window=0x660310, 
    enumerator=0x7fffffffdf40) at freeglut_main.c:212
#6  fghcbDisplayWindow (window=0x660310, enumerator=0x7fffffffdf40)
    at freeglut_main.c:229
#7  0x00007ffff7bbfb79 in fgEnumWindows (
    enumCallback=0x7ffff7bbc6f0 <fghcbDisplayWindow>, enumerator=0x7fffffffdf40)
    at freeglut_structure.c:388
#8  0x00007ffff7bbcc51 in fghDisplayAll () at freeglut_main.c:251
#9  glutMainLoopEvent () at freeglut_main.c:998
#10 0x00007ffff7bbd4a0 in glutMainLoop () at freeglut_main.c:1046
#11 0x000000000042be42 in main (argc=1, argv=0x7fffffffe1b8) at glmain.c:266


Interestingly, when I replace the call to glGenerateMipmap() with glGenerateMipmapEXT(), the segfault does not happen and the program seems to work.
Comment 1 Rafael Monica 2009-12-19 18:28:24 UTC
It does segfault here with R600 but not with software renderer. The environment variable to force the software renderer is LIBGL_ALWAYS_SOFTWARE not  LIBGL_SOFTWARE_RENDERING. Are you sure you were running the program with the software renderer when it segfaulted? If not, you should change it to R600 bug.
Comment 2 Rafael Monica 2009-12-19 19:52:21 UTC
On second thought, the radeonGenerateMipmap function isn't called at all. So maybe it is a mesa bug?

When run normal:
------------------------------------
0x08067fe3	84	      glGenerateMipmap(GL_TEXTURE_2D);
(gdb) si
0x00000000 in ?? ()


When forced to software renderer:
------------------------------------
0x08067fe3	84	      glGenerateMipmap(GL_TEXTURE_2D);
(gdb) si
0xb7f1b290 in glGenerateMipmapEXT () from /usr/lib/libGL.so.1
(gdb) si
0xb7f1b296 in glGenerateMipmapEXT () from /usr/lib/libGL.so.1
(gdb) si
_mesa_GenerateMipmapEXT (target=3553) at main/fbobject.c:1944
Comment 3 Ian Romanick 2009-12-19 22:30:26 UTC
The bug is that the test uses the GL_ARB_framebuffer_object version of the function, but the driver doesn't support GL_ARB_framebuffer_object.  It doesn't work.  *shock*  GLEW sees that the driver doesn't support GL_ARB_framebuffer_object, so it correctly never calls glXGetProcAddress on glGenerateMipmap.  Since the driver does support GL_EXT_framebuffer_object, it does call glXGetProcAddress on glGenerateMipmapEXT.
Comment 4 Brian Paul 2009-12-21 12:51:35 UTC
I've added a test for GL_ARB_framebuffer_object in genmipmap.c on the 7.7 branch.

If you want to submit a patch for using GL_EXT_framebuffer_object, feel free.
Comment 5 Hristo Ivanov 2010-11-21 05:02:56 UTC
Hello,

I can reproduce this bug every time, both with Fedora 13 and 14, latest KDE. Just enabling desktop effects causes the error. Please see the following bug reports, already posted to bugs.kde.org for backtraces (two, actually, one for fc13 and one for fc14, both are usable.)

https://bugs.kde.org/show_bug.cgi?id=257492
https://bugs.kde.org/show_bug.cgi?id=257508

BR,
Hristo
Comment 6 Ian Romanick 2010-11-23 12:26:06 UTC
(In reply to comment #5)
> Hello,
> 
> I can reproduce this bug every time, both with Fedora 13 and 14, latest KDE.
> Just enabling desktop effects causes the error. Please see the following bug
> reports, already posted to bugs.kde.org for backtraces (two, actually, one for
> fc13 and one for fc14, both are usable.)
> 
> https://bugs.kde.org/show_bug.cgi?id=257492
> https://bugs.kde.org/show_bug.cgi?id=257508

These appear to be a completely different bug.  They're also marked a duplicates of another bug.  That bug (https://bugs.kde.org/show_bug.cgi?id=243767) is marked as "fixed upstream."  Perhaps you need updated Mesa bits.

In any case, I'm closing this bug.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.