Archive for December, 2007
Dead Tired
On life right now
Oh boy, I’m dead tired.
Christmas vacations are closing in. Tomorrow my girlfriend, my daughter and I are going to see our parents and grand-parents which live a little east from where I live. It’s a three hour drive, a short trip, but we plan to stay 10 days. Parents will know that this require to pack-in a lot of stuff, mostly for the baby.
I find it ironic that a 12 pound baby requires to carry as much stuff as two grown adults. And that’s just “life support”. We don’t carry much extra things around.
Luckily my girlfriend is better than me at organizing, otherwise we would end up with pretty much everything missing.
It’s unlikely you will see technical post here until I get back.
Projects
I have not had time to think much about the idea I was to write about some posts ago. My goal is to keep this blog on a technical blog, so I will try to summarize that idea here instead of waiting to have time for a bigger post.
I have started playing around with the little known ptrace syscall on Linux. My idea is to code a programmable variant of strace.
strace is a tool that allows you to see what system calls a program do on the Linux kernel. System calls are the functions in the kernel that can be used by the user program to do things. You might already know that it’s not the GNU Libc that write on the disk. The kernel does. The libc, and other libraries, uses system calls to tell the kernel to write on the disk. That means if you know what system calls a program use, you get a pretty good idea what it is doing.
That’s strace, in short. I could write a whole article with example and such but I’m sure there are better writes that already did so go it Google.
Since I’ve started coding under Linux, I’ve always found strace to be one of the most useful development tool available. It’s actually useful beyond programming tasks. I have used it more than often to get more useful error message from malfunctioning programs.
What annoys me with strace though, is that it’s sometimes very painful to extricate information from the thousands of calls done by a program. There is a lot of noise in a strace output.
With a programmable strace, I would like to be able to intercept just the information what I want, and do the interpretation of the data programmatically.
The most striking example of what I think is to track file descriptor leak. There are few system calls out there that return file descriptors. File descriptors are a limited resources to the process, and if they run out, the process will probably cease working.
Determining that file descriptor leak happen is easy. All you have to do is count the number of files in /proc/pid/fd.
Finding what is leaked, what it was used for and in what circumstance the file descriptor is leaked might be more complex. That is usually something I manage to accomplish with strace.
It would be faster to write a small program in an high-level language that could trap the system calls that return file descriptors and log what happens.
That’s the idea that made me think about that project. That and the fact that it would be fun to code that.
What I need to investigate further is if I can do more than simply spy the program. If you can change return values of system calls, you can submit programs to a lot of strange error conditions. It would be easy to simulate a full hard-drive, for example, without needing to patch the GNU Libc. All that would be needed is a short program telling what to return when a child program calls the write system call.
That text is probably confusing as hell to users, and non-developers. Don’t worry. If I find the idea implementable and useful, and if the projects takes off, I will certainly blog about it again.
Awesome followup
I have posted a Debian bug about the problem I have had with VMWare and the Awesome window-manager.
Turns out that the shortcuts only works when the mouse is not over the VMWare virtual screen. That means it is less annoying than I first expect, but still annoying nonetheless.
JD was nice in installing VMWare to diagnose the problem. I know some developer who would not have bothered to install such a big piece of proprietary software to debug a problem which probably annoys just one person, me, in the whole world.
VMWare is a critically important tool for us at work. I’m not gonna get into details of why and how we use it. It will be better left as the subject of another post. I don’t feel I need to justify the bug I posted, but it is very important for me that I’m able to use this tool efficiently in my development environment.
Trying Awesome
awesomeness in a package
I had a overly involved articles to write about an idea for a project I have. Unfortunately, I have had no time to sit and write about it.
Instead I decided I would try Julien Danjou’s Awesome Window Manager.
First I must say that I felt weird installing awesome through apt-get (apt-get install awesome). One would expect that awesomeness would have been harder to install. It also feel strange to write about. Then I realized you could also install happy in Debian. There is no funny or sad yet though.
I have something for the potential effiency of tiling window manager. I somehow feel that if I can get used to one of them, I’ll be terribly efficient around my desktop. Whenever I try one of them, I usually come back to my sense. Getting used to that whole new key map usually take more patience than I have.
Objectively, awesome is a nice window manager. It’s sober and fast. It took a short while for me to be able to know enough keys to find my way around it.
Mod4
awesome uses the ‘Mod4′ modifier by default. Once I got awesome started, it struck me that I did not know what “Mod4″ was. Turns out that on my setup, ‘Mod4′ is bound to the Windows key. It is a nice thought from the other to get that key to some use.
Zsh job control
Zsh, my current shell, does not do job control the same way I remembered Bash did. If you fire a shell in X, start a graphical app, then logout from the shell, Zsh will tell all the application to shut themselves down. I tried Bash, and apparently it does not do that, or it is being smarter with it.
Floating windows
I knew it because I once used Ion, but I would like to point out that Awesome, just like Ion, can also deal with floating window just fine. Awesome is also pretty smart about small pop up window, and displays them as floating window instead of tiling them just like applications window. I vaguely remember not seeing that with other window manager although I could be wrong.
Thunderbird/IceDove
This ** program doesn’t like being tiled. It seems I have to run it in a full screen window.
System tray
Being a minimalist wm, Awesome doesn’t have anything that can hold system tray applications. This doesn’t mean much too me at work, but it’s a big drawback for my computer at home, on which I run several applications that feel at ease in a system tray. Pidgin is probably the best example of such application.
I know there are probably some ways to hack around it, just like there are some alternatives to Pidgin, but that means using up more of the little patience I have.
VMWare
Really annoying bug. VMware console shortcut keys don’t work when VMWare is run with Awesome. It certainly deserves a bug report as it is the reason I can’t be using Awesome. I see tiling wms as a way to free myself from the mouse by using mostly the keyboard. VMWare being one of my main work tools, I cannot afford to switch to a wm that would keep me from using it in a efficient way, even if the wm is generally efficient for everything else.
After I write this, I will logout from Awesome back in my KDE setup where VMWare shortcut keys work.
