Friday, March 27, 2009

does valgrind detect pigeons?

I believe that David Berman, my favorite poet, in his poem New York, New York perfectly captured the essence of the oft-futile art of code rewrites.

A second New York is being built
a little west of the old one.
Why another, no one asks,
just build it, and they do.

The city is still closed off
to all but the work crews
who claim it’s a perfect mirror image.

Truthfully, each man works on the replica
of the apartment building he lives in,
adding new touches,
like cologne dispensers, rock gardens,
and doorknobs marked for the grand hotels.

Improvements here and there, done secretly
and off the books. None of the supervisors
notice or mind. Everyone’s in a wonderful mood,
joking, taking walks through the still streets
that the single reporter allowed inside has described as

“unleavened with remainders of the old city’s complicated past,
but giving off some blue perfume from the early years on earth.”

The men grow to love the peaceful town.
It becomes more difficult to return home at night,

which sets the wives to worrying.
The yellow soups are cold, the sunsets quick.

The men take long breaks on the fire escapes,
waving across the quiet spaces to other workers
meditating on their perches.

Until one day…

The sky fills with charred clouds.
Toolbelts rattle in the rising wind.

Something is wrong.

A foreman stands in the avenue
pointing binoculars at a massive gray mark
moving towards us in the eastern sky.

Several voices, What, What is it?

Pigeons, he yells through the wind.

Sunday, August 24, 2008

status update

I've been working my day job, getting settled in. After a couple of months I've now started to pry the lid off the can of whoop-ass; that just means I'm feeling rather comfortable in the whole workplace situation. My desk is if not my sanctuary then at least my desk. Spent the summer coding Java (my official position is function tester) and generally mucking about the tool-chain at work. Lots of fun and late nights. Eclipse is to Java what intercourse is to life, seriously! Hot stuff.

So the open-source activities ground to a halt due to the above. I haven't left for good, though. Don't be silly. I recently built a new computer (how does a 25x improvement in debug Firefox build speed rub you?) and once I get the dev environment set up just right, I intend to attack the Prism bugs I left hanging. Then, well, I hope I'll be more involved with js-ctypes and those bits again. I kind of miss it.

So, that's it. For the 0 readers of this blog — enjoy!

Tuesday, April 15, 2008

my computer hates you

dudemeister$ history|awk '{a[$2]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|head
143 lame
65 yet
23 omg
12 most
4 meme
3 the
1 suck-it

Thursday, April 10, 2008

Never underestimate your own ability to do dumb things. I've been setting up unit testing for js-ctypes and they didn't work (called functions returned booleans instead of integers). When you reach the point where you're convinced your own code is up to snuff and there are essential parts of the XPTCall core that are buggy, just assume you're doing something wrong. Turns out I had declared library functions with (name, return type, call type, ...) when it clearly should be (name, call type, return type, ...). This from the get-go, even during my initial experimentation. It worked because the values I used meant default conversions and other parameters stayed within limits that made everything work but with unexpected results. Subtle, eh.

Also, I love the Linux integration but this sucks. I'm pretty sure it's GTK2 that draws some widgets on a solid background since the same Fx build on OpenSUSE 10.2 showed similar junk around the <select> whereas, as is evident, Ubuntu 7.10 draws it perfectly. An eye-sore is what it is.

Wednesday, April 02, 2008


The buffered output stream-related bug is solved! Turned out it was a bad patch in bug 363986 that caused it. Thanks Valgrind, if you weren't an inanimate blob of bits I would kiss you! (I may print out the code and roll around naked on the pages as a substitute.) And I have my first main tree patch; 4 lines, but it's still a Big Deal™ to me personally.

In other news, I managed to hose my OpenSUSE 10.2 install by upgrading GTK+ and some other bits and bobs, so I installed Ubuntu 7.10 yesterday. The debug builds still run which is totally sweetpickles. Feels faster, too. I hope build times decrease.

Sunday, March 16, 2008

dbus with all the fixin's

I was a bit bored, so I fixed up the marshalling code for mozjs_dbus and now it speaks Unicode. To be fair, my changes were only a couple dozen lines. Credit where credit's due, the XUL and JS stuff is all Eric Butler, and I think most of the C++ is too (though the marshalling code looks nicked from now-defunct DBuzilla). Since it's a JS-centered approach, I think one could rejig the whole C++ component to tap into JS directly (like js-ctypes does). That saves going through nsIVariant, and allows the back-end to chew on the JS objects directly. It would probably simplify the JS slightly as well (it is already a nice, modular design).

And I'm pretending the 3 hours spent looking for the reason why my Fx build didn't pick up the mozjs_dbus extension never happened. (The install.rdf ID field said mozjsdbus. One underscore. Three hours. In theaters now...)

Saturday, March 15, 2008

exacerbate and incapacitate (and, apparently, progress)

Ah, software. S for stupid, O for OMGWTF?!, F for [expletive deleted] etc.

Weird, weird bugs. Profoundly weird. So, converting from .ico to .png causes the same buffered stream bug(?) to throw a hissy fit and explode ze Prism into tiny shards of glass that hurt your soul. But, the other day when testing I chose a local .ico file, and for some reason it actually converted without crashing. To top things off, the /etc/mime.types entry for .ico was "image/x-ico" which isn't a standard MIME type. So, using a local .ico file caused the MIME service to report "image/x-ico" which in turn actually made Prism convert the .ico to a .png. Even though there is no decoder for "image/x-ico"!

Furthermore, adding a ~/mime.types file (overrides the global in /etc/) and putting the correct "image/x-icon" type there caused the thing to explode once again.

[some time passed here when I started fooling around with my imaginary girlfriend an idea, instead of writing this blog post]

My hunch paid off. Increasing the buffer size for the nsIBufferedOutputStream from 1024 to 4096 (larger than the size of the file that's being converted, it's 1920 bytes) magically disappears the crashiness (this is for .ico to .png with the correct MIME type). And, trying to convert a larger file (21941 bytes) with that 4096 byte buffer still causes a crash (this is from .png to .png). I'd allow myself to call this progress.

I might just add that this crashes a nightly Firefox when using Refractor, so it's not just my XULRunner tree that's covered in ectoplasm. Naturally, I can't recall if all this actually worked earlier.