BadAlloc & XAllocColor with Xvfb - Xwindows

This is a discussion on BadAlloc & XAllocColor with Xvfb - Xwindows ; Hi Everyone, I apologize if this is obvious but I'm fairly new to X Windows so I may be missing something obvious. I have an application that I run using a NCD X Termainal and SuSe's Xvfb. On the NCD ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: BadAlloc & XAllocColor with Xvfb

  1. BadAlloc & XAllocColor with Xvfb

    Hi Everyone,

    I apologize if this is obvious but I'm fairly new to X Windows so I
    may be missing something obvious.

    I have an application that I run using a NCD X Termainal and SuSe's
    Xvfb. On the NCD the application runs fine. I have tried to make
    xdpyinfo as simliar as possible between the 2 X servers. (xdpyinfo at
    end of message) When using Xvfb I am able to get an image of the
    display when needed by using xwud. When running Xvfb I use the
    following command:
    "Xvfb :3 -ac -query joeServer -screen 0 1024x768x8 +bs -fbdir /tmp"
    (I also use xmodmap to load the keymap from the NCD into the display -
    so the keycodes will match)

    When I run it using SuSe's Xvfb - I get a bunch of protocol errors
    with errorcode 11 (BadAlloc) with a major opcode of 84(AllocColor).
    From the various documentation I can find - XAllocColor generates the
    Request AllocColor. But it doesn't generate BadAlloc errors - just
    BadColor errors. From further reading I have found that
    XCreateColormap can generate the BadAlloc error.

    So Question #1 is:
    Which function generated the error ?

    I was able to get rid of the error by increasing the number of planes
    that Xvfb uses to 24 - but now they don't match the number of planes
    that the NCD Xterm uses and I can't get an image of the screen with
    xwud anymore (it's just displayed black).

    Question #2:
    What type of config do I need for the Xvfb in order to run the app
    without the errors and being able to use xwud to view the image ?

    NCD X Terminal xdpyinfo:
    ========================
    name of display: ncdxterm:0.0
    version number: 11.0
    vendor string: Network Computing Devices, Inc.
    vendor release number: 4
    maximum request size: 262140 bytes
    motion buffer size: 256
    bitmap unit, bit order, padding: 32, MSBFirst, 32
    image byte order: MSBFirst
    number of supported pixmap formats: 2
    supported pixmap formats:
    depth 1, bits_per_pixel 1, scanline_pad 32
    depth 8, bits_per_pixel 8, scanline_pad 32
    keycode range: minimum 8, maximum 254
    focus: PointerRoot
    number of extensions: 11
    MIT-SCREEN-SAVER
    MIT-SUNDRY-NONSTANDARD
    Multi-Buffering
    RECORD
    SHAPE
    ServerManagementExtension
    WINDD
    XC-MISC
    XIdle
    XInputExtension
    XTEST
    default screen number: 0
    number of screens: 1

    screen #0:
    dimensions: 1024x768 pixels (260x195 millimeters)
    resolution: 100x100 dots per inch
    depths (2): 1, 8
    root window id: 0x28
    depth of root window: 8 planes
    number of colormaps: minimum 1, maximum 1
    default colormap: 0x26
    default number of colormap cells: 256
    preallocated pixels: black 0, white 1
    options: backing-store YES, save-unders YES
    largest cursor: 256x256
    current input event mask: 0x440000
    ResizeRedirectMask PropertyChangeMask
    number of visuals: 6
    default visual id: 0x20
    visual:
    visual id: 0x20
    class: PseudoColor
    depth: 8 planes
    available colormap entries: 256
    red, green, blue masks: 0x0, 0x0, 0x0
    significant bits in color specification: 8 bits
    visual:
    visual id: 0x21
    class: DirectColor
    depth: 8 planes
    available colormap entries: 8 per subfield
    red, green, blue masks: 0x7, 0x38, 0xc0
    significant bits in color specification: 8 bits
    visual:
    visual id: 0x22
    class: GrayScale
    depth: 8 planes
    available colormap entries: 256
    red, green, blue masks: 0x0, 0x0, 0x0
    significant bits in color specification: 8 bits
    visual:
    visual id: 0x23
    class: StaticGray
    depth: 8 planes
    available colormap entries: 256
    red, green, blue masks: 0x0, 0x0, 0x0
    significant bits in color specification: 8 bits
    visual:
    visual id: 0x24
    class: StaticColor
    depth: 8 planes
    available colormap entries: 256
    red, green, blue masks: 0x7, 0x38, 0xc0
    significant bits in color specification: 8 bits
    visual:
    visual id: 0x25
    class: TrueColor
    depth: 8 planes
    available colormap entries: 8 per subfield
    red, green, blue masks: 0x7, 0x38, 0xc0
    significant bits in color specification: 8 bits

    Xvfb - 8 planes xdpinfo:
    ==================================
    name of display: suse:3.0
    version number: 11.0
    vendor string: The XFree86 Project, Inc
    vendor release number: 40200000
    XFree86 version: 4.2.0
    maximum request size: 4194300 bytes
    motion buffer size: 256
    bitmap unit, bit order, padding: 32, LSBFirst, 32
    image byte order: LSBFirst
    number of supported pixmap formats: 2
    supported pixmap formats:
    depth 1, bits_per_pixel 1, scanline_pad 32
    depth 8, bits_per_pixel 8, scanline_pad 32
    keycode range: minimum 8, maximum 255
    focus: window 0x1000015, revert to Parent
    number of extensions: 22
    BIG-REQUESTS
    DEC-XTRAP
    DOUBLE-BUFFER
    Extended-Visual-Information
    FontCache
    GLX
    LBX
    MIT-SCREEN-SAVER
    MIT-SHM
    MIT-SUNDRY-NONSTANDARD
    RECORD
    RENDER
    SECURITY
    SGI-GLX
    SHAPE
    SYNC
    TOG-CUP
    XC-APPGROUP
    XC-MISC
    XFree86-Bigfont
    XTEST
    XVideo
    default screen number: 0
    number of screens: 1

    screen #0:
    dimensions: 1024x768 pixels (260x195 millimeters)
    resolution: 100x100 dots per inch
    depths (2): 1, 8
    root window id: 0x3e
    depth of root window: 8 planes
    number of colormaps: minimum 1, maximum 1
    default colormap: 0x20
    default number of colormap cells: 256
    preallocated pixels: black 1, white 0
    options: backing-store YES, save-unders YES
    largest cursor: 1024x768
    current input event mask: 0x38003d
    KeyPressMask ButtonPressMask
    ButtonReleaseMask
    EnterWindowMask LeaveWindowMask
    SubstructureNotifyMask
    SubstructureRedirectMask FocusChangeMask
    number of visuals: 8
    default visual id: 0x27
    visual:
    visual id: 0x27
    class: PseudoColor
    depth: 8 planes
    available colormap entries: 256
    red, green, blue masks: 0x0, 0x0, 0x0
    significant bits in color specification: 8 bits
    visual:
    visual id: 0x28
    class: GrayScale
    depth: 8 planes
    available colormap entries: 256
    red, green, blue masks: 0x0, 0x0, 0x0
    significant bits in color specification: 8 bits
    visual:
    visual id: 0x29
    class: StaticColor
    depth: 8 planes
    available colormap entries: 256
    red, green, blue masks: 0x7, 0x38, 0xc0
    significant bits in color specification: 8 bits
    visual:
    visual id: 0x2a
    class: TrueColor
    depth: 8 planes
    available colormap entries: 8 per subfield
    red, green, blue masks: 0x7, 0x38, 0xc0
    significant bits in color specification: 8 bits
    visual:
    visual id: 0x2b
    class: TrueColor
    depth: 8 planes
    available colormap entries: 8 per subfield
    red, green, blue masks: 0x7, 0x38, 0xc0
    significant bits in color specification: 8 bits
    visual:
    visual id: 0x2c
    class: DirectColor
    depth: 8 planes
    available colormap entries: 8 per subfield
    red, green, blue masks: 0x7, 0x38, 0xc0
    significant bits in color specification: 8 bits
    visual:
    visual id: 0x2d
    class: DirectColor
    depth: 8 planes
    available colormap entries: 8 per subfield
    red, green, blue masks: 0x7, 0x38, 0xc0
    significant bits in color specification: 8 bits
    visual:
    visual id: 0x2e
    class: StaticGray
    depth: 8 planes
    available colormap entries: 256
    red, green, blue masks: 0x0, 0x0, 0x0
    significant bits in color specification: 8 bits

    Xvfb - 24 planes xdpinfo:
    ==================================
    name of display: suse:3.0
    version number: 11.0
    vendor string: The XFree86 Project, Inc
    vendor release number: 40200000
    XFree86 version: 4.2.0
    maximum request size: 4194300 bytes
    motion buffer size: 256
    bitmap unit, bit order, padding: 32, LSBFirst, 32
    image byte order: LSBFirst
    number of supported pixmap formats: 2
    supported pixmap formats:
    depth 1, bits_per_pixel 1, scanline_pad 32
    depth 24, bits_per_pixel 32, scanline_pad 32
    keycode range: minimum 8, maximum 255
    focus: window 0xe0001f, revert to Parent
    number of extensions: 22
    BIG-REQUESTS
    DEC-XTRAP
    DOUBLE-BUFFER
    Extended-Visual-Information
    FontCache
    GLX
    LBX
    MIT-SCREEN-SAVER
    MIT-SHM
    MIT-SUNDRY-NONSTANDARD
    RECORD
    RENDER
    SECURITY
    SGI-GLX
    SHAPE
    SYNC
    TOG-CUP
    XC-APPGROUP
    XC-MISC
    XFree86-Bigfont
    XTEST
    XVideo
    default screen number: 0
    number of screens: 1

    screen #0:
    dimensions: 1024x768 pixels (260x195 millimeters)
    resolution: 100x100 dots per inch
    depths (2): 1, 24
    root window id: 0x30
    depth of root window: 24 planes
    number of colormaps: minimum 1, maximum 1
    default colormap: 0x20
    default number of colormap cells: 256
    preallocated pixels: black 0, white 16777215
    options: backing-store YES, save-unders YES
    largest cursor: 1024x768
    current input event mask: 0x38003c
    ButtonPressMask ButtonReleaseMask EnterWindowMask
    LeaveWindowMask SubstructureNotifyMask
    SubstructureRedirectMask
    FocusChangeMask
    number of visuals: 4
    default visual id: 0x23
    visual:
    visual id: 0x23
    class: TrueColor
    depth: 24 planes
    available colormap entries: 256 per subfield
    red, green, blue masks: 0xff, 0xff00, 0xff0000
    significant bits in color specification: 8 bits
    visual:
    visual id: 0x24
    class: TrueColor
    depth: 24 planes
    available colormap entries: 256 per subfield
    red, green, blue masks: 0xff, 0xff00, 0xff0000
    significant bits in color specification: 8 bits
    visual:
    visual id: 0x25
    class: DirectColor
    depth: 24 planes
    available colormap entries: 256 per subfield
    red, green, blue masks: 0xff, 0xff00, 0xff0000
    significant bits in color specification: 8 bits
    visual:
    visual id: 0x26
    class: DirectColor
    depth: 24 planes
    available colormap entries: 256 per subfield
    red, green, blue masks: 0xff, 0xff00, 0xff0000
    significant bits in color specification: 8 bits

    Any help appreciated. Thanks for your time.
    Janice Waddick

  2. Re: BadAlloc & XAllocColor with Xvfb

    "Fred L. Kleinschmidt" wrote in message news:<3FA279D5.97E6D597@nospam_boeing.com>...
    >
    > What is the full error message?


    Sorry for not including it - but the program uses the RECORD Extension
    and the error is handled like the rest of the requests and events.
    The following is a sample of the output produced. Part of the code
    that prints the error (I've cut out some lines to reduce size)is shown
    at the bottom:

    category: 0 client_swapped: 1 data: 134736940 data_len: 8
    GOT AN ERROR: 0 server time: 827091106 client seq: 84 type: 11
    majorCode 84 minorCode: 0 rId: 100720640 errSeq#: 21504
    ....
    category: 0 client_swapped: 1 data: 134736940 data_len: 8
    GOT AN ERROR: 0 server time: 1095526562 client seq: 97 type: 11
    majorCode 84 minorCode: 0 rId: 1040187392 errSeq#: 24832
    ....
    category: 0 client_swapped: 1 data: 134736940 data_len: 8
    GOT AN ERROR: 0 server time: 1800169634 client seq: 138 type: 11
    majorCode 84 minorCode: 0 rId: 285270016 errSeq#: 35328

    void
    xnee_replay_dispatch (XPointer type_ref, XRecordInterceptData *data)
    {
    XRecordDatum *xrec_data;
    int type;
    xnee_data *xd;

    xd = (xnee_data*) (type_ref);
    xnee_verbose( xd, "category: %d client_swapped: %d data: %d
    data_len: %d\n", data->category, data->client_swapped, data->data,
    data->data_len );
    if (!data->data)
    {
    xnee_verbose( xd, "xnee_replay_dispatch no data\n");
    return;
    }

    xrec_data = (XRecordDatum *) (data->data) ;
    type = xrec_data->type ;

    switch(data->category)
    {
    case XRecordFromClient:

    xnee_verbose (xd, "GOT A REQUEST: %d server time: %d
    client seq: %d\n ",
    type, data->server_time, data->client_seq );
    break;
    case XRecordFromServer:
    if(type > X_Reply )
    {
    xnee_verbose (xd, "GOT A EVENT: %d server time: %d
    client seq: %d\n",
    type, data->server_time, data->client_seq);
    }
    else if ( type == X_Reply )
    {
    xnee_verbose (xd, "GOT A REPLY: %d server time: %d
    client seq: %d type: %d\n",
    type, data->server_time, data->client_seq, type);
    }
    else if ( type == X_Error )
    {
    xnee_verbose (xd, "GOT AN ERROR: %d server time: %d
    client seq: %d type: %d majorCode %d minorCode: %d rId: %d errSeq#:
    %d\n",
    type, data->server_time, data->client_seq,
    xrec_data->error.errorCode,
    xrec_data->error.majorCode, xrec_data->error.minorCode,
    xrec_data->error.resourceID,
    xrec_data->error.sequenceNumber);
    }
    break;
    case XRecordClientStarted:
    xnee_verbose (xd, "ClientStarted \n");
    break;
    case XRecordClientDied:
    xnee_verbose (xd, "ClientDied \n");
    break;
    case XRecordEndOfData:
    xnee_verbose (xd, "EndOfData \n");
    break;
    default:
    xnee_print_error( "Case: Default reached in Dispatch (...) \n");
    xnee_verbose( xd, "Case: Default reached in Dispatch (...)
    category: %d, type: %d\n", data->category, type);
    break;
    }
    XRecordFreeData(data);
    }

    Let me know if there is anything else you need.
    Thanks
    Janice Waddick

+ Reply to Thread