When it's not initialized of course!
I spent hours tracing an access violation which appeared in my code with no sane explanation.
Long story short it took a lot of output to stderr before I nailed it because there were no compiler warnings and where it was crashing was a library call.
I inadvertently discovered how to initialize a variable without initializing it. Cutting through the specifics I had the equivalent of a C char*. I had managed to forget to initialize it. "No compiler warning?" Well that's the fun part.
See this char* string existed as a temp variable to do some filename parsing on so I could autoload related resources. I was concatenating to this string. This uninitialized string. The concatenation was initializing it... but wasn't. What I think it was doing was trying to add my text on after the first nul it found in memory. Whoops!
I feel rather happy that it at least crashed the program. Otherwise that is a hell of a timebomb to have sitting around in code.
Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts
Thursday, September 20, 2012
Friday, August 24, 2012
Learning about Dropbox
Today I decided to have a look at Dropbox which is a sort of cloud-y file sharing thing. There are many other ones out there but Dropbox seems to be gaining traction and finding support embedded into applications.
The final push to get me signed up was when I was testing the Android onboard Java IDE AIDE. It boasts supporting Eclipse projects and Dropbox support. So I decided to try out its Eclipse support. Yes, it supports Eclipse projects. However getting the projects over to my tablet was a pain.
I haven't tried out AIDE's Dropbox support but I have tried Dropbox out in Debian Wheezy x64 and Android ICS. Seems to work just fine.
Dropbox only seems to support a root folder in which the things to share between devices get dumped. That didn't really suit me as I have a tree for projects plus I wanted to use Dropbox for other things too, so changing its root to my project tree would have been silly. I looked around online and didn't find anyone mentioning a good way of handling what I wanted to do so I tried the obvious. made a symlink from my Eclipse workspace and put it in the Dropbox root directory. It honoured the symlink. I'm happy.
Of course that means that on my tablet the project is in the Dropbox root folder but I'm fine with that. If anyone wanted to do it both ways they could probably just create a symlink in Android to point to where they want their folder, but that opens up another can of worms on another device, like if it is on an SD card or something changes funny things can happen.
My desktop is pretty static so I'm not so concerned, and AIDE can be pointed anywhere to open a project so it's neither here nor there. Anyway as mentioned earlier it has Dropbox support. Not really sure what that entails yet but I guess I'll find out.
The final push to get me signed up was when I was testing the Android onboard Java IDE AIDE. It boasts supporting Eclipse projects and Dropbox support. So I decided to try out its Eclipse support. Yes, it supports Eclipse projects. However getting the projects over to my tablet was a pain.
I haven't tried out AIDE's Dropbox support but I have tried Dropbox out in Debian Wheezy x64 and Android ICS. Seems to work just fine.
Dropbox only seems to support a root folder in which the things to share between devices get dumped. That didn't really suit me as I have a tree for projects plus I wanted to use Dropbox for other things too, so changing its root to my project tree would have been silly. I looked around online and didn't find anyone mentioning a good way of handling what I wanted to do so I tried the obvious. made a symlink from my Eclipse workspace and put it in the Dropbox root directory. It honoured the symlink. I'm happy.
Of course that means that on my tablet the project is in the Dropbox root folder but I'm fine with that. If anyone wanted to do it both ways they could probably just create a symlink in Android to point to where they want their folder, but that opens up another can of worms on another device, like if it is on an SD card or something changes funny things can happen.
My desktop is pretty static so I'm not so concerned, and AIDE can be pointed anywhere to open a project so it's neither here nor there. Anyway as mentioned earlier it has Dropbox support. Not really sure what that entails yet but I guess I'll find out.
Subscribe to:
Posts (Atom)