Bug 123817 - OS freezes.....
Summary: OS freezes.....
Keywords:
Status: CLOSED DUPLICATE of bug 73733
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel
Version: 3.0
Hardware: i686
OS: Linux
medium
high
Target Milestone: ---
Assignee: Arjan van de Ven
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-05-20 18:17 UTC by Need Real Name
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-02-21 19:03:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Need Real Name 2004-05-20 18:17:29 UTC
Description of problem:
Our in-house C code calls mlockall(MCL_CURRENT | MCL_FUTURE) to lock 
all current and future memory pages into RAM. When this routine gets 
executed it hangs the OS. Below (or on next page) is a sample C++ 
programme to demonstrate thi happening. It requires the nVidia 1.0-
4496 driver to be installed on the test machine.


Version-Release number of selected component (if applicable): 
glibc-2.3.2-95.6:

How reproducible: Every time


Steps to Reproduce:
1. Install nVidia driver v1.0-4496
2. Compile the above/enclosed C++ code - compile line is shown in the 
top lines of comments
3. Run the compiled executable
  
Actual results:
OS seems to freeze....


Expected results: Should open a glx


Additional info: We are using machines based on the Intel E7505 
chipset fitted with an nVidia FX3000 AGP card, 2 x 3.06G Xeons and 1G 
RAM.

Comment 1 Need Real Name 2004-05-20 18:18:49 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);
}

Comment 2 Jakub Jelinek 2004-05-20 19:25:29 UTC
This has nothing to do with glibc.

Comment 3 Arjan van de Ven 2004-07-07 07:53:56 UTC

*** This bug has been marked as a duplicate of 73733 ***

Comment 4 Red Hat Bugzilla 2006-02-21 19:03:23 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.


Note You need to log in before you can comment on or make changes to this bug.