The problem fixed by this patch can be reproduced on Linux with the
following steps.
- Access NULL pointer intentionally in ProcessOtherEvent on key press.
- Instead of saving core dump to a file, write it into a pipe.
echo "|/usr/sbin/my-core-dumper" > /proc/sys/kernel/core_pattern
- Dump the core by pressing a key.
While the core is being dumped into the pipe, the smart schedule timer
will cause a pending SIGALRM. Linux kernel stops writing data to the
pipe when there are pending signals. This causes the core dump to be
truncated. On my system I'm expecting a 6 MB dump but the size will be
60 kB instead. The problem is solved if we block the SIGALRM caused by
expired smart schedule timer.
I haven't been able to reproduce this problem in the following cases.
- Save core dump to a file instead of a pipe.
- kill -SEGV `pidof Xorg`
- Press a key to dump core while gdb is attached to Xorg.
- Give option -dumbSched to Xorg.
Also note that the fix works only when NoTrapSignals has the default
value FALSE. The problem can still be reproduced if error signals
aren't trapped. In addition to pending SIGALRM, there is a similar
problem with pending SIGIO from the keyboard driver during core dump.
Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
The main change is cleanup of the visualConfigs and setting up alpha correctly there to match the visuals being added earlier (so the default visual has a corresponding GLX visual)
(cherry picked from commit 7351db5c87)
This should fix some issues when building on different versions of OSX. We only use extensions that OpenGL.framework's glext.h header tells us are supported.
(cherry picked from commit e10c53421f)
This was causing a crash randomly, due to random memory contents.
Use xcalloc to prevent this in the future, due to future changes or mistakes.
Set the drawableType to include GLX_PIXMAP_BIT and GLX_PBUFFER_BIT.
The new libGL supports these.
Set the max Pbuffer width/height, based on the results of a test program.
We may someday want to revisit this depending on what users need, so that
we create a CGLContextObj, make it current, and call glGetIntegerv to
gather the information at runtime.
(cherry picked from commit c7e3383309)
There were a few spots left in the source that were using the
--with-mesa-source defined headers or the now removed $(top_srcdir)/GL
directory. These aren't needed anymore as all the necessary source for
GLX is in $(top_srcdir)/glx.
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Reorder some header files and provide some types earlier on.
Remove the static __GLXextensionInfo __glDDXExtensionInfo; that isn't
used in 1.4 or 1.5, and seems to have been removed from 1.6. Remove
the data structures associated with that too.
Remove __glXAquaDrawableResize. The GLX structure doesn't use
it anymore, and the Apple version did nothing useful before.
__glXAquaDrawableSwapBuffers(): base no longer contains a drawGlxc
member. Now provide the the Apple/Aqua context in the __GLXAquaDrawable
struct. Add the context member to the __GLXAquaDrawable struct.
Remove the fallback configs. They aren't used in 1.4 or 1.5 either.
Remove init_visuals(). It's not used in 1.4 or 1.5 either.
In the drawable constructor initialize the state properly, including
the new context member.
Remove glAquaResetExtension() -- it's not used anymore.
This has been tested remotely and proven to work with glxgears,
fire, various texture programs I wrote, and various Mesa demos.
(cherry picked from commit d514152195)
Use a __GLXconfig linked list struct to store the configurations for the
fbconfigs and visuals in a pGlxScreen.
Also, remove the __GLXvisualConfig/GlxSetVisualConfigs code that isn't used
anymore. There is more code we can remove later, but I want to do that in
separate commits.
(cherry picked from commit 94162b0f8a)
Add various GLX extensions to the list of supported extensions.
Reformat the oddly formatted code in some areas.
Use xalloc and xfree instead of malloc and free.
(cherry picked from commit 755f53eb40)
Add some commentary about future directions needed for the GLX drawable
creation and destruction code.
Match xalloc with xfree.
I made some minor formatting improvements.
(cherry picked from commit b772d64fce)
In attach() check for pDraw being NULL, and also print an ErrorF message,
because we eventually want to track down why this is occuring.
It's unclear how this occurs, but as I noted in the 1.4 branch, I believe that
the DrawablePtr/struct _Drawable -> id is the member being accessed that causes
KERN_PROTECTION_FAILURE at 0x0000000000000004
This passes my tests using: env LIBGL_ALWAYS_INDIRECT=1 ./sometest.
I fixed a warning: caused by initializing the screen->base.visuals with the
configs. It is a ** not a *. It seems that some other part of GLX will
initialize this for us.
(cherry picked from commit 17f6a261fc)
This prevents visuals with odd sizes. The machine I use didn't have
this problem, but it shows up on some others.
(cherry picked from commit ed181382dd)
GL/capabilities.c: Add handleDepthModes(), and extend
handleRendererDescription() for the various depth and multisampling flags.
Add initialization of the new config options to initConfig().
GL/capabilities.h: Add depth and multisample config members.
GL/visualConfigs.c: Add depth and multisampling support to the visual config
setup.
(cherry picked from commit f527381eea)
GL/capabilities.c: #if 0 (for now) any capabilities above 8 bits per channel,
because they introduce drawing problems.
GL/indirect.c: Comment out some visual setup code that shouldn't be running, and
actually seemed to cause some problems. The current visualConfigs.c code seems
to do a reasonable job of setting up visuals for XQuartz.
GL/visualConfigs.c: Make use of the proper visual .class. Eliminate depth 0.
It seems we really just want 24 for now, and 0 I think was a flaw in the original
code.
(cherry picked from commit 1e5f63f15e)
This is used in libGL to determine a preferred visual. glxinfo -v will also
report "visualCaveat=Slow" for such visuals.
(cherry picked from commit d5c17f585a)
This gives us a *lot* more visuals, and they should be more accurate.
Some of the visuals may have been wrong before. This may enable more
OpenGL programs to behave correctly.
I also suspect libGL needs a little work to handle some of these correctly.
(cherry picked from commit 98a084ce9c)
We need to revisit the GL/indirect.c changes. I think indirect.c should
be using the same feature detection and GLX visual config code. The
indirect changes will require testing...
(cherry picked from commit 49b7a7c6f2)
Use ErrorF for an error message after an xcalloc failure, and return instead of falling through to GlxSetVisualConfigs, or abort()ing at the test branch.
(cherry picked from commit 1056700971)