Skip to content

Commit

Permalink
Merge pull request #5629 from emutavchi/RDKTV-31928
Browse files Browse the repository at this point in the history
[WebKitBrowserPlugin] improve handling of hangs in Thunder RPC dispatcher
  • Loading branch information
emutavchi authored Aug 21, 2024
2 parents 1817397 + ba3b413 commit a13bfcb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions WebKitBrowser/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ All notable changes to this RDK Service will be documented in this file.
* Changes in CHANGELOG should be updated when commits are added to the main or release branches. There should be one CHANGELOG entry per JIRA Ticket. This is not enforced on sprint branches since there could be multiple changes for the same JIRA ticket during development.

* For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README.
## [1.1.24] - 2024-08-21
### Fixed
- Improve handling of hangs in Thunder dispatcher thread

## [1.1.23] - 2024-07-29
### Fixed
- Avoid crash on exit due use of invalid IShell handle
Expand Down
2 changes: 1 addition & 1 deletion WebKitBrowser/WebKitBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#define API_VERSION_NUMBER_MAJOR 1
#define API_VERSION_NUMBER_MINOR 1
#define API_VERSION_NUMBER_PATCH 22
#define API_VERSION_NUMBER_PATCH 24

namespace WPEFramework {

Expand Down
15 changes: 14 additions & 1 deletion WebKitBrowser/WebKitImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,20 @@ static GSourceFuncs _handlerIntervention =
++_expiryCount;

if ( _expiryCount > (_watchDogTresholdInSeconds / _watchDogTimeoutInSeconds) ) {
_browser.DeactivateBrowser(PluginHost::IShell::WATCHDOG_EXPIRED);
pid_t pid = getpid();
SYSLOG(Logging::Error, (_T("Hang detected in browser thread in process %u. Sending SIGFPE."), pid));
if (syscall( __NR_tgkill, pid, pid, SIGFPE ) == -1) {
SYSLOG(Logging::Error, (_T("tgkill failed, signal=%d process=%u errno=%d (%s)"), SIGFPE, pid, errno, strerror(errno)));
}
else {
g_usleep( _watchDogTresholdInSeconds * G_USEC_PER_SEC );
}
SYSLOG(Logging::Error, (_T("Process %u is still running! sending SIGKILL\n"), pid));
if (syscall( __NR_tgkill, pid, pid, SIGKILL ) == -1) {
SYSLOG(Logging::Error, (_T("tgkill failed, signal=%d process=%u errno=%d (%s)"), SIGKILL, pid, errno, strerror(errno)));
}
ASSERT(!"This should not be reached");
return;
}

_worker.Reschedule(Core::Time::Now().Add(_watchDogTimeoutInSeconds * 1000));
Expand Down

0 comments on commit a13bfcb

Please sign in to comment.