Subject: Re: bug#746: Killed when starting modale dialog like pinentry

From: Ralph Ronnquist <[email-masked]>
Date: Tue, 7 Mar 2023 23:31:41 +1100

I studied the Xorg logs and had the following thoughts

both Xorg logs shows grief when a new monitor is connected

nvidia at about 1312258.437 and amd at about 117563.217

nvidia "survives" a long time (20h?), but with repeated hickups

amd doesn't show extended use but rather X goes down within 20 sec

I'm not sure how gpu memory is used or computed but I suppose one
possibility is that it's not enough for the 3840x2400 side monitor
(plus the 1920x1200 LCD)

possibly amd says it has 1Gb memory; nvidia appears to reserve 6GB

----

All that might suggest some underlying hardware issue(s) but evenso it
appears X terminates peacefully without any log line explaining why.

Perhaps a deeper code review is needed to trace what happens when a
functioning GPU "suddenly disappears".

Ralph.

---

From: Ralph Ronnquist <[email-masked]>
Date: Wed, 8 Mar 2023 07:36:27 +1100

Apparently, "exiting" happens in the DoConfigure function which logs
to stderr rather than the log file. So you will need to arrange to
capture stderr for Xorg to get another lead to the exiting.

One way to do that is to (temporarily) move /usr/bin/Xorg to, say,
/usr/bin/Xorg.real, and write an executable text file as /usr/bin/Xorg
with the single 2 lines:
----
#!/bin/sh
exec /usr/bin/Xorg.real $* 2> /tmp/X-stderr-$(date +%s).log
----

By that, any stderr output from Xorg.real will be written to the
special log files /tmp/X-stderr-*.log where the * part is a "Unix
epoch seconds" timestamp, which would be near in time to the creation
time of the associated Xorg.0.log file.

Ralph.