-
Notifications
You must be signed in to change notification settings - Fork 668
sandbox should not crash silently #10014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sandbox should not crash silently #10014
Conversation
filter out ASM locations which dont include tsplines A
| } | ||
| catch | ||
| { | ||
| Console.WriteLine("Failed to load ASM binaries"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't the exception be silently swallowed out here? I don't see a throw?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, okay, after discussing a bit I see what you're saying - I think instead of Dynamo starting with no geometry - it is likely more useful to throw and message to the user where the geometry library failed to load from - this will also help us later get to the bottom of crash reports without needing to recreate the users local adsk install setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I'm okay with launching Dynamo without the geometry library but in addition to doing that I think it would be useful to display a message to users saying that the geometry library failed to load due to these reasons but if they wish they can still continue to use Dynamo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think at this point doing either or is the least risky thing, we don't have access to the dynamo logger here - and if we have to choose right now then I think showing the offending path to the user is actually more useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I meant to ask if it's possible to show the message box, the user clicks "ok", and is able to continue to use Dynamo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so - not without a larger refactoring - but I can look at that if you think it's worth it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm - for some context, we should not introduce a dependency on system.windows into the preloader - which needs to be cross platform - but the other message box raised in dynamoSandbox only is shown when it is too late to recover.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aparajit-pratap PTAL - figured out a way to do this while avoiding big set of changes or new public apis. We may want to do that as part of the followup we discussed.
throw exception with more info when asm fails to load fix bug in message from old method add new line to message dialog
| { | ||
| //show a message dialog box with the exception so the user | ||
| //can effectively report the issue. | ||
| var shortStackTrace = String.Join(Environment.NewLine,e.StackTrace.Split(Environment.NewLine.ToCharArray()).Take(10)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is pointing to the wiki, we will need to update there how to file issue related to start up failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, I will do that there.
| } | ||
| catch | ||
| { | ||
| throw new FileNotFoundException($"Could not load geometry library binaries from : {asmLocation}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the only kind of cause exception? @mjkkirschner @aparajit-pratap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should just be Exception - I will change it.
|
@mjkkirschner I'm a little confused. With your first commit (without rethrowing from the try-catch around ASM preloading), how were you able to display the message box with the stacktrace around ASM preload? Wouldn't it have simply swallowed that exception and launched Dynamo? |
|
|
||
| //filter install locations missing tsplinesA | ||
| installations = installations.Cast<KeyValuePair<string, Tuple<int,int,int,int>>>(). | ||
| Where(x => Directory.EnumerateFiles(x.Key, "tsplines*A.dll").Any()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to fold this check into getASMInstallsFunc? Also my previous question was why don't we do this check for "ASM*A.dll" as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I can try to fold it in there -
- we're already checking for that in the findProductInstallations function when we pass
"ASMAHL*.dll"isn't this - essentially doing the same check twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There could be an ASMAHL*A.dll and an ASMAHL*I.dll?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kind of, the offending folder has the ASMA.dlls and tsplinesI.dll
|
So the message box showing ASM related exception was just a contrived example? |
yes - I threw away all the libG folders 😉 |
…to only search for asm version we use
use $string interpolation for some old messages log to console for CLI clients
|
|
||
| //filter install locations missing tbb and tbbmalloc.dll | ||
| return installs.Cast<KeyValuePair<string, Tuple<int, int, int, int>>>(). | ||
| Where(x => Directory.EnumerateFiles(x.Key, "tbb*.dll").Count() >1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can make this check more strict by specifically checking for both tbb.dll and tbbmalloc.dll just so we don't have any other surprises like tbbX.dll being present but not being the same as one or the other above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, will do.
|
Thanks, LGTM! |
|
@smangarole brining this in, will cherry pick next. |
Purpose
Dynamo Sandbox should not crash silently.
system.windows(not forms) to avoid adding any other dependencies that might fail to load.filter out ASM locations that don't include tsplinesA - as these installs of ASM will not work with Dynamo. Discovered this as a cause of a silent crash with help from users on the forum and internal users.UPDATE:
TODO:
Declarations
Check these if you believe they are true
*.resxfilesReviewers
@aparajit-pratap
@ColinDayOrg
FYIs
@TheBIMsider