LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-30-2019, 11:46 AM   #1
TheJooomes
LQ Newbie
 
Registered: May 2019
Location: Minnesota USA
Distribution: Kubuntu
Posts: 9

Rep: Reputation: Disabled
[SOLVED]How do I Force an Application to Hang (stop responding)


I'd like to do some testing to compare how Xorg and Wayland handle an unresponsive window, preferably something with optional client side decorations like firefox. Any idea how I can do this?

Last edited by TheJooomes; 07-09-2019 at 03:11 PM.
 
Old 06-30-2019, 11:53 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 12,935

Rep: Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078
Ctrl-S and Ctrl-Q probably what you need. That will send sighup by default if I remember well - obviously works only if the app doe not handle the event differently.
 
Old 06-30-2019, 12:22 PM   #3
TheJooomes
LQ Newbie
 
Registered: May 2019
Location: Minnesota USA
Distribution: Kubuntu
Posts: 9

Original Poster
Rep: Reputation: Disabled
Already tried stopping the process for an application. It just freezes it so I can't do anything inside the window, then when I continue the process, it all at once registers everything I did to it while stopped. I need a process to full on hang so there's no recovering from it and the window turns gray.
 
Old 06-30-2019, 12:32 PM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: MA, USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 7,888
Blog Entries: 13

Rep: Reputation: 3379Reputation: 3379Reputation: 3379Reputation: 3379Reputation: 3379Reputation: 3379Reputation: 3379Reputation: 3379Reputation: 3379Reputation: 3379Reputation: 3379
Might be best to write an application which behaves this way intentionally. You can control your testing better.
 
Old 07-01-2019, 02:00 AM   #5
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 12,935

Rep: Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078
I do not really know what do you mean by unresponsive. You can write a simple app which just sleeps forever, but again need to define what do you mean by unresponsive.
 
Old 07-01-2019, 02:47 AM   #6
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware
Posts: 9,029

Rep: Reputation: 3898Reputation: 3898Reputation: 3898Reputation: 3898Reputation: 3898Reputation: 3898Reputation: 3898Reputation: 3898Reputation: 3898Reputation: 3898Reputation: 3898
This Python 3/PyQt5 program will hang when you click it:

Code:
from PyQt5 import QtGui, QtWidgets
import sys

class Main(QtWidgets.QMainWindow):
    def __init__(self):
        super().__init__()
        button = QtWidgets.QPushButton("&Hang")
        button.clicked.connect(self.hang)
        self.setCentralWidget(button)

    def hang(self):
        while True:
            pass


app = QtWidgets.QApplication(sys.argv)
main = Main()
main.show()
sys.exit(app.exec_())
 
Old 07-02-2019, 04:23 PM   #7
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 1,152

Rep: Reputation: 524Reputation: 524Reputation: 524Reputation: 524Reputation: 524Reputation: 524
You can freeze a running process with
Code:
kill -STOP <pid>
Continue a stopped process with
Code:
kill -CONT <pid>
 
Old 07-03-2019, 02:01 AM   #8
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 12,935

Rep: Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078
The problem is (probably): in case of X sometimes not the app, but X (or Xorg) itself stops responding, that cannot be simulated that way.
 
Old 07-06-2019, 09:26 PM   #9
X-LFS-2010
Member
 
Registered: Apr 2016
Posts: 423

Rep: Reputation: Disabled
Quote:
Originally Posted by TheJooomes View Post
I'd like to do some testing to compare how Xorg and Wayland handle an unresponsive window
i can't imagine any good outcome of performing such a test and knowing the result. Xorg killed X11 and Wayland and (ubutu's thing) are trying to kill Xorg.

also: the source for both those programs is gittoriously online - what each do isn't a question it's published.

if your thought is that X11 didn't know what to do if an application hung: your wrong. it did. even win95 did.
 
Old 07-06-2019, 09:28 PM   #10
X-LFS-2010
Member
 
Registered: Apr 2016
Posts: 423

Rep: Reputation: Disabled
CORRECTION. X11 stole X10 but tried to preserve it. Xorg stole X11 and destroyed it. Wayland stole Xorg and tries to erase it from history. And Ubuntu has it's own, doing similarly. and Samsung has it's own idea of it's phone OS taking over.

i try to stay away from all those people, myself
 
Old 07-06-2019, 09:35 PM   #11
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 15,204
Blog Entries: 25

Rep: Reputation: 4331Reputation: 4331Reputation: 4331Reputation: 4331Reputation: 4331Reputation: 4331Reputation: 4331Reputation: 4331Reputation: 4331Reputation: 4331Reputation: 4331
I think Ubuntu has given up on Mir, at least for the desktop, and is looking enviously at Waylaid--er, Wayland. https://en.wikipedia.org/wiki/Mir_(software)
 
Old 07-09-2019, 03:09 PM   #12
TheJooomes
LQ Newbie
 
Registered: May 2019
Location: Minnesota USA
Distribution: Kubuntu
Posts: 9

Original Poster
Rep: Reputation: Disabled
So after playing around I discovered that just stopping the process isn't enough, I also have to attempt closing the window and then I get the result I want, a grey window with the title not responding.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] play on linux frontend quits responding then wants me to force quit linux/unix87 Linux - Newbie 1 10-29-2010 07:12 AM
usb keyb and mouse randomly stop responding netsurf Linux - Hardware 1 10-18-2007 06:16 PM
keyboard and touchpad stop responding randomly damnsynaptic Linux - Laptop and Netbook 10 06-05-2006 05:40 PM
keyboard and mouse stop responding coffeedemon Linux - Software 8 11-09-2004 03:53 PM
Keyboard and Mouse Buttons stop responding h2gofast Linux - General 2 02-26-2004 12:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration