Mar 142015
 
 March 14, 2015  Posted by at 11:28 am Debugging, Debugging Windows, Dev Environment  Add comments

Last week was interesting. I spent 5 hours debugging my laptop after having several problems with it. Upside is that I have a few things to share with you 🙂 Let’s start with the first problem.

EDIT: VIDEO ADDED HERE

My laptop is new, it’s a work laptop and I hadn’t installed much more than my usual dev things. So when Visual Studio started acting up big time I was surprised. It wouldn’t let me make any design time changes, or save anything. Needless to say that’s a big problem as a developer since it’s my main tool. I kept getting a ‘The File Exists’ message box, before VS would stop responding and crash after recommending a log file.

The file exists Visual Studio

It wasn’t the only thing causing problems. I was unable to install drivers or updates, for example when I tried to update my graphics card driver. Using the Intel utility or doing a manual install gave same results. No results. I’ll explain next week about the drivers for my graphic cards and the problems I had there and why I had to install new drivers (actually do a rollback).

Drivers wont install and Intel Driver Utility crashes

The log file gave me more information, which I was happy about as the eventlog on my computer had no new errors despite the crashes. Path.GetTempFileName threw IOException.

IOException

When a process creates temp files there is a max, 65535 is the magic number. I did a quick PowerShell query, and yup indeed my temp folder was packed.

Maximum temp files

Empty temp files

I deleted the files and restarted my computer to be on the safe side. 10 minutes after restart I had problems again. What was up? In the temp folder there was mostly empty temp files, which made me suspicions. Friends on Twitter and Skype recommended Procmon (process monitor, system internal tools).

To find out which process is creating files run procmon (which is of course free), on the right hand menu select files only, then under filter add a filter for the path you want to monitor. Under Edit select clear display to empty previous happenings and make sure the magnifying glass icon is on. I saw one process in particular that was creating files, and the naming convention was similar to the ones I had seen. I added another filter for that process name and soon I saw that within 10 minutes it had filled up my temp folder and things stopped working.

Finding which process creates files

Funny thing, when I looked at the process a friends name popped up. Paul Betts at GitHub.

Friends

It was the update process for the Atom editor that was doing something wacky and causing all these problems. We started talking on Twitter (Paul and I) and turns out this was an issue he had recently solved but hadn’t made it in the latest release. He made a pull request a few minutes later. Until I can do a fresh install of Atom I’m just killing the process as soon as it starts with PowerShell and now Visual Studio, Intel Utility and updates etc. are working fine.

It took me a few hours to find the problem, but I learned to use procmon (my first time), and the second day I taught the client I’m doing some work for how to use it as we had to debug some install package problem on an off-site computer.
All in all, worth it. Big thanks to Paul for being so awesome, and everybody else that recommended various tools and solutions. Love you all!

  2 Responses to “The File Exists- IOException, monitoring file creation and Atom”

  1. WOW. I just spent half the day yesterday reinstalling VS2013 due to the exact same issue. I wish I had seen this post prior to that. Thanks!

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

What is 6 + 9 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)