SkyLined / BugId

Detect, analyze and uniquely identify crashes in Windows applications
https://bugid.skylined.nl
Other
499 stars 90 forks source link

BugId can no longer start a process from a binary path containing space. #48

Closed kkuehl closed 6 years ago

kkuehl commented 6 years ago

When attempting to add support to pass --sDefaultBrowserTestURL from the command line with the following small patch:

C:\Users\kkuehl\Downloads\BugId>git diff
diff --git a/BugId.py b/BugId.py
index 7ebe72a..c94ddb9 100644
--- a/BugId.py
+++ b/BugId.py
@@ -632,6 +632,8 @@ def fuMain(asArguments):
           oConsole.fPrint(ERROR, "- You must specify \"true\" or \"false\" for ", ERROR_INFO, "--", sSettingName);
       elif sSettingName in ["test-internal-error", "internal-error-test"]:
         raise Exception("Testing internal error");
+      elif sSettingName in ["sDefaultBrowserTestURL"]:
+        asApplicationOptionalArguments = [sValue]
       else:
         try:
           xValue = json.loads(sValue);

I received the following error: C:\Users\kkuehl\Downloads\BugId>python ./BugId.py "C:\Program Files\Internet Explorer\iexplore.exe" --nApplicationMaxRunTime=10 --sDefaultBrowserTestURL=http://www.google.com

Please report the above details at the below web-page so it can be addressed:

This diff also fails with the same backtrace:

C:\Users\kkuehl\Downloads\BugId>git diff
diff --git a/BugId.py b/BugId.py
index 7ebe72a..d48d3f1 100644
--- a/BugId.py
+++ b/BugId.py
@@ -516,7 +516,7 @@ def fNewProcessHandler(oBugId, uProcessId, sBinaryName, sCommandLine):
   if gasAttachToProcessesForExecutableNames:
     oBugId.fAttachToProcessesForExecutableNames(*gasAttachToProcessesForExecutableNames);

-def fuMain(asArguments):
+def fuMain(asArguments, url):
   global gbVerbose, gbQuiet, gasAttachToProcessesForExecutableNames;
   if len(asArguments) == 0:
     fPrintLogo();
@@ -528,7 +528,7 @@ def fuMain(asArguments):
   auApplicationProcessIds = [];
   sUWPApplicationPackageName = None;
   sUWPApplicationId = None;
-  asApplicationOptionalArguments = None;
+  asApplicationOptionalArguments = url;
   sApplicationISA = None;
   bRepeat = False;
   bCheckForUpdates = False;
@@ -896,7 +896,8 @@ def fuMain(asArguments):

 if __name__ == "__main__":
   try:
-    uExitCode = fuMain(sys.argv[1:]);
+    # My personal project passes a url as a single item list here.
+    uExitCode = fuMain(sys.argv[1:], ['http://www.google.com']);

     if not gbQuiet and dxConfig["bShowLicenseAndDonationInfo"]:
       oConsole.fPrint();

.... asApplicationOptionalArguments = url

In the previous release of BugId/cBugId this worked, now it seems broken. Let me know if there is any additional information I can provide.

SkyLined commented 6 years ago

First, my apologies for the documentation in README.TXT being out of date; it is quite simple to run MSIE in BugId and have it open a specific URL:

python ./BugId.py msie --nApplicationMaxRunTime=10 -- http://www.google.com

I do not believe you need any of these patches. Please let me know if the above helps, or if you are trying to solve a specific issue that BugId currently cannot handle.

SkyLined commented 6 years ago

In general the format is:

python ./BugId.py <application keyword> <bugid arguments> -- <application arguments>

You can get a list of all known application keywords by running python ./Bugid.py (without arguments). You can also run any application by providing the path to the executable instead of an application keyword.

python ./BugId.py path\to\executable.exe <bugid arguments> -- <application arguments>
soiax commented 6 years ago

This crash happens for me too... it happens with acrobatdc, foxit.. (all programs with space in path)... isn't it something to do with space character in the path?

SkyLined commented 6 years ago

Yes, I found that problem too. Unfortunately, cdb.exe does not allow me to start a process using the .create command with a space in the path. I am currently working on a solution for that.

SkyLined commented 6 years ago

This should now be fixed.