Bug#905015: xserver-xorg-input-elographics: Xorg hangs on start when touchscreen does not answer

2018-07-30 Thread Frank Heckenbach
Package: xserver-xorg-input-elographics
Version: 1:1.4.1-1
Severity: normal
Tags: patch

See subject.

Reason: ELO_MAX_WAIT is microseconds, but xf86WaitForInput expects
milliseconds.

Patch (line numbers after #776990):

--- src/xf86Elo.c
+++ src/xf86Elo.c
@@ -459,7 +459,7 @@
  * timeout and each wrong packet.
  */
 DBG(4, ErrorF("Waiting %d ms for data from port\n", ELO_MAX_WAIT / 1000));
-result = xf86WaitForInput(fd, ELO_MAX_WAIT);
+result = xf86WaitForInput(fd, ELO_MAX_WAIT / 1000);
 if (result > 0) {
   ok = xf86EloGetPacket(reply, &reply_p, &sum, fd);
   /*



Bug#905033: xserver-xorg-input-elographics: locks up system on EOF from touchscreen

2018-07-30 Thread Frank Heckenbach
Package: xserver-xorg-input-elographics
Version: 1:1.4.1-1
Severity: normal
Tags: patch

When reading from the touchscreen device returns 0 (EOF), the driver
goes into an endless loop of poll and read. This locks up the Xorg
server, and when trying to kill it with -9, it hangs the whole
system (no idea how it manages to do that, but only an unfriendly
reboot seems to help):

  watchdog: BUG: soft lockup - CPU#7 stuck for 22s! [Xorg:3781]

Patch to handle EOF like error return:

--- src/xf86Elo.c
+++ src/xf86Elo.c
@@ -251,6 +251,10 @@
 ErrorF("System error while reading from Elographics touchscreen.");
 return !Success;
   }
+  if (num_bytes == 0) {
+ErrorF("EOF while reading from Elographics touchscreen.");
+return !Success;
+  }
   DBG(4, ErrorF("Read %d bytes\n", num_bytes));
 
   while (num_bytes) {

Well, I thought that would help, but it didn't. Seems I
misunderstood the comment above: "Okay, give up."

That's not what I understand by giving up, it still keeps retrying
and spamming the log with "EOF while reading from Elographics
touchscreen." -- at this point I also noticed the missing "\n" in
the error messages.

So without changing too much (the fd is passed by value, so I can't
easily change it; also I don't know when this function is called
from where etc.), for a quick and dirty solution I just reassign the
fd to something harmless. /dev/null doesn't work as it always
returns ready in poll and EOF in read too, so I create a pipe,
discard one end, so the other end will be not ready for reading.
This seems to work for me, but a permanent solution should probably
do something more elegant:

--- src/xf86Elo.c
+++ src/xf86Elo.c
@@ -58,6 +58,8 @@
 
 #include "xf86Module.h"
 
+#include 
+
 /**
  * models to be treated specially.
  */
@@ -248,7 +250,18 @@
* Okay, give up.
*/
   if (num_bytes < 0) {
-ErrorF("System error while reading from Elographics touchscreen.");
+ErrorF("System error while reading from Elographics touchscreen.\n");
+return !Success;
+  }
+  if (num_bytes == 0) {
+/*
+ * Avoid reading from fd again, quick and dirty. Discard one end of a pipe,
+ * so the other end never gets EOF (unlike /dev/null) or reads anything.
+ */
+int dummy[2];
+pipe(dummy);
+dup2(dummy[0], fd);
+ErrorF("EOF while reading from Elographics touchscreen.\n");
 return !Success;
   }
   DBG(4, ErrorF("Read %d bytes\n", num_bytes));



Bug#776371: x11-utils: xwininfo segfaults when given invalid screen number

2015-01-27 Thread Frank Heckenbach
Package: x11-utils
Version: 7.7~1
Severity: normal

xwininfo segfaults when given an invalid screen number:

% DISPLAY=:0.100 xwininfo -root
xwininfo: Please select the window about which you
  would like information by clicking the
  mouse in that window.
Segmentation fault

Unlike an invalid display number:

% DISPLAY=:100.0 xwininfo -root
xwininfo: error: unable to open display ":100.0"


-- 
To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/e1yg4io-0001iq...@m31.gerwinski.de



Bug#776990: xserver-xorg-input-elographics: inverted and swapped axes don't work

2015-02-03 Thread Frank Heckenbach
Package: xserver-xorg-input-elographics
Version: 1:1.4.1-1+fh1
Severity: normal
Tags: upstream patch

Inverted and swapped axes don't work:

- priv->swap_axes is set and never used, so clearly it cannot work.

- Limits are passed to InitValuatorAxisStruct which doesn't work
  (at least) with inverted axes (min > max), see clipAxis():

/* If a value range is defined, clip. If not, do nothing */
if (axis->max_value <= axis->min_value)
return;

- Both things worked in older versions (e.g. squeeze).

- The changes since then even kept a comment
  (/* I will map coordinates myself */)
  which was now wrong and misleading (and is correct again after my
  patch).

- The attached patch restores the respective code from that version.

- The patched code is tested! (Unlike the current code which was
  obviously never tested, see first point.)

- I will have access to suitable touch screens for 1-2 more weeks
  (in case you'd like me to test other changes or so).
--- src/xf86Elo.c
+++ src/xf86Elo.c
@@ -307,6 +307,46 @@
 /*
  ***
  *
+ * xf86EloConvert --
+ *	Convert extended valuators to x and y suitable for core motion
+ *	events. Return True if ok and False if the requested conversion
+ *	can't be done for the specified valuators.
+ *
+ ***
+ */
+static void
+xf86EloConvert(EloPrivatePtr			priv,
+	   int		*x,
+	   int		*y)
+{
+  int		width = priv->max_x - priv->min_x;
+  int		height = priv->max_y - priv->min_y;
+  int		input_x, input_y;
+
+  DBG(3, ErrorF("EloConvert: Screen(%d) - x(%d), y(%d)\n", priv->screen_no, *x, *y));
+
+  if (width == 0) width = 1;
+  if (height == 0) height = 1;
+
+  if (priv->swap_axes) {
+input_x = *y;
+input_y = *x;
+  }
+  else {
+input_x = *x;
+input_y = *y;
+  }
+  *x = (priv->screen_width * (input_x - priv->min_x)) / width;
+  *y = (priv->screen_height -
+	(priv->screen_height * (input_y - priv->min_y)) / height);
+
+  DBG(3, ErrorF("EloConvert: Screen(%d) - x(%d), y(%d)\n", priv->screen_no, *x, *y));
+}
+
+
+/*
+ ***
+ *
  * xf86EloReadInput --
  *	Read all pending report packets from the touchscreen and enqueue
  *	them.
@@ -360,6 +400,8 @@
   cur_y = WORD_ASSEMBLY(priv->packet_buf[5], priv->packet_buf[6]);
   state = priv->packet_buf[2] & 0x07;
 
+  xf86EloConvert(priv, &cur_x, &cur_y);
+
   /*
* Send events.
*
@@ -722,14 +764,14 @@
 	/* I will map coordinates myself */
 	InitValuatorAxisStruct(dev, 0,
 			   axis_labels[0],
-			   priv->min_x, priv->max_x,
+			   -1, -1,
 			   9500,
 			   0 /* min_res */,
 			   9500  /* max_res */,
 			   Absolute);
 	InitValuatorAxisStruct(dev, 1,
 			   axis_labels[1],
-			   priv->min_y, priv->max_y,
+			   -1, -1,
 			   10500,
 			   0 /* min_res */,
 			   10500 /* max_res */,


Bug#905015: xserver-xorg-input-elographics: Xorg hangs on start when touchscreen does not answer

2021-02-17 Thread Frank Heckenbach
> This was a bug in X server 1.19 fixed in 1.19.4 with
> https://gitlab.freedesktop.org/xorg/xserver/-/commit/d8f63717e05ae8d820ceae74216916ebd180441d
> 
> Unfortunately this bug is in the X server in stretch and won't get fixed 
> there now that stretch is LTS, but the versions in buster and later 
> should be fine.

I guess that explains why I got reports of touchscreens not working
reliably in buster:

I had applied the above patch to xserver-xorg-input-elographics,
after duly checking it hadn't been applied yet. But of course, I had
no way of knowing that the problem was fixed another way in another
package.

The result now was apparently an overcorrection, resulting in
timeouts being too short and sometimes timing out ...



Bug#1038648: Xspice crashes on start

2023-06-19 Thread Frank Heckenbach
Package: xserver-xspice
Version: 0.1.5+git20200331-3
Severity: grave
Justification: renders package unusable

Since upgrading to bookworm, Xspice always crashes when I try to
start it:

Xspice --config xspice.1.conf :25

(EE) Caught signal 6 (Aborted). Server aborting

Full log: xspice.1.log

https://gitlab.freedesktop.org/xorg/driver/xf86-video-qxl/-/issues/14
describes a similar problem and suggest to add some options in the
config file. When I do this, I get a segfault instead:

Xspice --config xspice.2.conf :25

(EE) Caught signal 11 (Segmentation fault). Server aborting

Full log: xspice.2.log

The page above mentions this too and refers to
https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-qxl/+bug/1967719

That report was closed since they were "confident it was fixed in
https://launchpad.net/ubuntu/+source/xserver-xorg-video-qxl/0.1.5+git20200331-3";.
However, the same version seems to be in bookworm (unless Debian
made its own changes to it), and the problem does occur.

-- System Information:
Debian Release: 12.0
  APT prefers stable-security
  APT policy: (500, 'stable-security'), (500, 'stable-debug'), (500, 
'proposed-updates-debug'), (500, 'proposed-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-9-amd64 (SMP w/24 CPU threads; PREEMPT)
Locale: LANG=de_DE, LC_CTYPE=de_DE (charmap=ISO-8859-1), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages xserver-xspice depends on:
ii  libc6  2.36-9
ii  libspice-server1   0.15.1-1
ii  libxfont2  1:2.0.6-1
ii  python33.11.2-1+b1
ii  xserver-xorg   1:7.7+23
ii  xserver-xorg-core [xorg-video-abi-25]  2:21.1.7-3

xserver-xspice recommends no packages.

xserver-xspice suggests no packages.

-- no debconf information


xspice.1.conf
Description: Binary data


xspice.1.log
Description: Binary data


xspice.2.conf
Description: Binary data


xspice.2.log
Description: Binary data


Bug#1038648: Xspice crashes on start

2023-06-20 Thread Frank Heckenbach
Control: tags patch

I think I found the problem. It seems to be
Fix-a-build-error-with-Xorg-master.patch

To be honest, I don't really understand the patch. According to the
comment, instead of just changing one renamed parameter, it changes
the calling conventions at the cost of an unnecessary "slight
performance drop" in not one but three functions "for consistency"
and goes on to explain why it should work which sounds questionable
to me and apparently doesn't work after all.

So instead doing the simple thing seems to work. I suggest replacing
the patch with this one:

Index: xserver-xorg-video-qxl-0.1.5+git20200331/src/qxl_option_helpers.c
===
--- xserver-xorg-video-qxl-0.1.5+git20200331.orig/src/qxl_option_helpers.c
+++ xserver-xorg-video-qxl-0.1.5+git20200331/src/qxl_option_helpers.c
@@ -34,7 +34,7 @@ int get_bool_option(OptionInfoPtr option
 const char* value = getenv(env_name);
 
 if (!value) {
-return options[option_index].value.bool;
+return options[option_index].value.boolean;
 }
 if (strcmp(value, "0") == 0 ||
 strcasecmp(value, "off") == 0 ||



Bug#1038648: closed by Debian FTP Masters (reply to Timo Aaltonen ) (Bug#1038648: fixed in xserver-xorg-video-qxl 0.1.6-1)

2023-06-27 Thread Frank Heckenbach
Doesn't fix the problem.



Bug#1042862: Xspice crashes on start

2023-08-01 Thread Frank Heckenbach
Package: xserver-xspice
Version: 0.1.6-1
Severity: grave
Justification: renders package unusable

See #1038648.

As I wrote there, 0.1.6-1 doesn't fix the problem, but this was
ignored, so I'm sending a new bug report.

The buggy patch is now upstream, but that doesn't make it correct.
I've already explained how to fix it correctly.