*BSD News Article 8608


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!sgiblab!zaphod.mps.ohio-state.edu!rpi!batcomputer!ghost.dsi.unimi.it!newsserver.di.unipi.it!pimac2.iet.unipi.it!romano
From: romano@pimac2.iet.unipi.it (Romano Giannetti)
Subject: Bug in X386 Xmono server?
Message-ID: <1992Dec4.175440.17024@cli.di.unipi.it>
Sender: netnews@cli.di.unipi.it (USENET News System)
Nntp-Posting-Host: pimac2.iet.unipi.it
Organization: Dipartimento di Informatica, Universita' di Pisa
Date: Fri, 4 Dec 1992 17:54:40 GMT
Lines: 1391

It seem I found a bug in the Xmono server distributed with Linux. I post 
this one here to know if someone know:
..) if Xfree86 1.2 correct this bug;
..) if anyone has patched sources so I can recompile Xmono under Linux;
..) if anyone has a X386 version (not buggy!) to use 640x480x16 generic
   vga (Yes, I have linux on a laptop). 

Here is the problem:

It seem I have found a really strange bug in the libX11 library 
(I think, may be the problem is in the Xmono server, I don't know 
so well X11 protocol. Peraphs I have to post it on some other newsgroup?
Which one? ) I think to have localized the problem 
with the following little program.
 
Compile (gcc -o bug bug.c -lX11) the program and run it so:

>  ./bug 1 10

it writes 'gc line_width=1' and then plot two rectangles with
ellipses in it: the first one, on the top, correct (I have plotted it
with Graphic Context gcb, where I have asked *explicitly* line_width
of 1); the second one, at the bottom, has the ellipses traced only in
part and shifted on the x-axis to the right (in my screen). Also the
programs xvier (that comes with the distribution) and xfig 2.1.6 (that
I compiled and that showed me the problem) have the same behaviour.

Now, when the window come out, put it near the edge of the screen, so
that the ellipses are not traced completely: you'll see the two
drawings come out perfect. 

Have you the same problem or I have some strange (but it has to be
VERY strange) problem in my computer or in my installation procedure?

Thank for EVERY answer cause I NEED circles in xfig to draw electronic
circuits... 

                Romano.

Here is the program bug.c:

-------------------cut here---------------------------------------

/* bug.c by RGtti Nov 30, 1992 */
/* compile gcc -o bug bug.c -lX11 (-static if you want) */
/* use ./bug <thickness> <xpos> : 
   with the window all in screen, ./bug 1 10 shows the problem */

#include   <stdio.h>
#include   <X11/Xlib.h>

main(int argc, char **argv) {

  Display                 *display;
  int                     screen,a,t;
  Window                  mywin;
  char                    ch;
  GC                      gc,gcb;
  XGCValues               v;
  XSetWindowAttributes    attributes;
  unsigned long           attribute_mask;
  XEvent                  exposed;

  if (argc!=3) exit(1);

  t=atoi(argv[1]);		/* Try 1,2: explicit line_width */
  a=atoi(argv[2]);		/* Try 10 (bug), -10 (ok) */

  display=XOpenDisplay((char *)NULL); /* Open display */
  screen=DefaultScreen(display);

  attributes.background_pixel = WhitePixel(display,screen);
  attributes.border_pixel     = BlackPixel(display,screen);
  attributes.event_mask       = ExposureMask;
  attribute_mask              = CWBackPixel | CWBorderPixel | CWEventMask;

  mywin=XCreateWindow(display,
		      RootWindow(display,screen),
		      100, 100, 300, 300, 2,      
		      CopyFromParent, InputOutput, CopyFromParent,
		      attribute_mask,
		      &attributes );

  XMapWindow(display,mywin);

  XFlush(display); 

  /* This to wait for the window being mapped...*/
  while(1) {
    XNextEvent(display,&exposed);
    if ( exposed.xexpose.count == 0) break;
  }

  v.foreground=BlackPixel(display,screen);
  v.background=WhitePixel(display,screen);
  v.line_width=t;
  
  /* gc don't work for arc drawing , gcb is correct, also if t (the first
     argument) is 1! (that is, the default value) */

  gc=XCreateGC(display,mywin,GCForeground|GCBackground,&v);
  gcb=XCreateGC(display,mywin,GCForeground|GCBackground|GCLineWidth,&v);
     
  (void) XGetGCValues(display,gc,(1L<<(GCLastBit+1)-1),&v);
  printf("gc has (default) line_width=%d\n",v.line_width);

  /* 
      HERE THE PROBLEM !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      The first arc is always ok, the second is ok only if it is
      partially out of the window (or the screen) (????????) 
  */

  XDrawArc(display,mywin,gcb,a,10,200,100,0,360*64);
  XDrawArc(display,mywin,gc,a,160,200,100,0,360*64);
 
  /* This are always ok */

  XDrawRectangle(display,mywin,gcb,a,10,200,100);
  XDrawRectangle(display,mywin,gc,a,160,200,100);

  XFlush(display);

  printf("Hit <return> to exit\n");
  scanf("%c",&ch);

  XFreeGC(display,gcb);
  XFreeGC(display,gc);
  XDestroyWindow(display,mywin);
  XCloseDisplay(display);

}









































Path: pimac2.iet.unipi.it!romano
Newsgroups: comp.os.linux
Distribution: world
Followup-To: 
From: romano@pimac2.iet.unipi.it (Romano Giannetti)
Organization: 
Subject: X386 XDrawArc() bugged? (and other things...)
Keywords: 

I have installed from SLS distribution Linux 0.98pl5 on a 386/25
laptop, with a VGA-compatible LCD, 4M Ram and 100M HD (16Mbyte of
swap). The system is up and running, I had only minor problems 
(I had to chgrp mem {ps,free} and chmod -R a+r /usr/man); 
but it seem I have found a really strange bug in the libX11 library 
(I think, may be the problem is in the Xmono server, I don't know 
so well X11 protocol. Peraphs I have to post it on some other newsgroup?
Which one? ) I think to have localized the problem 
with the following little program.
 
Compile (gcc -o bug bug.c -lX11) the program and run it so:

>  ./bug 1 10

it writes 'gc line_width)=1' and then plot two rectangles with
ellipses in it: the first one, on the top, correct (I have plotted it
with Graphic Context gcb, where I have asked *explicitly* line_width
of 1); the second one, at the bottom, has the ellipses traced only in
part and shifted on the x-axis to the right (in my screen). Also the
programs xvier (that comes with the distribution) and xfig 2.1.6 (that
I compiled and that showed me the problem) have the same behaviour.

Now, when the window come out, put it near the edge of the screen, so
that the ellipses are not traced completely: you'll see the two
drawings come out perfect. 

Have you the same problem or I have some strange (but it has to be
VERY strange) problem in my computer or in my installation procedure?

Thank for EVERY answer cause I NEED circles in xfig to draw electronic
circuits... 

                Romano.

PS: few other question: 

1) where can I find a non-shared lib/libm.a to compile my programs
with -g flags?

2) I know it's trivial cause it's the default, but if I say -dynamic
to gcc it understand I want put it in debug mode, flags ynamic...

3) Have you any trouble with XSynchronize? It seem not to work for me...

So THANKS GUYS. (Little problems, but LINUX is GREAT).

-- 
***************************************************************************
* Romano Giannetti          * Dip.to di Ingegneria dell'Informazione      *
*                           * Elettronica, Informatica e Telecomunicazioni*
* romano@iet.unipi.it       * via Diotisalvi,2                            *
* giannetti@sssup1.sssup.it * Universita' di Pisa, I-56126 PISA, Italy    *
***************************************************************************

Here is the program bug.c:

-------------------cut here---------------------------------------

/* bug.c by RGtti Nov 30, 1992 */
/* compile gcc -o bug bug.c -lX11 (-static if you want) */
/* use ./bug <thickness> <xpos> : 
   with the window all in screen, ./bug 1 10 shows the problem */

#include   <stdio.h>
#include   <X11/Xlib.h>

main(int argc, char **argv) {

  Display                 *display;
  int                     screen,a,t;
  Window                  mywin;
  char                    ch;
  GC                      gc,gcb;
  XGCValues               v;
  XSetWindowAttributes    attributes;
  unsigned long           attribute_mask;
  XEvent                  exposed;

  if (argc!=3) exit(1);

  t=atoi(argv[1]);		/* Try 1,2: explicit line_width */
  a=atoi(argv[2]);		/* Try 10 (bug), -10 (ok) */

  display=XOpenDisplay((char *)NULL); /* Open display */
  screen=DefaultScreen(display);

  attributes.background_pixel = WhitePixel(display,screen);
  attributes.border_pixel     = BlackPixel(display,screen);
  attributes.event_mask       = ExposureMask;
  attribute_mask              = CWBackPixel | CWBorderPixel | CWEventMask;

  mywin=XCreateWindow(display,
		      RootWindow(display,screen),
		      100, 100, 300, 300, 2,      
		      CopyFromParent, InputOutput, CopyFromParent,
		      attribute_mask,
		      &attributes );

  XMapWindow(display,mywin);

  XFlush(display); 

  /* This to wait for the window being mapped...*/
  while(1) {
    XNextEvent(display,&exposed);
    if ( exposed.xexpose.count == 0) break;
  }

  v.foreground=BlackPixel(display,screen);
  v.background=WhitePixel(display,screen);
  v.line_width=t;
  
  /* gc don't work for arc drawing , gcb is correct, also if t (the first
     argument) is 1! (that is, the default value) */

  gc=XCreateGC(display,mywin,GCForeground|GCBackground,&v);
  gcb=XCreateGC(display,mywin,GCForeground|GCBackground|GCLineWidth,&v);
     
  (void) XGetGCValues(display,gc,(1L<<(GCLastBit+1)-1),&v);
  printf("gc has (default) line_width=%d\n",v.line_width);

  /* 
      HERE THE PROBLEM !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      The first arc is always ok, the second is ok only if it is
      partially out of the window (or the screen) (????????) 
  */

  XDrawArc(display,mywin,gcb,a,10,200,100,0,360*64);
  XDrawArc(display,mywin,gc,a,160,200,100,0,360*64);
 
  /* This are always ok */

  XDrawRectangle(display,mywin,gcb,a,10,200,100);
  XDrawRectangle(display,mywin,gc,a,160,200,100);

  XFlush(display);

  printf("Hit <return> to exit\n");
  scanf("%c",&ch);

  XFreeGC(display,gcb);
  XFreeGC(display,gc);
  XDestroyWindow(display,mywin);
  XCloseDisplay(display);

}









































Path: pimac2.iet.unipi.it!romano
Newsgroups: comp.os.linux
Distribution: world
Followup-To: 
From: romano@pimac2.iet.unipi.it (Romano Giannetti)
Organization: 
Subject: X386 XDrawArc() bugged? (and other things...)
Keywords: 

I have installed from SLS distribution Linux 0.98pl5 on a 386/25
laptop, with a VGA-compatible LCD, 4M Ram and 100M HD (16Mbyte of
swap). The system is up and running, I had only minor problems 
(I had to chgrp mem {ps,free} and chmod -R a+r /usr/man); 
but it seem I have found a really strange bug in the libX11 library 
(I think, may be the problem is in the Xmono server, I don't know 
so well X11 protocol. Peraphs I have to post it on some other newsgroup?
Which one? ) I think to have localized the problem 
with the following little program.
 
Compile (gcc -o bug bug.c -lX11) the program and run it so:

>  ./bug 1 10

it writes 'gc line_width)=1' and then plot two rectangles with
ellipses in it: the first one, on the top, correct (I have plotted it
with Graphic Context gcb, where I have asked *explicitly* line_width
of 1); the second one, at the bottom, has the ellipses traced only in
part and shifted on the x-axis to the right (in my screen). Also the
programs xvier (that comes with the distribution) and xfig 2.1.6 (that
I compiled and that showed me the problem) have the same behaviour.

Now, when the window come out, put it near the edge of the screen, so
that the ellipses are not traced completely: you'll see the two
drawings come out perfect. 

Have you the same problem or I have some strange (but it has to be
VERY strange) problem in my computer or in my installation procedure?

Thank for EVERY answer cause I NEED circles in xfig to draw electronic
circuits... 

                Romano.

PS: few other question: 

1) where can I find a non-shared lib/libm.a to compile my programs
with -g flags?

2) I know it's trivial cause it's the default, but if I say -dynamic
to gcc it understand I want put it in debug mode, flags ynamic...

3) Have you any trouble with XSynchronize? It seem not to work for me...

So THANKS GUYS. (Little problems, but LINUX is GREAT).

-- 
***************************************************************************
* Romano Giannetti          * Dip.to di Ingegneria dell'Informazione      *
*                           * Elettronica, Informatica e Telecomunicazioni*
* romano@iet.unipi.it       * via Diotisalvi,2                            *
* giannetti@sssup1.sssup.it * Universita' di Pisa, I-56126 PISA, Italy    *
***************************************************************************

Here is the program bug.c:

-------------------cut here---------------------------------------

/* bug.c by RGtti Nov 30, 1992 */
/* compile gcc -o bug bug.c -lX11 (-static if you want) */
/* use ./bug <thickness> <xpos> : 
   with the window all in screen, ./bug 1 10 shows the problem */

#include   <stdio.h>
#include   <X11/Xlib.h>

main(int argc, char **argv) {

  Display                 *display;
  int                     screen,a,t;
  Window                  mywin;
  char                    ch;
  GC                      gc,gcb;
  XGCValues               v;
  XSetWindowAttributes    attributes;
  unsigned long           attribute_mask;
  XEvent                  exposed;

  if (argc!=3) exit(1);

  t=atoi(argv[1]);		/* Try 1,2: explicit line_width */
  a=atoi(argv[2]);		/* Try 10 (bug), -10 (ok) */

  display=XOpenDisplay((char *)NULL); /* Open display */
  screen=DefaultScreen(display);

  attributes.background_pixel = WhitePixel(display,screen);
  attributes.border_pixel     = BlackPixel(display,screen);
  attributes.event_mask       = ExposureMask;
  attribute_mask              = CWBackPixel | CWBorderPixel | CWEventMask;

  mywin=XCreateWindow(display,
		      RootWindow(display,screen),
		      100, 100, 300, 300, 2,      
		      CopyFromParent, InputOutput, CopyFromParent,
		      attribute_mask,
		      &attributes );

  XMapWindow(display,mywin);

  XFlush(display); 

  /* This to wait for the window being mapped...*/
  while(1) {
    XNextEvent(display,&exposed);
    if ( exposed.xexpose.count == 0) break;
  }

  v.foreground=BlackPixel(display,screen);
  v.background=WhitePixel(display,screen);
  v.line_width=t;
  
  /* gc don't work for arc drawing , gcb is correct, also if t (the first
     argument) is 1! (that is, the default value) */

  gc=XCreateGC(display,mywin,GCForeground|GCBackground,&v);
  gcb=XCreateGC(display,mywin,GCForeground|GCBackground|GCLineWidth,&v);
     
  (void) XGetGCValues(display,gc,(1L<<(GCLastBit+1)-1),&v);
  printf("gc has (default) line_width=%d\n",v.line_width);

  /* 
      HERE THE PROBLEM !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      The first arc is always ok, the second is ok only if it is
      partially out of the window (or the screen) (????????) 
  */

  XDrawArc(display,mywin,gcb,a,10,200,100,0,360*64);
  XDrawArc(display,mywin,gc,a,160,200,100,0,360*64);
 
  /* This are always ok */

  XDrawRectangle(display,mywin,gcb,a,10,200,100);
  XDrawRectangle(display,mywin,gc,a,160,200,100);

  XFlush(display);

  printf("Hit <return> to exit\n");
  scanf("%c",&ch);

  XFreeGC(display,gcb);
  XFreeGC(display,gc);
  XDestroyWindow(display,mywin);
  XCloseDisplay(display);

}









































Path: pimac2.iet.unipi.it!romano
Newsgroups: comp.os.linux
Distribution: world
Followup-To: 
From: romano@pimac2.iet.unipi.it (Romano Giannetti)
Organization: 
Subject: X386 XDrawArc() bugged? (and other things...)
Keywords: 

I have installed from SLS distribution Linux 0.98pl5 on a 386/25
laptop, with a VGA-compatible LCD, 4M Ram and 100M HD (16Mbyte of
swap). The system is up and running, I had only minor problems 
(I had to chgrp mem {ps,free} and chmod -R a+r /usr/man); 
but it seem I have found a really strange bug in the libX11 library 
(I think, may be the problem is in the Xmono server, I don't know 
so well X11 protocol. Peraphs I have to post it on some other newsgroup?
Which one? ) I think to have localized the problem 
with the following little program.
 
Compile (gcc -o bug bug.c -lX11) the program and run it so:

>  ./bug 1 10

it writes 'gc line_width)=1' and then plot two rectangles with
ellipses in it: the first one, on the top, correct (I have plotted it
with Graphic Context gcb, where I have asked *explicitly* line_width
of 1); the second one, at the bottom, has the ellipses traced only in
part and shifted on the x-axis to the right (in my screen). Also the
programs xvier (that comes with the distribution) and xfig 2.1.6 (that
I compiled and that showed me the problem) have the same behaviour.

Now, when the window come out, put it near the edge of the screen, so
that the ellipses are not traced completely: you'll see the two
drawings come out perfect. 

Have you the same problem or I have some strange (but it has to be
VERY strange) problem in my computer or in my installation procedure?

Thank for EVERY answer cause I NEED circles in xfig to draw electronic
circuits... 

                Romano.

PS: few other question: 

1) where can I find a non-shared lib/libm.a to compile my programs
with -g flags?

2) I know it's trivial cause it's the default, but if I say -dynamic
to gcc it understand I want put it in debug mode, flags ynamic...

3) Have you any trouble with XSynchronize? It seem not to work for me...

So THANKS GUYS. (Little problems, but LINUX is GREAT).

-- 
***************************************************************************
* Romano Giannetti          * Dip.to di Ingegneria dell'Informazione      *
*                           * Elettronica, Informatica e Telecomunicazioni*
* romano@iet.unipi.it       * via Diotisalvi,2                            *
* giannetti@sssup1.sssup.it * Universita' di Pisa, I-56126 PISA, Italy    *
***************************************************************************

Here is the program bug.c:

-------------------cut here---------------------------------------

/* bug.c by RGtti Nov 30, 1992 */
/* compile gcc -o bug bug.c -lX11 (-static if you want) */
/* use ./bug <thickness> <xpos> : 
   with the window all in screen, ./bug 1 10 shows the problem */

#include   <stdio.h>
#include   <X11/Xlib.h>

main(int argc, char **argv) {

  Display                 *display;
  int                     screen,a,t;
  Window                  mywin;
  char                    ch;
  GC                      gc,gcb;
  XGCValues               v;
  XSetWindowAttributes    attributes;
  unsigned long           attribute_mask;
  XEvent                  exposed;

  if (argc!=3) exit(1);

  t=atoi(argv[1]);		/* Try 1,2: explicit line_width */
  a=atoi(argv[2]);		/* Try 10 (bug), -10 (ok) */

  display=XOpenDisplay((char *)NULL); /* Open display */
  screen=DefaultScreen(display);

  attributes.background_pixel = WhitePixel(display,screen);
  attributes.border_pixel     = BlackPixel(display,screen);
  attributes.event_mask       = ExposureMask;
  attribute_mask              = CWBackPixel | CWBorderPixel | CWEventMask;

  mywin=XCreateWindow(display,
		      RootWindow(display,screen),
		      100, 100, 300, 300, 2,      
		      CopyFromParent, InputOutput, CopyFromParent,
		      attribute_mask,
		      &attributes );

  XMapWindow(display,mywin);

  XFlush(display); 

  /* This to wait for the window being mapped...*/
  while(1) {
    XNextEvent(display,&exposed);
    if ( exposed.xexpose.count == 0) break;
  }

  v.foreground=BlackPixel(display,screen);
  v.background=WhitePixel(display,screen);
  v.line_width=t;
  
  /* gc don't work for arc drawing , gcb is correct, also if t (the first
     argument) is 1! (that is, the default value) */

  gc=XCreateGC(display,mywin,GCForeground|GCBackground,&v);
  gcb=XCreateGC(display,mywin,GCForeground|GCBackground|GCLineWidth,&v);
     
  (void) XGetGCValues(display,gc,(1L<<(GCLastBit+1)-1),&v);
  printf("gc has (default) line_width=%d\n",v.line_width);

  /* 
      HERE THE PROBLEM !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      The first arc is always ok, the second is ok only if it is
      partially out of the window (or the screen) (????????) 
  */

  XDrawArc(display,mywin,gcb,a,10,200,100,0,360*64);
  XDrawArc(display,mywin,gc,a,160,200,100,0,360*64);
 
  /* This are always ok */

  XDrawRectangle(display,mywin,gcb,a,10,200,100);
  XDrawRectangle(display,mywin,gc,a,160,200,100);

  XFlush(display);

  printf("Hit <return> to exit\n");
  scanf("%c",&ch);

  XFreeGC(display,gcb);
  XFreeGC(display,gc);
  XDestroyWindow(display,mywin);
  XCloseDisplay(display);

}









































Path: pimac2.iet.unipi.it!romano
Newsgroups: comp.os.linux
Distribution: world
Followup-To: 
From: romano@pimac2.iet.unipi.it (Romano Giannetti)
Organization: 
Subject: X386 XDrawArc() bugged? (and other things...)
Keywords: 

I have installed from SLS distribution Linux 0.98pl5 on a 386/25
laptop, with a VGA-compatible LCD, 4M Ram and 100M HD (16Mbyte of
swap). The system is up and running, I had only minor problems 
(I had to chgrp mem {ps,free} and chmod -R a+r /usr/man); 
but it seem I have found a really strange bug in the libX11 library 
(I think, may be the problem is in the Xmono server, I don't know 
so well X11 protocol. Peraphs I have to post it on some other newsgroup?
Which one? ) I think to have localized the problem 
with the following little program.
 
Compile (gcc -o bug bug.c -lX11) the program and run it so:

>  ./bug 1 10

it writes 'gc line_width)=1' and then plot two rectangles with
ellipses in it: the first one, on the top, correct (I have plotted it
with Graphic Context gcb, where I have asked *explicitly* line_width
of 1); the second one, at the bottom, has the ellipses traced only in
part and shifted on the x-axis to the right (in my screen). Also the
programs xvier (that comes with the distribution) and xfig 2.1.6 (that
I compiled and that showed me the problem) have the same behaviour.

Now, when the window come out, put it near the edge of the screen, so
that the ellipses are not traced completely: you'll see the two
drawings come out perfect. 

Have you the same problem or I have some strange (but it has to be
VERY strange) problem in my computer or in my installation procedure?

Thank for EVERY answer cause I NEED circles in xfig to draw electronic
circuits... 

                Romano.

PS: few other question: 

1) where can I find a non-shared lib/libm.a to compile my programs
with -g flags?

2) I know it's trivial cause it's the default, but if I say -dynamic
to gcc it understand I want put it in debug mode, flags ynamic...

3) Have you any trouble with XSynchronize? It seem not to work for me...

So THANKS GUYS. (Little problems, but LINUX is GREAT).

-- 
***************************************************************************
* Romano Giannetti          * Dip.to di Ingegneria dell'Informazione      *
*                           * Elettronica, Informatica e Telecomunicazioni*
* romano@iet.unipi.it       * via Diotisalvi,2                            *
* giannetti@sssup1.sssup.it * Universita' di Pisa, I-56126 PISA, Italy    *
***************************************************************************

Here is the program bug.c:

-------------------cut here---------------------------------------

/* bug.c by RGtti Nov 30, 1992 */
/* compile gcc -o bug bug.c -lX11 (-static if you want) */
/* use ./bug <thickness> <xpos> : 
   with the window all in screen, ./bug 1 10 shows the problem */

#include   <stdio.h>
#include   <X11/Xlib.h>

main(int argc, char **argv) {

  Display                 *display;
  int                     screen,a,t;
  Window                  mywin;
  char                    ch;
  GC                      gc,gcb;
  XGCValues               v;
  XSetWindowAttributes    attributes;
  unsigned long           attribute_mask;
  XEvent                  exposed;

  if (argc!=3) exit(1);

  t=atoi(argv[1]);		/* Try 1,2: explicit line_width */
  a=atoi(argv[2]);		/* Try 10 (bug), -10 (ok) */

  display=XOpenDisplay((char *)NULL); /* Open display */
  screen=DefaultScreen(display);

  attributes.background_pixel = WhitePixel(display,screen);
  attributes.border_pixel     = BlackPixel(display,screen);
  attributes.event_mask       = ExposureMask;
  attribute_mask              = CWBackPixel | CWBorderPixel | CWEventMask;

  mywin=XCreateWindow(display,
		      RootWindow(display,screen),
		      100, 100, 300, 300, 2,      
		      CopyFromParent, InputOutput, CopyFromParent,
		      attribute_mask,
		      &attributes );

  XMapWindow(display,mywin);

  XFlush(display); 

  /* This to wait for the window being mapped...*/
  while(1) {
    XNextEvent(display,&exposed);
    if ( exposed.xexpose.count == 0) break;
  }

  v.foreground=BlackPixel(display,screen);
  v.background=WhitePixel(display,screen);
  v.line_width=t;
  
  /* gc don't work for arc drawing , gcb is correct, also if t (the first
     argument) is 1! (that is, the default value) */

  gc=XCreateGC(display,mywin,GCForeground|GCBackground,&v);
  gcb=XCreateGC(display,mywin,GCForeground|GCBackground|GCLineWidth,&v);
     
  (void) XGetGCValues(display,gc,(1L<<(GCLastBit+1)-1),&v);
  printf("gc has (default) line_width=%d\n",v.line_width);

  /* 
      HERE THE PROBLEM !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      The first arc is always ok, the second is ok only if it is
      partially out of the window (or the screen) (????????) 
  */

  XDrawArc(display,mywin,gcb,a,10,200,100,0,360*64);
  XDrawArc(display,mywin,gc,a,160,200,100,0,360*64);
 
  /* This are always ok */

  XDrawRectangle(display,mywin,gcb,a,10,200,100);
  XDrawRectangle(display,mywin,gc,a,160,200,100);

  XFlush(display);

  printf("Hit <return> to exit\n");
  scanf("%c",&ch);

  XFreeGC(display,gcb);
  XFreeGC(display,gc);
  XDestroyWindow(display,mywin);
  XCloseDisplay(display);

}









































Path: pimac2.iet.unipi.it!romano
Newsgroups: comp.os.linux
Distribution: world
Followup-To: 
From: romano@pimac2.iet.unipi.it (Romano Giannetti)
Organization: 
Subject: X386 XDrawArc() bugged? (and other things...)
Keywords: 

I have installed from SLS distribution Linux 0.98pl5 on a 386/25
laptop, with a VGA-compatible LCD, 4M Ram and 100M HD (16Mbyte of
swap). The system is up and running, I had only minor problems 
(I had to chgrp mem {ps,free} and chmod -R a+r /usr/man); 
but it seem I have found a really strange bug in the libX11 library 
(I think, may be the problem is in the Xmono server, I don't know 
so well X11 protocol. Peraphs I have to post it on some other newsgroup?
Which one? ) I think to have localized the problem 
with the following little program.
 
Compile (gcc -o bug bug.c -lX11) the program and run it so:

>  ./bug 1 10

it writes 'gc line_width)=1' and then plot two rectangles with
ellipses in it: the first one, on the top, correct (I have plotted it
with Graphic Context gcb, where I have asked *explicitly* line_width
of 1); the second one, at the bottom, has the ellipses traced only in
part and shifted on the x-axis to the right (in my screen). Also the
programs xvier (that comes with the distribution) and xfig 2.1.6 (that
I compiled and that showed me the problem) have the same behaviour.

Now, when the window come out, put it near the edge of the screen, so
that the ellipses are not traced completely: you'll see the two
drawings come out perfect. 

Have you the same problem or I have some strange (but it has to be
VERY strange) problem in my computer or in my installation procedure?

Thank for EVERY answer cause I NEED circles in xfig to draw electronic
circuits... 

                Romano.

PS: few other question: 

1) where can I find a non-shared lib/libm.a to compile my programs
with -g flags?

2) I know it's trivial cause it's the default, but if I say -dynamic
to gcc it understand I want put it in debug mode, flags ynamic...

3) Have you any trouble with XSynchronize? It seem not to work for me...

So THANKS GUYS. (Little problems, but LINUX is GREAT).

-- 
***************************************************************************
* Romano Giannetti          * Dip.to di Ingegneria dell'Informazione      *
*                           * Elettronica, Informatica e Telecomunicazioni*
* romano@iet.unipi.it       * via Diotisalvi,2                            *
* giannetti@sssup1.sssup.it * Universita' di Pisa, I-56126 PISA, Italy    *
***************************************************************************

Here is the program bug.c:

-------------------cut here---------------------------------------

/* bug.c by RGtti Nov 30, 1992 */
/* compile gcc -o bug bug.c -lX11 (-static if you want) */
/* use ./bug <thickness> <xpos> : 
   with the window all in screen, ./bug 1 10 shows the problem */

#include   <stdio.h>
#include   <X11/Xlib.h>

main(int argc, char **argv) {

  Display                 *display;
  int                     screen,a,t;
  Window                  mywin;
  char                    ch;
  GC                      gc,gcb;
  XGCValues               v;
  XSetWindowAttributes    attributes;
  unsigned long           attribute_mask;
  XEvent                  exposed;

  if (argc!=3) exit(1);

  t=atoi(argv[1]);		/* Try 1,2: explicit line_width */
  a=atoi(argv[2]);		/* Try 10 (bug), -10 (ok) */

  display=XOpenDisplay((char *)NULL); /* Open display */
  screen=DefaultScreen(display);

  attributes.background_pixel = WhitePixel(display,screen);
  attributes.border_pixel     = BlackPixel(display,screen);
  attributes.event_mask       = ExposureMask;
  attribute_mask              = CWBackPixel | CWBorderPixel | CWEventMask;

  mywin=XCreateWindow(display,
		      RootWindow(display,screen),
		      100, 100, 300, 300, 2,      
		      CopyFromParent, InputOutput, CopyFromParent,
		      attribute_mask,
		      &attributes );

  XMapWindow(display,mywin);

  XFlush(display); 

  /* This to wait for the window being mapped...*/
  while(1) {
    XNextEvent(display,&exposed);
    if ( exposed.xexpose.count == 0) break;
  }

  v.foreground=BlackPixel(display,screen);
  v.background=WhitePixel(display,screen);
  v.line_width=t;
  
  /* gc don't work for arc drawing , gcb is correct, also if t (the first
     argument) is 1! (that is, the default value) */

  gc=XCreateGC(display,mywin,GCForeground|GCBackground,&v);
  gcb=XCreateGC(display,mywin,GCForeground|GCBackground|GCLineWidth,&v);
     
  (void) XGetGCValues(display,gc,(1L<<(GCLastBit+1)-1),&v);
  printf("gc has (default) line_width=%d\n",v.line_width);

  /* 
      HERE THE PROBLEM !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      The first arc is always ok, the second is ok only if it is
      partially out of the window (or the screen) (????????) 
  */

  XDrawArc(display,mywin,gcb,a,10,200,100,0,360*64);
  XDrawArc(display,mywin,gc,a,160,200,100,0,360*64);
 
  /* This are always ok */

  XDrawRectangle(display,mywin,gcb,a,10,200,100);
  XDrawRectangle(display,mywin,gc,a,160,200,100);

  XFlush(display);

  printf("Hit <return> to exit\n");
  scanf("%c",&ch);

  XFreeGC(display,gcb);
  XFreeGC(display,gc);
  XDestroyWindow(display,mywin);
  XCloseDisplay(display);

}









































Path: pimac2.iet.unipi.it!romano
Newsgroups: comp.os.linux
Distribution: world
Followup-To: 
From: romano@pimac2.iet.unipi.it (Romano Giannetti)
Organization: 
Subject: X386 XDrawArc() bugged? (and other things...)
Keywords: 

I have installed from SLS distribution Linux 0.98pl5 on a 386/25
laptop, with a VGA-compatible LCD, 4M Ram and 100M HD (16Mbyte of
swap). The system is up and running, I had only minor problems 
(I had to chgrp mem {ps,free} and chmod -R a+r /usr/man); 
but it seem I have found a really strange bug in the libX11 library 
(I think, may be the problem is in the Xmono server, I don't know 
so well X11 protocol. Peraphs I have to post it on some other newsgroup?
Which one? ) I think to have localized the problem 
with the following little program.
 
Compile (gcc -o bug bug.c -lX11) the program and run it so:

>  ./bug 1 10

it writes 'gc line_width)=1' and then plot two rectangles with
ellipses in it: the first one, on the top, correct (I have plotted it
with Graphic Context gcb, where I have asked *explicitly* line_width
of 1); the second one, at the bottom, has the ellipses traced only in
part and shifted on the x-axis to the right (in my screen). Also the
programs xvier (that comes with the distribution) and xfig 2.1.6 (that
I compiled and that showed me the problem) have the same behaviour.

Now, when the window come out, put it near the edge of the screen, so
that the ellipses are not traced completely: you'll see the two
drawings come out perfect. 

Have you the same problem or I have some strange (but it has to be
VERY strange) problem in my computer or in my installation procedure?

Thank for EVERY answer cause I NEED circles in xfig to draw electronic
circuits... 

                Romano.

PS: few other question: 

1) where can I find a non-shared lib/libm.a to compile my programs
with -g flags?

2) I know it's trivial cause it's the default, but if I say -dynamic
to gcc it understand I want put it in debug mode, flags ynamic...

3) Have you any trouble with XSynchronize? It seem not to work for me...

So THANKS GUYS. (Little problems, but LINUX is GREAT).

-- 
***************************************************************************
* Romano Giannetti          * Dip.to di Ingegneria dell'Informazione      *
*                           * Elettronica, Informatica e Telecomunicazioni*
* romano@iet.unipi.it       * via Diotisalvi,2                            *
* giannetti@sssup1.sssup.it * Universita' di Pisa, I-56126 PISA, Italy    *
***************************************************************************

Here is the program bug.c:

-------------------cut here---------------------------------------

/* bug.c by RGtti Nov 30, 1992 */
/* compile gcc -o bug bug.c -lX11 (-static if you want) */
/* use ./bug <thickness> <xpos> : 
   with the window all in screen, ./bug 1 10 shows the problem */

#include   <stdio.h>
#include   <X11/Xlib.h>

main(int argc, char **argv) {

  Display                 *display;
  int                     screen,a,t;
  Window                  mywin;
  char                    ch;
  GC                      gc,gcb;
  XGCValues               v;
  XSetWindowAttributes    attributes;
  unsigned long           attribute_mask;
  XEvent                  exposed;

  if (argc!=3) exit(1);

  t=atoi(argv[1]);		/* Try 1,2: explicit line_width */
  a=atoi(argv[2]);		/* Try 10 (bug), -10 (ok) */

  display=XOpenDisplay((char *)NULL); /* Open display */
  screen=DefaultScreen(display);

  attributes.background_pixel = WhitePixel(display,screen);
  attributes.border_pixel     = BlackPixel(display,screen);
  attributes.event_mask       = ExposureMask;
  attribute_mask              = CWBackPixel | CWBorderPixel | CWEventMask;

  mywin=XCreateWindow(display,
		      RootWindow(display,screen),
		      100, 100, 300, 300, 2,      
		      CopyFromParent, InputOutput, CopyFromParent,
		      attribute_mask,
		      &attributes );

  XMapWindow(display,mywin);

  XFlush(display); 

  /* This to wait for the window being mapped...*/
  while(1) {
    XNextEvent(display,&exposed);
    if ( exposed.xexpose.count == 0) break;
  }

  v.foreground=BlackPixel(display,screen);
  v.background=WhitePixel(display,screen);
  v.line_width=t;
  
  /* gc don't work for arc drawing , gcb is correct, also if t (the first
     argument) is 1! (that is, the default value) */

  gc=XCreateGC(display,mywin,GCForeground|GCBackground,&v);
  gcb=XCreateGC(display,mywin,GCForeground|GCBackground|GCLineWidth,&v);
     
  (void) XGetGCValues(display,gc,(1L<<(GCLastBit+1)-1),&v);
  printf("gc has (default) line_width=%d\n",v.line_width);

  /* 
      HERE THE PROBLEM !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      The first arc is always ok, the second is ok only if it is
      partially out of the window (or the screen) (????????) 
  */

  XDrawArc(display,mywin,gcb,a,10,200,100,0,360*64);
  XDrawArc(display,mywin,gc,a,160,200,100,0,360*64);
 
  /* This are always ok */

  XDrawRectangle(display,mywin,gcb,a,10,200,100);
  XDrawRectangle(display,mywin,gc,a,160,200,100);

  XFlush(display);

  printf("Hit <return> to exit\n");
  scanf("%c",&ch);

  XFreeGC(display,gcb);
  XFreeGC(display,gc);
  XDestroyWindow(display,mywin);
  XCloseDisplay(display);

}









































To: mark@coombs.anu.edu.au (Mark)
Subject: Re: revisited, determining if anyone else is logged on


In article <mark.723253661@coombs>, you write:
|> subbarao@fc.hp.com (Kartik Subbarao) writes:
|> 
|> >Hold on just a minute, guys. I keep wondering what's the big deal about
|> >writeable utmp files. So what if you change your utmp name to 'root', god
|> >forbid. Yay, so I can forge talk requests from anyone -- whoopitty do. And,
|> >I can do the amazingly death-defying task of printing my file as someone else.
|> >What programs uses utmp for any sort of 'authentication'? Even if you exploit
|> >comsat, that still won't give you root access.
|> 
|> Change your terminal to "/.rhosts" and do an rwall of "+ +".
|> 
|> Comprehende?
|> 
|> Mark

Ehp, I don't. If you have to explain this to someone else (don't waste 
time for my curiosity :), can you Cc: it to me also? TIA.

   Romano.

-- 
***************************************************************************
* Romano Giannetti          * Dip.to di Ingegneria dell'Informazione      *
*                           * Elettronica, Informatica e Telecomunicazioni*
* romano@iet.unipi.it       * via Diotisalvi,2                            *
* giannetti@sssup1.sssup.it * Universita' di Pisa, I-56126 PISA, Italy    *
***************************************************************************




-- 
***************************************************************************
* Romano Giannetti          * Dip.to di Ingegneria dell'Informazione      *
*                           * Elettronica, Informatica e Telecomunicazioni*
* romano@iet.unipi.it       * via Diotisalvi,2                            *
* giannetti@sssup1.sssup.it * Universita' di Pisa, I-56126 PISA, Italy    *
***************************************************************************