Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* ColorMap Problem with X11R6.3
@ 1998-01-06  5:00 Stephen L. Schumacher
  1998-01-07  5:00 ` Owen Lawrence
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen L. Schumacher @ 1998-01-06  5:00 UTC (permalink / raw)



This is a reposting.  My ISP changed mail servers and lost my account.
Please resend any reply's.
TIA steve@slscomp.com

Hardware - SPARCStation20 ( 2 ROSS 150MHz CPU's, 4 Turbo GX+ Frame
Buffers )
Xserver - X11R6.3 - no patches - ( process bound to 2nd CPU )
Motif - 1.2.4
Solaris 2.5 - no patches

/usr/X11R6.3/bin/X -auth
/usr/X11R6.3/lib/X11/xdm/authdir/authfiles/A:0-a0003s

xdm - X Display Manager with support for XDMCP

mwm -multiscreen ( 4 displays )

Our application at one point calls XAllocColorCells  to allocate
 read/write color cells. This in order to perform colormap swapping
 for a double buffer mechanism.

It appears that sometimes (randommly) the function XAllocColorCells
 returns the color cell number one (the black one) that is suppose to
be

 a read only one reserved by the system. We are using this cell to
store

 the color we need for the double buffer mechanism doing a
 XStoreColors to change the colormap entries of the pixel values
returned
 by XAllocColorCells.

But when XAllocColorCells returns the cell number 1 as the first
 writable cell, the Xserver starts to have an impredictable behavior,
 often crashing the XServer.  The black color used by other
applications is also changed ( the title of the xterm for exmaple).

Restarting xdm of course fixes the problem.

Below is a simplified example of what our application does:

void SetColors(Display *display,int screen)
{
register int i;
unsigned long       plane_masks[1];
Colormap   def_cmap;
long       pixel_list[256];
long       pixel_list_len = 0;
XColor     color[1];

def_cmap = DefaultColormap(display, screen);

while(1)
   {
   if(!XAllocColorCells(display,
                        def_cmap,
                        False,
                        plane_masks,
                        0,
                        &(pixel_list[pixel_list_len]), 1))  break;
    printf(" pixel [%d] =
%d",pixel_list_len,pixel_list[pixel_list_len]);
    pixel_list_len++;
    }

printf("\n");
for(i = 0;i<pixel_list_len;i++)
   {
         color[0].red = 0;
         color[0].blue =0 ;
         color[0].green = 0xffff;
         color[0].pixel= pixel_list[i];
         color[0].flags = DoRed | DoGreen | DoBlue;
         XStoreColors(display,def_cmap,color[0],1);
         printf(" pixel_list[%d] = %d \n",i,pixel_list[i]);
  }
XFlush(display);
}


TIA - Steve ( steve@slscomp.com )






^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ColorMap Problem with X11R6.3
  1998-01-06  5:00 ColorMap Problem with X11R6.3 Stephen L. Schumacher
@ 1998-01-07  5:00 ` Owen Lawrence
  0 siblings, 0 replies; 2+ messages in thread
From: Owen Lawrence @ 1998-01-07  5:00 UTC (permalink / raw)





Stephen L. Schumacher <steve@slscomp.com> wrote in article
<34B287AA.4A928D4B@slscomp.com>...
>...
> Our application at one point calls XAllocColorCells  to allocate
>  read/write color cells. This in order to perform colormap swapping
>  for a double buffer mechanism.
> 
> It appears that sometimes (randommly) the function XAllocColorCells
>  returns the color cell number one (the black one) that is suppose to
> be
> 
>  a read only one reserved by the system. We are using this cell to
> store
> 
>  the color we need for the double buffer mechanism doing a
>  XStoreColors to change the colormap entries of the pixel values
> returned
>  by XAllocColorCells.
> 
> But when XAllocColorCells returns the cell number 1 as the first
>  writable cell, the Xserver starts to have an impredictable behavior,
>  often crashing the XServer.  The black color used by other
> applications is also changed ( the title of the xterm for exmaple).
> 
> Restarting xdm of course fixes the problem.
> 
> Below is a simplified example of what our application does:
> 
> void SetColors(Display *display,int screen)
> {
> register int i;
> unsigned long       plane_masks[1];
> Colormap   def_cmap;
> long       pixel_list[256];
> long       pixel_list_len = 0;
> XColor     color[1];
> 
> def_cmap = DefaultColormap(display, screen);
> 
> while(1)
>    {
>    if(!XAllocColorCells(display,
>                         def_cmap,
>                         False,
>                         plane_masks,
>                         0,
>                         &(pixel_list[pixel_list_len]), 1))  break;
>     printf(" pixel [%d] =
> %d",pixel_list_len,pixel_list[pixel_list_len]);
>     pixel_list_len++;
>     }
> 
> printf("\n");
> for(i = 0;i<pixel_list_len;i++)
>    {
>          color[0].red = 0;
>          color[0].blue =0 ;
>          color[0].green = 0xffff;
>          color[0].pixel= pixel_list[i];
>          color[0].flags = DoRed | DoGreen | DoBlue;
>          XStoreColors(display,def_cmap,color[0],1);
>          printf(" pixel_list[%d] = %d \n",i,pixel_list[i]);
>   }
> XFlush(display);
> }
> 
> 
> TIA - Steve ( steve@slscomp.com )
> 

I just noticed that you're passing an XColor in XStoreColors(), rather than
XColor[].
Try XStoreColors(display,def_cmap,&color[0],1); or
XStoreColors(display,def_cmap,color,1);

  - Owen -





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-01-07  5:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-01-06  5:00 ColorMap Problem with X11R6.3 Stephen L. Schumacher
1998-01-07  5:00 ` Owen Lawrence

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox