Ticket #3 (closed defect: fixed)

Opened 4 months ago

Last modified 4 months ago

instrumentation results not printed when application calls System.exit()

Reported by: ManuSridharan Assigned to: jwloka
Priority: major Milestone: M2
Component: dila.runner Version: 0.0.2
Keywords: Cc:

Description

If Dila is run on an application that calls System.exit(), the VM immediately exits and none of Dila's post-processing (e.g., printing of results) gets run. The dacapo benchmarks are an example: System.exit() is called by the main benchmark Harness class. I've attached a patch for AbstractWrapper? that fixes the problem using a SecurityManager?.

Attachments

wrapper.patch (1.1 kB) - added by jwloka on 04/17/08 14:56:54.

Change History

04/17/08 13:13:40 changed by anonymous

It's not letting me attach a patch, so I'll paste it here:

--- orig/dila.wrapper/src/dila/wrapper/AbstractWrapper.java 2008-04-16 11:23:48.000000000 -0600 +++ dila.wrapper/src/dila/wrapper/AbstractWrapper.java 2008-04-17 11:00:55.000000000 -0600 @@ -26,6 +26,7 @@

import java.lang.reflect.InvocationTargetException?; import java.lang.reflect.Method; import java.security.AccessController?;

+import java.security.Permission;

import java.security.PrivilegedActionException?; import java.security.PrivilegedExceptionAction?; import java.util.HashSet?;

@@ -132,6 +133,21 @@

*/

@SuppressWarnings?("unchecked") public void executeProgram(String[] args) {

+ // prevent System.exit by application + System.setSecurityManager(new SecurityManager?() { + private final SecurityManager? parent = System.getSecurityManager(); + + public void checkPermission(Permission perm) { + if (parent != null) { + parent.checkPermission(perm); + } + } + + public void checkExit(int status) { + throw new SecurityException?(); + } + }); +

RunConfig?.newRunDate();

try {

Class<?> mainClass = Class.forName(RunConfig?.getMainClass(), true, classLoader);

04/17/08 14:56:54 changed by jwloka

  • attachment wrapper.patch added.

04/18/08 19:36:14 changed by anonymous

  • owner changed from jwloka to anonymous.
  • status changed from new to assigned.

04/18/08 19:36:48 changed by jwloka

  • owner changed from anonymous to jwloka.
  • status changed from assigned to new.

04/18/08 19:55:59 changed by anonymous

  • status changed from new to closed.
  • resolution set to fixed.