# US 11,442,843 B2 · Methods and systems for identifying, handling, and debugging a hung thread

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 11,442,843 B2
- Document ID: US11442843B2
- Status: Granted
- Kind: B2
- Application number: 16/677,474
- Filed: 2019-11-07
- Published: 2021-03-18
- Granted: 2022-09-13
- Earliest claimed: 2019-09-13
- Assignees: DISH Network Technologies India Private Limited
- Applicants: DISH Network Technologies India Private Limited
- Inventors: Gajanan Hegde; Rakesh Eluvan
- Web page: https://patentgrep.com/patent/US11442843B2

## CPC

- G06F 11/076: {by exceeding a count or rate limit, e.g. word- or bit count limit}
- G06F 11/3636: {by tracing the execution of the program}
- G06F 11/366: {using diagnostics (G06F11/0703 takes precedence)}
- G06F 11/0787: {Storage of error reports, e.g. persistent data storage, storage using memory protection}
- G06F 11/0793: {Remedial or corrective actions (recovery from an exception in an instruction pipeline G06F9/3861; by retry G06F11/1402; for recovering from a failure of a protocol instance or entity H04L69/40)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Various arrangements for debugging a hung thread of a software application are presented. A thread monitor module may be executed that monitors for any hung threads within a plurality of executing threads. A monitoring initialization message may be received that initiates thread monitoring of a thread. In response to the monitoring initialization message, tracking of the thread may be commenced by determining whether an update message for the thread has been received within an amount of time allotted for the update message to be sent. If the update message is not received, the thread may be identified as hung. Debugging information generated in response to identifying the hung thread may be used for creating an improved version of the software application that prevents the hang.

## Claims

### Claim 1

A method for debugging a hung thread on a streaming media player device, the method comprising:
executing, by the streaming media player device, a first thread of a plurality of threads, the first thread being a thread monitor module, wherein the thread monitor module monitors for any hung threads within the plurality of threads that function to cause streaming media to be output for presentation;
receiving, by the thread monitor module of the streaming media player device, from a second thread of the plurality of threads, a monitoring initialization message to initiate thread monitoring of the second thread, wherein the monitoring initialization message comprises: a thread identifier of the second thread; and an update frequency time period;
registering, by the thread monitor module, a defined signal with an operating system;
in response to the monitoring initialization message, commence tracking, by the thread monitor module on the streaming media player device, the second thread by determining whether an update message from the second thread has been received within the update frequency time period indicated in the monitoring initialization message;
receiving, by the thread monitor module from the second thread, the update message that indicates the second thread is not hung;
determining, by the thread monitor module, that at least the update frequency time period has elapsed since the update message has been received from the second thread, thereby identifying the second thread as the hung thread;
in response to determining that at least the update frequency time period has elapsed since the update message has been received from the second thread, raising the defined signal on the hung thread;
receiving, by a management thread of the plurality of threads, from the thread monitor module, an indication of the thread identifier of the hung thread; and
receiving an action message indicating an action to perform to remediate the hung thread, wherein the action is selected from the group consisting of: restarting an application; restarting the streaming media player device on which the application and the hung thread is executing; restarting the second thread; and ending execution of the second thread.

### Claim 2 (depends on 1)

The method for debugging the hung thread of claim 1, further comprising:
in response to the defined signal being raised on the hung thread, causing a signal handler mapped to the defined signal to be executed on top of a stack of the hung thread.

### Claim 3 (depends on 2)

The method for debugging the hung thread of claim 2, further comprising:
obtaining, by the signal handler, a stack trace of the hung thread.

### Claim 4 (depends on 3)

The method for debugging the hung thread of claim 3, further comprising:
creating a report on the hung thread based on the stack trace.

### Claim 5 (depends on 4)

The method for debugging the hung thread of claim 4, further comprising:
outputting the report on the hung thread via the Internet to a remote diagnostic server system.

### Claim 6 (depends on 1)

The method for debugging the hung thread of claim 1, further comprising:
outputting, by the thread monitor module, an indication of the hung thread being executed.

### Claim 7

A device, comprising:
a user interface;
a network interface;
a processing system of the device, comprising one or more processors, the processing system being in communication with the user interface and the network interface;
an application, comprising a plurality of threads, executed by the processing system of the device;
a thread monitor module executed by the processing system of the device that monitors for any hung threads within the plurality of threads being executed by the processing system of the device, wherein the thread monitor module is executed as a first thread of the plurality of threads and is configured to:
receive a monitoring initialization message from a second thread of the plurality of threads to initiate thread monitoring of the second thread, wherein the monitoring initialization message comprises: a thread identifier of the second thread; and an update frequency time period;
register a defined signal with an operating system of the device;
in response to the monitoring initialization message, track the second thread by determining whether an update from the second thread has been received within the update frequency time period indicated in the monitoring initialization message;
receive, from the second thread, the update that indicates the second thread is not hung;
determine that at least the update frequency time period has elapsed since the update has been received from the second thread, thereby identifying the second thread as the hung thread;
in response to determining that at least the update frequency time period has elapsed since the update has been received from the second thread, raise the defined signal on the hung thread; and
a management thread, executed as part of the plurality of threads, configured to:
receive, from the thread monitor module, an indication of the thread identifier of the hung thread; and
receive an action message indicating an action to perform to remediate the hung thread, wherein the action is selected from the group consisting of:
restarting the application; restarting the device on which the application and the hung thread is executing; starting the second thread; and ending execution of the second thread.

### Claim 8 (depends on 7)

The device of claim 7, wherein the thread monitor module is further configured to cause a signal handler mapped to the defined signal to be executed on top of a stack of the hung thread in response to the defined signal being raised on the hung thread.

### Claim 9 (depends on 8)

The device of claim 8, the device further comprising the signal handler, wherein the signal handler, when executed on top of the stack of the hung thread is configured to obtain a stack trace of the hung thread.

### Claim 10 (depends on 9)

The device of claim 9, wherein the thread monitor module is further configured to output a report generated based on the stack trace via the Internet to a remote diagnostic server system.

### Claim 11 (depends on 7)

The device of claim 7, wherein the thread monitor module is further configured to:
output an indication of the hung thread to another thread of the application.

### Claim 12 (depends on 7)

The device of claim 7, wherein the device is a streaming media player device that comprises the processing system.

### Claim 13

A non-transitory processor-readable medium comprising processor-readable instructions configured to cause one or more processors of a device to:
execute, a first thread of a plurality of threads, the first thread being a thread monitor module, wherein the thread monitor module monitors for hung threads within the plurality of threads;
receive a monitoring initialization message from a second thread of the plurality of threads, wherein the monitoring initialization message initiates thread monitoring of the second thread and the monitoring initialization message comprises: a thread identifier of the second thread; and an update frequency time period;
register a defined signal with an operating system;
in response to the monitoring initialization message, track the second thread by determining whether an update from the second thread has been received within the update frequency time period indicated in the monitoring initialization message;
receive, from the thread, the update that indicates the second thread is not hung;
determine that at least the update frequency time period has elapsed since the update has been received from the second thread, thereby identifying the second thread as a hung thread;
in response to determining that at least the update frequency time period has elapsed since the update has been received from the second thread, raise a defined signal on the hung thread; and
receive, by a management thread of the plurality of threads, from the thread monitor module, an indication of the thread identifier of the hung thread; and
receive an action message indicating an action to perform to remediate the hung thread, wherein the action is selected from the group consisting of: restarting an application; restarting the device on which the application and the hung thread is executing; restarting the second thread; and ending execution of the second thread.

### Claim 14 (depends on 13)

The non-transitory processor-readable medium of claim 13 wherein the processor-readable instructions are further configured to cause the one or more processors to cause a signal handler mapped to the defined signal to be executed on top of a stack of the hung thread in response to the defined signal being raised on the hung thread.
