Bug 123817
| Summary: | OS freezes..... | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 3 | Reporter: | Need Real Name <jerry.clark> |
| Component: | kernel | Assignee: | Arjan van de Ven <arjanv> |
| Status: | CLOSED DUPLICATE | QA Contact: | Brian Brock <bbrock> |
| Severity: | high | Docs Contact: | |
| Priority: | medium | ||
| Version: | 3.0 | ||
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | i686 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2006-02-21 19:03:23 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Need Real Name
2004-05-20 18:17:29 UTC
This is the C++ code - it should be executed as root.
// Sample prog locks out scheduler when run as root
// COMPILE
// g++ -g -Wall -W -g -Wno-unused-parameter -L/usr/X11R6/lib -lglut -
lGL -lGLU -lglut glx.cpp -o glx -lXi -lXmu
#include <stdio.h>
#include <sys/mman.h>
#include <iostream>
#include <string>
#include <GL/glx.h>
using namespace std;
Window win;
Display *dpy;
GLXWindow gwin;
GLXContext cx;
GLint AttributeList12[] = { GLX_RGBA,
GLX_DOUBLEBUFFER, True, None};
Bool WaitForNotify(Display *d, XEvent *e, char
*arg);
/****************************************/
int main(int argc, char *argv[])
{
XEvent event;
XVisualInfo *vi;
Colormap cmap;
XSetWindowAttributes swa;
cerr << "MLockall\n";
// Comment out this to stop locking
mlockall(MCL_FUTURE|MCL_CURRENT);
// get a connection
cerr << "XOpenDisplay\n";
dpy = XOpenDisplay(0);
// Find a FBConfig that uses RGBA. Note that no attribute list is
// needed since GLX_RGBA_BIT is a default attribute.
cerr << "Create Visual\n";
vi = glXChooseVisual(dpy, DefaultScreen(dpy),
AttributeList12);
cx = glXCreateContext(dpy, vi, 0, GL_TRUE);
cmap = XCreateColormap(dpy, RootWindow(dpy, vi->screen),vi-
>visual, AllocNone);
cerr << "Create Window\n";
swa.colormap = cmap;
swa.border_pixel = 0;
swa.event_mask =
ExposureMask|StructureNotifyMask|KeyPressMask;
win = XCreateWindow(dpy, RootWindow(dpy, vi->screen), 0, 0,
720, 576, 0, vi->depth, InputOutput,
vi->visual, CWBorderPixel|CWColormap|CWEventMask, &swa);
XMapWindow(dpy, win);
XIfEvent(dpy, &event, WaitForNotify, (XPointer)win);
glXMakeCurrent(dpy, win, cx);
cerr << "Visual ID Created - now exiting: " << hex << vi-
>visualid << "\n";
exit(0);
}
/***************************************************/
Bool WaitForNotify(Display *d, XEvent *e, char *arg)
{
return (e->type == MapNotify) && (e->xmap.window == (Window)
arg);
}
This has nothing to do with glibc. *** This bug has been marked as a duplicate of 73733 *** Changed to 'CLOSED' state since 'RESOLVED' has been deprecated. |