Filed under misc

Random Hacker Tool #753

For all those of you swimming in bug mail, I give you the super spiffy "Delete Resolved Bugs" plugin for Evolution. Woo.

I can't say its saved my life or anything, but its made a difference ...

Tagged

Design By Scribble

Yesterday, I finally got around to hacking up a dialog in Sabayon where you can assign profiles to users. Code-wise, I knew it was pretty trivial, but for once I decided to spend some time thinking about the UI design rather than hoping a real designer would come along and rescue me later.

So, I scribbled down a rough design, humed and hawed for a while and got hacking. I'm not totally depressed with the end result, so that's something ...

Tagged

Stack Guard Page

The most interesting little tidbit I learnt from the memory usage
debugging yesterday was
about the "stack guard page". Look at this bit in the strace:

mmap2(NULL, 10489856, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7219000
mprotect(0xb7219000, 4096, PROT_NONE)   = 0
clone(child_stack=0xb7c194c4, flags=CLONE_VM|...) = 2282

What's going on here is that libc is mapping an area for the thread's
stack, just before spawning thread. The interesting bit is that, using
mprotect(), it also changes the permissions on the first page
(the page at the top of the stack) such that any instruction which
attempts to write to the page will cause a segmentation fault.

That's your stack guard page; it means that your infinitely recursing
function won't go off an scribble over its neighbouring thread's stack,
it'll just segfault like a good little thread.

(In true pthreads tradition, you can even configure the size of
this guard area - see the pthread_attr_setguardsize() manpage)

Tagged ,

Memory Usage Debugging

There's been a lot of talk about reducing memory usage in GNOME, so
some people may be interested in the little
adventure
I had this morning tracking down a mysterious 10M that
appeared in gnome-panel's memory map in FC4.

Update: I better clarify that to avoid misunderstandings ... this is
10M of unused virtual memory, not physical memory. The kernel would
only have ever allocated a handful of physical pages in this space.
This does not mean that GNOME now uses 10M less of your RAM.

Tagged

Architecture Astronauts

I'd read some of Joel's articles
before, not never really got around to reading a lot of them. Maybe its
because I hate reading long articles on a computer; maybe its because I
only became aware of his stuff well after he was at his most prolific.

Anyway, I'm thoroughly enjoying reading the
book
at the moment. Catherine gave me her typical "you're such a freak" look
last night as I chuckled to myself over this description of Architecture
Astronauts
:

When you go too far up, abstraction-wise, you run out of oxygen. Sometimes smart thinkers just don't know when to stop, and they create these absurd, all-encompassing, high-level pictures of the universe that are all good and fine, but don't actually mean anything at all.

Tagged