We can perfectly reproduce the error, so long as the debugger is NOT attached.
Any suggestions on trouble shooting?
ok...
i'll have to follow up later and build a sample solution to repro this
In a view model, we were exectuting navigation, and then on the next line calling a method that called other methods that included callbacks.
We swithed it so the page we navigated to then called that method.
Before the fix...
The app never crashed when debugging, never throws an error.
With no debugger attached, it failed inconsistentely with the emulator. Interestingly enough, it did NOT ever fail with a Samsung Focus, but did fail 100% of the time on a Samsung Omnia.
By fail I mean it crashes, with no exception available to do anything with...
I just ran into a problem with a singleton. I have a property named Instance and a private variable instance.
lock(sync) { if (Instance == null) {instance = new MySingleton(); } }
Notice I'm checking for the property name Instance for null, not the private variable instance. This crashed mysteriously, in fact took Visual Studio Express down. I just started cutting out code until I found the mistake.
Related
I'm using ImgCache.js within my ionic2 project, recently I upgraded ionic from rc.3 to rc.5 and ImgCache stopped working.
While debugging, I could see that the success and error callbacks in ImgCaches.Init() were never called. So I debugged the ImgCache.js' Init method and was able to find that the method:
navigator.webkitPersistentStorage.requestQuota
Is only calling any callback when the Quota data is bigger than the previous amount (or after I cleaned the cache/cookies), which will ask the user permission to store files in his device.
I tested in canary (version 58.0.2989.0 canary (64-bit)) but this didn't work either.
P.s.: The problematic code is here: https://github.com/chrisben/imgcache.js/blob/master/js/imgcache.js#L622
P.s.2: It's only happening when I set a breakpoint before ImgCache.init()
After a couple hours of debugging, I discovered the problem was actually the debugging. The problem only occured when I set a debugger before ImgCache.init()
Has anyone else ever seen this happen? I've had Visual Studio crash over and over again when typing in an object initializer: https://msdn.microsoft.com/en-us/library/bb384062.aspx
I suspect it's some kind of Intellisense bug, since it seems to occur only when the space or period key is pressed. I'm really curious what's triggering the sudden and reproducible crash and if there's any patches or workaround to prevent it from occurring.
The image shows where the cursor is when typing within the first set of brackets. This code appears in a method, which implements an interface member for the class.
This appears to have been caused by the "HideShow Comments" extension. I'm still not sure why it occurs, but disabling the plugin stops the crash from occurring and re-enabling the extension causes the crash to occur again. This must be a problem with Visual Studio itself, since it's the only common denominator in all these extension-related crashes.
I attached a debugger and caught the following error:
An unhandled exception of type 'System.NullReferenceException'
occurred in HideShow.Implementation. Additional information: Object
reference not set to an instance of an object.
I am testing a user-defined override to BeforeSaveEntities on the Breeze Server Side. I have a breakpoint where I am observing the saveMap, and I call a method on the sub-class of the EFContextProvider to loop through each entity being saved.
Then when I click the Debug Stop button in Visual Studio, the Save still occurs. If I change the return from BeforeSaveEntities return from passing back the original saveMap to null, it does not.
This was a bit unsettling when I was going to "test" deleting...as I'm trying to write code that will do a "soft" delete.
Anyway, my question is, is there a workaround so I don't have to setup a "return null" during testing?
But more importantly, if I throw an EntityErrorsException it does stop the save as expected. :)
Thanks. Bob
This happens because you are just detaching the Visual Studio debugger from the running IIS/IIS Express instance. As soon as you detach the debugger, the request's execution continues on the webserver and thus, the rest of the code is executed.
A quick workaround would be to wrap your null return code in a compiler condition and check for the DEBUG symbol. Something along these lines:
#if DEBUG
return null;
#endif
Production code should be built using the RELEASE compiler symbol instead of the DEBUG symbol to enable deletion.
I've assembled my new PC yesterday, and I've decided to give Windows 8 a try. However, today, during the debugging of moderate Qt application, debugger yielded "Invalid Binding Handle" error message on a pretty simple line (it was line that is auto-generated by Qt's moc.exe:
// QWebView *view (...)
view->setUrl(QUrl(QString::fromUtf8("about:blank")));
// Failing in setUrl call, not in QUrl constructor, or in fromUtf8 function.
However, running this application without debugger works just fine, both in Release and Debug versions.
I've got some clues on the internet to enable Terminal Services, but it seems that there is no such service in Windows 8.
Does anybody have any clue what should I check?
Edit
Moving the widget into other application yielded no error, so apparently, widget (which is pretty small - just QWebView and QProgressBar) is fine. But, when I show this widget in my main function:
QApplication app(argc, argv);
MyWidget w;
w.show();
return app.exec();
it is still failing with the same error. Examining call stack (which is not very helpful when error appear) and stepping into function calls, I've tracked error down to retval = HeapFree(_crtheap, 0, pBlock); in function _free_base, in file free.c And it seems that function is called from dbgdel.cpp, function _free_dbg( pUserData, pHead->nBlockUse ); and it is called from unlock() function.
Attaching the debugger to already active process is still yielding the same error.
I am linking a lot of 3rd party libraries here, so I will try without them, as I'm run out of ideas...
Edit 2:
If I pass this exception to the program, it seems to be running fine.
Edit 3
Commenting setUrl line raises the same exception somewhere in QWebKit, where strdup function is called...
Well, this was easy, but it took me two months to solve (while ignoring the error in the meantime).
This was not an unhandled exception - this was handled exception, and stepping into assembly code and watching the stack frame told me that this exception was handled.
Then I remembered that I've set debugger to break when all C++ and Win32 exceptions are raised. Resetting the debugger settings removed the issue.
I'm trying to add support for tracking application usage to a WP7 app (e.g., how many times has the app been run, including wakeups from tombstoning). I thought I was doing this in a pretty straight-forward way, but I'm frequently getting IsolatedStorageExceptions, and I'm kind of at a loss for debugging it at the moment.
Paraphrasing from my App.xaml.cs
private void HandleAppCounter() {
int i = 0;
settings.TryGetValue<int>("usage", out i);
i++;
settings["usage"] = i;
settings.Save();
}
I call this function when the app is launching or activating. The thing is, it works just fine. But the thing is, if I make another call to isolated storage soon after then that is what blows up. And furthermore, it seems to only blow up if the next call happens pretty soon after.. although I'm having trouble understanding that as well.
The next action performed is usually a user clicking an item in a list. If it happens immediately when it's displayed, I get a crash from isolated storage. If the user waits a few seconds after the app is launched and then clicks it, there is no crash.
If the above code in HandleAppCounter() is commented out, then the user can click either immediately or later and it never crashes.
Can anyone give me some tips on how to debug this? I'm kind of running into a wall here.
I would suggest stepping away from your custom implementation for a sec and try the same behaviour with the default IsolatedStorageSettings class, if it is still a problem then you should report it to Microsoft Connect site as a bug, otherwise there is some kind of an error in your settings class.
If you're using IsolatedStorageSettings you might want to make sure, that whenever you're querying/adding a key, the key is there, if not you must create it.
If you're using IsolatedStorage filesystem then make sure you are always closing the streams when you're reading/writing. If you don't you will get absurd exceptions.