| Previous | Next |
| ERROR_INCOMPATIBLE_SERVICE_PRIVILEGE | ERROR_INVALID_LABEL |
ERROR_APP_HANG
A participating thread appears unresponsive.
ERROR_APP_HANG is Win32 error 1298 (0x512). It indicates that a thread involved in the operation appears to be hung. Unlike a crash, the process may still exist and consume resources while failing to dispatch messages, complete a wait, or advance the requested work.
Frequent hang categories
- a deadlock between locks acquired in inconsistent order
- a UI thread performing blocking network or disk I/O
- an infinite loop or retry loop without cancellation or backoff
- a synchronous cross-process call whose server is no longer responsive
- a worker waits for an event that its own blocked thread must signal
Evidence to collect while the process is hung
Capture multiple full dumps several seconds apart, thread stacks, wait-chain information, CPU usage, handle counts, lock diagnostics, and the operation correlation ID. Record the last successful progress marker and external dependencies. A single dump can show where threads wait; repeated dumps reveal whether any thread is still moving.
Diagnostic sequence
Classify the hang as CPU-bound, blocked wait, deadlock, message-pump starvation, or remote dependency. Inspect the UI thread first for desktop applications, then follow synchronization objects to their owners. Compare lock acquisition order and check whether callbacks are invoked while a lock is held.
For I/O waits, verify timeout and cancellation behavior and identify the remote endpoint or device. For high CPU, inspect repeating stacks and loop termination conditions. Windows Error Reporting can collect non-response diagnostics, while Wait Chain Traversal can expose chains among threads and synchronization objects.
Recovery
Offer cancellation or controlled termination after preserving recoverable user state. A watchdog restart may restore service temporarily, but it should include a dump and a rate limit so a persistent hang does not create a restart storm. Fix the blocking design by moving long work off responsive threads, adding bounded waits, or eliminating the lock cycle.
Developer recommendations
Emit progress telemetry for long operations, include operation IDs in cross-thread messages, and define timeout ownership at one layer. Avoid arbitrary short timeouts that convert slow work into false failures. Tests should inject stalled dependencies and verify that cancellation unwinds without leaving locks held.
Difference from a timeout
ERROR_TIMEOUT says a defined waiting period expired. Error 1298 says Windows or a component judged a participating thread unresponsive; the condition may be detected without a caller-visible timeout and can persist indefinitely.
References
- Microsoft: System Error Codes (1000–1299)
- Microsoft: Windows Error Reporting
- Microsoft: Wait Chain Traversal
- Microsoft: WerReportHang
Looking for a different code? Search another status or error code.