Behdad Esfahbod's daily notes on GNOME, Pango, Fedora, Persian Computing, Bob Dylan, and Dan Bern!

My Photo
Name:
Location: Toronto, Ontario, Canada

Ask Google.

Contact info
Google
Hacker Emblem Become a Friend of GNOME I Power Blogger
follow me on Twitter
Archives
July 2003
August 2003
October 2003
November 2003
December 2003
March 2004
April 2004
May 2004
July 2004
August 2004
September 2004
November 2004
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
December 2007
January 2008
February 2008
March 2008
April 2008
May 2008
June 2008
July 2008
August 2008
October 2008
November 2008
December 2008
January 2009
March 2009
April 2009
May 2009
June 2009
July 2009
August 2009
November 2009
December 2009
March 2010
April 2010
May 2010
June 2010
July 2010
October 2010
November 2010
April 2011
May 2011
August 2011
September 2011
October 2011
November 2011
November 2012
June 2013
January 2014
May 2015
Current Posts
McEs, A Hacker Life
Sunday, April 23, 2006
 GUADEC Updates

First off, today (Sunday) is the last day to register to have the conference committee book accommodation in the GNOME Village for you. Will over 30 bungalows booked already, it will be a lot of fun in the GNOME village. So "why are you waiting".

Also, Ludovic of the printed program subcommittee asks all speakers to fill their profiles with at least their contact info so they can be reached for bio and photo to appear in the program.

Friday, April 21, 2006
 Improving our memory debugging infrastructure

Federico writes about two small fixes we need to improve the memory debugging output of valgrind.

I've been working on a different approach: Instead of asking glib to be gc-friendly and to use malloc instead of g_slice implementation, I wrote patches for glib to hint valgrind directly. What it means is that glib will continue to use g_slice's complex implementation, and no gc-friendly cleanups, but it will give valgrind hints when a slice of memory is "freed" either using g_slice_free or for example g_array_resize...

With this patch you neither need to set G_DEBUG=gc-friendly, nor G_SLICE=malloc. glib simply picks it up when it's running under valgrind (or on top of ;). The patch also implements a global flag called g_mem_in_checker, that will be set to TRUE when running under valgrind (or other memory checkers in the future). ORBit then can check both this flag and g_mem_gc_friendly to initialize its buffers before writing them out.

Thursday, April 20, 2006
 Google Summer of Code '06

By now everybody should know that Google Summer of Code is back this summer. Proposals are accepted May 1st to May 8th, and the coding period is three months instead of two last year.

So I'm administering the GNOME side of it with Vincent, and mentoring for GNU too (guidelines). Don't forget to submit your GNOME ideas here.

Today I figured I may still be eligible to take part as a student, so after asking with Raphaƫl and checking the mailing list, seems like one can mentor for one organization and code for another. So I hope Fedora do jump in so I can submit to them again. Too bad I crossed GNOME and GNU out with my own hands :-).

There's been a long thread on an internal GNU list about who should get the $500: FSF or the mentors. Won't (and can't and shouldn't) get into the details...

Their eligibility rules still say no citizens of Iran. They agreed last year that a non-resident citizen is Ok, we'll see what happens this year.

Thursday, April 13, 2006
 Bug Stats, Part 20

Following up on my bug-fixing attitude post, I spent last time helping myself to 20 points. All libzvt bugs were cleared (some retargeted to vte, others closed), several vte bugs dupped, fixed, or closed too.

When doing that, I came across a rather weird scenario, where on Feb 13, when looking at some bug, I read the gnome-pty-helper source code and spotted a somewhat harmless race condition, and fixed it (patch), while the bug was already fixed and didn't need that change really. Now last night I found this other bug where somebody reported a deadlock in gnome-pty-helper and submitted a patch, all on the same Feb 13, a few hours before I commit that change, and the gnome-pty-helper code has not been touched for five months then. Compare his patch. They almost map using s/terminate/done/. Couldn't help but feel like deja-vu :-).

According to the script, I need to open 77 and close 121 bugs to go to the next level. That should keep me busy for a couple of months...

Wednesday, April 12, 2006
 Desktop Developers' Conference '06

To follow ajh's request, here we go:

Desktop Developers' Conference is back again (17th and 18th July). Come meet all the great people writing you great desktops literally on top of the kernel hackers downstairs having a private meeting (you knew they are weirdos, no?) followed by the greatest Linux conference in the world, making 17th..23th of July the best week of 2006 to be in Ottawa.

Early-bird registration closes mid May, while the call-for-papers close May 1st. So hurry up! Also there's some limited travel sponsorship for speakers this year, as well as registration fee refund that has always been.

For bonus, get there a few days earlier and enjoy the Ottawa Bluefest (7th..16th) too.

Monday, April 10, 2006
 My Bug Fixing Attitude

As everybody else on Planet GNOME, I'm going to reveal my secret bug hunting attitude:

What is your bug hunting attitude?

Update: The script is here Update 2: The output of the script should be AND'ed together. I needed to close 27 bugs, open 20, and add 101 other comments for my points to round to 20.

Saturday, April 08, 2006
 YouOS running inside YouOS!


YouOS running inside YouOS!
Uploaded by Behdad Esfahbod.
You may have seen YouOS, the AJAX operating system!

This shot shows Google open inside a browser inside a YouOS running inside another YouOS running inside FireFox running on my Fedora Core Linux system!

Wednesday, April 05, 2006
 Juliette Binoche in Tehran

Via the Shargh-reading friends: seems like Juliette Binoche entered Tehran last night (Persian), to play in Abbas Kiarostami's latest film project. Binoche is widely known in Iran for her role in Kieslowski's Three Colours: Blue.

Saturday, April 01, 2006
 Various Misc Points Redux

Frysk and SystemTap: These two I've wanted to blog about for quite a while. SystemTap is a DTrace clone (Ok, not clone), while Frysk is an "intelligent, distributed, always-on system monitoring and debugging tool". Just check out their screenshots, I can't explain. Both projects are highly under development at Red Hat, and I can't wait until getting them running after upgrading to FC5. Frysk specifically looks so cool that we may not envy Apple's Shark in the future anymore :).

HarfBuzz: Spent the entire night last night (Thursday night I mean) refactoring and rebranding the OpenType Layout code that was in pango/opentype and imported it into a new repository on fd.o. This 17kloc code is the single most complex C code I've seen. The complexity is to be blamed on the OpenType standard, not the implementation though.

Spam: Rich, The biggest advantage of having your own domain and using different email addresses per site is that you identify spam from nonspam from the To: address easily. For example if I see an email claiming to be from Amazon.ca, which is sent to any address of mine other than amazon.ca at behdad.org, I know where to send it. That also helps figuring out who's leaking my addresses to spammers. Today's first of month, time to get password reminders from mailman's around the world, eh? I received two password reminders from an Iranian who had subscribed two addresses of mine that I use in JavaScript files that I publish. Bastard! I checked out his homepage too, and he has even translated ESR's How To Become A Hacker, yet he gathers email addresses on the net to spam. I wonder if he knows what ESR means by "hacker"...

GUADEC: Registration is open now, hurry up. And reserve accomodation in the GNOME village! I ended up submitting a proposal for a Pango/fontconfig talk in the last minute. Also submitted a performance hackfest and a performance BOF too, which compliment federico's performance talk. I'm also cohosting two other sessions, one on SIL technologies, another Danilo's i18n/L10n hackfest. Extreme fun guaranteed. I better make it this year...

CN Tower: There are two days every year that you can climb up the CN Tower. It's "free", but you have to raise 50CAD! Typical NorthAmerican "free" offers... Anyway, after letting a few of them pass by, I decided to climb this time, so I'm going to raise funds out of my own pocket if need be, but you can help by sponsoring me here. :-D

Tanenbaum: On Wednesday Andrew Tanenbaum was talking in the CS department about MINIX3. Nothing new, same old "my tiny kernel is better than the 50mloc Windows and 2.5mloc Linux" thing. He has developed quite a sense of humour though. To point out just three of his jokes:

 Throwing Exceptions with POSIX/ISO C

After showing pass-by-reference in C, I've been thinking about how to do a clean implementation of exceptions in C.
So here is my POSIX/ISO C implementation of C++/Java/Python-style exceptions, written with glib flavour for taste. I couldn't get rid of the final g_try_end, and don't think can be got rid of. Leave comment if you can!

I plan to integrate this with glib after adding the thread-private stuff (-:.

/* header */

#include <glib.h>
#include <setjmp.h>

void g_exception_set_error (GError *err);
GError *g_exception_get_error (void);

void g_exception_set_jmp_buf (jmp_buf *jmpbuf);
jmp_buf *g_exception_get_jmp_buf (void);

G_GNUC_NORETURN void g_exception_throw (GError *err, int depth);

#define g_try_begin \
{ \
int __g_except_depth; \
jmp_buf __g_except_jmp_buf; \
GError *__g_except_error = NULL; \
jmp_buf *__g_except_jmp_buf_save = g_exception_get_jmp_buf (); \
g_exception_set_jmp_buf (&__g_except_jmp_buf); \
if (!(__g_except_depth = setjmp(__g_except_jmp_buf)) || \
(g_exception_set_jmp_buf (__g_except_jmp_buf_save), \
__g_except_error = g_exception_get_error (), \
FALSE)) \
{


#define g_catch(Domain, Code, err) \
} \
else if ((!(Domain+0) || (Domain+0) == __g_except_error->domain) && \
(!( Code+0) || ( Code+0) == __g_except_error->code )) \
{ \
GError *err = __g_except_error;


#define g_try_end \
} \
else \
g_raise; \
g_exception_set_error (NULL); \
g_exception_set_jmp_buf (__g_except_jmp_buf_save); \
}


#define g_throw(err) \
G_STMT_START { \
GError *__g_except_throw_error = (err); \
if (__g_except_throw_error) \
g_exception_throw (__g_except_throw_error, 1); \
} G_STMT_END


#define g_raise \
G_STMT_START { \
if (__g_except_error) \
g_exception_throw (__g_except_error, __g_except_depth + 1); \
} G_STMT_END




/* implementation */

static GError *_g_except_error_current;
static jmp_buf *_g_except_jmp_buf_current;

void
g_exception_set_error (GError *err)
{
if (_g_except_error_current)
g_free (_g_except_error_current);
_g_except_error_current = err;
}

GError *
g_exception_get_error (void)
{
return _g_except_error_current;
}

void
g_exception_set_jmp_buf (jmp_buf *jmpbuf)
{
_g_except_jmp_buf_current = jmpbuf;
}

jmp_buf *
g_exception_get_jmp_buf (void)
{
return _g_except_jmp_buf_current;
}

void
g_exception_throw (GError *err, int depth)
{
jmp_buf *target = g_exception_get_jmp_buf ();

if (!target)
g_error ("Uncaught exception (depth %d): %s", depth, err ? err->message : "(null)");

g_exception_set_error (err);
longjmp (*target, depth);
}



/* test case */

static void
my_read_file (const char *filename)
{
GError *err = NULL;
GIOChannel *stream;

stream = g_io_channel_new_file (filename, "r", &err);
g_throw (err);

/* ... */

g_io_channel_shutdown (stream, TRUE, &err);
g_throw (err);
}

int
main (int argc, char **argv)
{
g_try_begin {

if (argc > 1)
my_read_file (argv[1]);

} g_catch (G_FILE_ERROR, G_FILE_ERROR_ACCES, e) {

g_warning ("Oh oh: %s; ignoring", e->message);

} g_catch (,, e) {

g_message ("The message is: %s; chaining up", e->message);
g_raise;

} g_try_end

return 0;
}

(the feed is probably broken again, check my blog page for syntax-highlighted source.)