Bug 77524 - "Terminating runaway script" even when script finishes immediately
Summary: "Terminating runaway script" even when script finishes immediately
Status: RESOLVED FIXED
Alias: None
Product: PolicyKit
Classification: Unclassified
Component: daemon (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: David Zeuthen (not reading bugmail)
QA Contact: David Zeuthen (not reading bugmail)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-16 11:58 UTC by Amit Schreiber
Modified: 2015-07-02 19:40 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Amit Schreiber 2014-04-16 11:58:19 UTC
I'm using the following script to allow any wheel group user to manage libvirt:
polkit.addRule( function( action, subject ) {
  polkit.log( "action=" + action ) ;
  polkit.log( "subject=" + subject ) ;
  if ( ( action.id == "org.libvirt.unix.manage" || action.id == "org.libvirt.unix.monitor" ) && subject.active && subject.isInGroup( "wheel" ) ) {
    polkit.log( "Returning polkit.Result.YES" ) ;
    return polkit.Result.YES;
  }
} ) ;

The script is located at /etc/polkit-1/rules.d/80-libvirt-manage.rules on Fedora 19. The installed polkit version is polkit-0.112-1.fc19.x86_64

Most of the time the script works well, but sometimes (apparently when many libvirt operations are going on) it fails with "Terminating runaway script". I've managed to recreate this by simply executing virsh operations in a tight loop, for example:
while :; do virsh -c qemu:///system list; done

It doesn't happen often, though.
Comment 1 Amit Schreiber 2014-04-17 08:10:00 UTC
The documentation for JS_SetOperationCallback says:
"Set a callback function that is automatically called periodically while JavaScript code runs"

So from what I understand it may be called by mozjs without being triggered by rkt_on_timeout() and terminate the script at any given time, because js_operation_callback() assumes that if it was called it was due to a timeout.
Comment 2 Miloslav Trmac 2015-07-02 19:40:07 UTC
Fixed in polkit-0.113. Thanks for your report.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.