# US 2021/0081300 A1 · 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 2021/0081300 A1
- Document ID: US20210081300A1
- Status: Published application
- Kind: A1
- Application number: 16/677,474
- Filed: 2019-11-07
- Published: 2021-03-18
- Earliest claimed: 2019-09-13
- Assignees: Sling Media Pvt Ltd
- Applicants: Sling Media Pvt. Ltd.
- Inventors: Gajanan Hegde; Rakesh Eluvan
- Web page: https://patentgrep.com/patent/US20210081300A1

## 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, the method comprising:
executing a thread monitor module, wherein the thread monitor module monitors for any hung threads within a plurality of executing threads;
receiving, by the thread monitor module, a monitoring initialization message to initiate thread monitoring of a thread of the plurality of executing threads, wherein the monitoring initialization message comprises a thread identifier of the thread and an update frequency time period;
in response to the monitoring initialization message, commence tracking, by the thread monitor module, the thread by determining whether an update message for the thread has been received within the update frequency indicated in the monitoring initialization message;
receiving, by the thread monitor module from the thread, the update that indicates the 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 thread, thereby identifying the thread as the hung thread; and
in response to determining that at least the update frequency time period has elapsed since the update has been received from the thread, raising a defined signal on the hung 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 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:
registering, with an operating system that executed the thread, the signal handler mapped to the signal.

### Claim 4 (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 5 (depends on 4)

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

### Claim 6 (depends on 5)

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

### Claim 7 (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 to an application being executed.

### Claim 8 (depends on 7)

The method for debugging the hung thread of claim 7, further comprising:
receiving, by the thread monitor module, from the application, an indication of an action to perform to remediate the hung thread.

### Claim 9 (depends on 8)

The method for debugging the hung thread of claim 8, wherein the action is to restart the application.

### Claim 10 (depends on 8)

The method for debugging the hung thread of claim 8, wherein the action is to restart a device on which the application and the hung thread is executing.

### Claim 11 (depends on 1)

The method for debugging the hung thread of claim 1, wherein the thread monitor module is executed by a streaming media player device.

### Claim 12

A system for debugging a hung thread, the system comprising:
an application, comprising a plurality of threads, executed by a processing system of a device; and
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 configured to:
receive a monitoring initialization message from a thread of the plurality of threads to initiate thread monitoring of the thread, wherein the monitoring initialization message comprises a thread identifier of the thread and an update frequency time period;
in response to the monitoring initialization message, track the thread by determining whether an update for the thread has been received within the update frequency indicated in the monitoring initialization message;
receive, from the thread, the update that indicates the thread is not hung;
determine that at least the update frequency time period has elapsed since the update has been received from the thread, thereby identifying the thread as the hung thread; and
in response to determining that at least the update frequency time period has elapsed since the update has been received from the thread, raise a defined signal on the hung thread.

### Claim 13 (depends on 12)

The system for debugging the hung thread of claim 12, wherein the thread monitor module is further configured to cause a signal handler mapped to the 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 14 (depends on 13)

The system for debugging the hung thread of claim 13, wherein the thread monitor module is further configured to register the signal handler mapped to the signal with an operating system that executed the thread.

### Claim 15 (depends on 14)

The system for debugging the hung thread of claim 14, the system 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 16 (depends on 15)

The system for debugging the hung thread of claim 15, 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 17 (depends on 12)

The system for debugging the hung thread of claim 12, wherein the thread monitor module is further configured to:
output an indication of the hung thread to another thread of the application; and
receive an indication of an action to perform to remediate the hung thread.

### Claim 18 (depends on 12)

The system for debugging the hung thread of claim 12, wherein the system further comprises a streaming media player device that comprises the processing system.

### Claim 19

A non-transitory processor-readable medium comprising processor-readable instructions configured to cause one or more processors to:
receive a monitoring initialization message from a thread of the plurality of threads to initiate thread monitoring of the thread, wherein the monitoring initialization message comprises a thread identifier of the thread and an update frequency time period;
in response to the monitoring initialization message, track the thread by determining whether an update for the thread has been received within the update frequency indicated in the monitoring initialization message;
receive, from the thread, the update that indicates the thread is not hung;
determine that at least the update frequency time period has elapsed since the update has been received from the thread, thereby identifying the thread as a hung thread; and
in response to determining that at least the update frequency time period has elapsed since the update has been received from the thread, raise a defined signal on the hung thread.

### Claim 20 (depends on 19)

The non-transitory processor-readable medium of claim 19 wherein the processor-readable instructions are further configured to cause the one or more processors to cause a signal handler mapped to the 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.
