<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-38145910</id><updated>2011-04-22T01:43:37.965+02:00</updated><category term='linux'/><category term='sulking'/><category term='yay'/><category term='idiot'/><category term='tribulations'/><category term='cherries'/><category term='guff'/><category term='tnedor'/><category term='mozilla'/><category term='hacking'/><category term='testing'/><category term='dbus'/><category term='progress'/><category term='prism'/><category term='rant'/><title type='text'>analog mountains</title><subtitle type='html'>tumbling down digital slopes since [redacted]</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://analogmountains.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://analogmountains.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>fredrik</name><uri>http://www.blogger.com/profile/09020055763121796747</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-38145910.post-9051713208548770773</id><published>2009-03-27T22:55:00.003+01:00</published><updated>2009-03-27T23:03:24.728+01:00</updated><title type='text'>does valgrind detect pigeons?</title><content type='html'>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.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:70%;"&gt;A second New York is being built&lt;br /&gt;a little west of the old one.&lt;br /&gt;Why another, no one asks,&lt;br /&gt;just build it, and they do.&lt;br /&gt;&lt;br /&gt;The city is still closed off&lt;br /&gt;to all but the work crews&lt;br /&gt;who claim it’s a perfect mirror image.&lt;br /&gt;&lt;br /&gt;Truthfully, each man works on the replica&lt;br /&gt;of the apartment building he lives in,&lt;br /&gt;adding new touches,&lt;br /&gt;like cologne dispensers, rock gardens,&lt;br /&gt;and doorknobs marked for the grand hotels.&lt;br /&gt;&lt;br /&gt;Improvements here and there, done secretly&lt;br /&gt;and off the books. None of the supervisors&lt;br /&gt;notice or mind. Everyone’s in a wonderful mood,&lt;br /&gt;joking, taking walks through the still streets&lt;br /&gt;that the single reporter allowed inside has described as&lt;br /&gt;&lt;br /&gt;“unleavened with remainders of the old city’s complicated past,&lt;br /&gt;but giving off some blue perfume from the early years on earth.”&lt;br /&gt;&lt;br /&gt;The men grow to love the peaceful town.&lt;br /&gt;It becomes more difficult to return home at night,&lt;br /&gt;&lt;br /&gt;which sets the wives to worrying.&lt;br /&gt;The yellow soups are cold, the sunsets quick.&lt;br /&gt;&lt;br /&gt;The men take long breaks on the fire escapes,&lt;br /&gt;waving across the quiet spaces to other workers&lt;br /&gt;meditating on their perches.&lt;br /&gt;&lt;br /&gt;Until one day…&lt;br /&gt;&lt;br /&gt;The sky fills with charred clouds.&lt;br /&gt;Toolbelts rattle in the rising wind.&lt;br /&gt;&lt;br /&gt;Something is wrong.&lt;br /&gt;&lt;br /&gt;A foreman stands in the avenue&lt;br /&gt;pointing binoculars at a massive gray mark&lt;br /&gt;moving towards us in the eastern sky.&lt;br /&gt;&lt;br /&gt;Several voices, What, What is it?&lt;br /&gt;&lt;br /&gt;Pigeons, he yells through the wind.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/38145910-9051713208548770773?l=analogmountains.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://analogmountains.blogspot.com/feeds/9051713208548770773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=38145910&amp;postID=9051713208548770773&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/9051713208548770773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/9051713208548770773'/><link rel='alternate' type='text/html' href='http://analogmountains.blogspot.com/2009/03/does-valgrind-detect-pigeons.html' title='does valgrind detect pigeons?'/><author><name>fredrik</name><uri>http://www.blogger.com/profile/09020055763121796747</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-38145910.post-3646595961637553496</id><published>2008-08-24T08:43:00.003+02:00</published><updated>2008-08-24T08:51:14.175+02:00</updated><title type='text'>status update</title><content type='html'>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.&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;So, that's it. For the 0 readers of this blog &amp;mdash; enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/38145910-3646595961637553496?l=analogmountains.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://analogmountains.blogspot.com/feeds/3646595961637553496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=38145910&amp;postID=3646595961637553496&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/3646595961637553496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/3646595961637553496'/><link rel='alternate' type='text/html' href='http://analogmountains.blogspot.com/2008/08/status-update.html' title='status update'/><author><name>fredrik</name><uri>http://www.blogger.com/profile/09020055763121796747</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-38145910.post-2073919849778210604</id><published>2008-04-15T18:08:00.002+02:00</published><updated>2008-04-15T18:11:35.630+02:00</updated><title type='text'>my computer hates you</title><content type='html'>&lt;pre&gt;dudemeister$ history|awk '{a[$2]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|head&lt;br /&gt;143 lame&lt;br /&gt;65 yet&lt;br /&gt;23 omg&lt;br /&gt;12 most&lt;br /&gt;4 meme&lt;br /&gt;3 the&lt;br /&gt;1 suck-it&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/38145910-2073919849778210604?l=analogmountains.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://analogmountains.blogspot.com/feeds/2073919849778210604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=38145910&amp;postID=2073919849778210604&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/2073919849778210604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/2073919849778210604'/><link rel='alternate' type='text/html' href='http://analogmountains.blogspot.com/2008/04/my-computer-hates-you.html' title='my computer hates you'/><author><name>fredrik</name><uri>http://www.blogger.com/profile/09020055763121796747</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-38145910.post-5993298160520373404</id><published>2008-04-10T17:01:00.003+02:00</published><updated>2008-04-10T17:22:00.935+02:00</updated><title type='text'></title><content type='html'>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.&lt;br /&gt;&lt;br /&gt;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 &amp;lt;select&amp;gt; whereas, as is evident, Ubuntu 7.10 draws it perfectly. An eye-sore is what it is.&lt;img style="display:block; margin:5px auto 0px; text-align:center;" src="http://1.bp.blogspot.com/_2Vy20aExSiY/R_4r1yB1dKI/AAAAAAAAAAw/o150eD0oykQ/s320/Screenshot.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5187632023739921570" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/38145910-5993298160520373404?l=analogmountains.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://analogmountains.blogspot.com/feeds/5993298160520373404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=38145910&amp;postID=5993298160520373404&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/5993298160520373404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/5993298160520373404'/><link rel='alternate' type='text/html' href='http://analogmountains.blogspot.com/2008/04/never-underestimate-your-own-ability-to.html' title=''/><author><name>fredrik</name><uri>http://www.blogger.com/profile/09020055763121796747</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_2Vy20aExSiY/R_4r1yB1dKI/AAAAAAAAAAw/o150eD0oykQ/s72-c/Screenshot.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-38145910.post-6300781083308961006</id><published>2008-04-02T14:22:00.002+02:00</published><updated>2008-04-02T14:38:12.301+02:00</updated><title type='text'>whatever</title><content type='html'>The buffered output stream-related bug is solved! Turned out it was a bad patch in &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=363986"&gt;bug 363986&lt;/a&gt; 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&amp;trade; to me personally.&lt;br /&gt;&lt;br /&gt;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 &lt;a href="http://www.aquariumdrunkard.com/2008/01/23/off-the-record-jim-james-louisville-ky/"&gt;totally sweetpickles&lt;/a&gt;. Feels faster, too. I hope build times decrease.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/38145910-6300781083308961006?l=analogmountains.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://analogmountains.blogspot.com/feeds/6300781083308961006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=38145910&amp;postID=6300781083308961006&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/6300781083308961006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/6300781083308961006'/><link rel='alternate' type='text/html' href='http://analogmountains.blogspot.com/2008/04/whatever.html' title='whatever'/><author><name>fredrik</name><uri>http://www.blogger.com/profile/09020055763121796747</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-38145910.post-3942505147927305309</id><published>2008-03-16T22:49:00.005+01:00</published><updated>2008-03-16T23:44:02.382+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dbus'/><category scheme='http://www.blogger.com/atom/ns#' term='mozilla'/><title type='text'>dbus with all the fixin's</title><content type='html'>&lt;img style="float:right; margin:0 0 10px 10px;" src="http://farm3.static.flickr.com/2296/2338878198_1e89843a45_m.jpg" border="0" alt="" /&gt;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 &lt;a href="http://eric.extremeboredom.net/"&gt;Eric Butler&lt;/a&gt;, 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).&lt;br /&gt;&lt;br /&gt;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. &lt;span style="font-style:italic;"&gt;One underscore. Three hours. In theaters now...&lt;/span&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/38145910-3942505147927305309?l=analogmountains.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://analogmountains.blogspot.com/feeds/3942505147927305309/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=38145910&amp;postID=3942505147927305309&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/3942505147927305309'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/3942505147927305309'/><link rel='alternate' type='text/html' href='http://analogmountains.blogspot.com/2008/03/dbus-with-all-fixins.html' title='dbus with all the fixin&apos;s'/><author><name>fredrik</name><uri>http://www.blogger.com/profile/09020055763121796747</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm3.static.flickr.com/2296/2338878198_1e89843a45_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-38145910.post-3468413186304320077</id><published>2008-03-15T00:16:00.011+01:00</published><updated>2008-03-15T01:56:07.408+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='progress'/><category scheme='http://www.blogger.com/atom/ns#' term='tribulations'/><category scheme='http://www.blogger.com/atom/ns#' term='prism'/><category scheme='http://www.blogger.com/atom/ns#' term='mozilla'/><title type='text'>exacerbate and incapacitate (and, apparently, progress)</title><content type='html'>Ah, software. S for stupid, O for OMGWTF?!, F for [expletive deleted] etc.&lt;br /&gt;&lt;br /&gt;Weird, weird bugs. Profoundly weird. So, converting from .ico to .png causes the same buffered stream bug(?) to throw a hissy fit and explode &lt;span style="font-style:italic;"&gt;ze&lt;/span&gt; Prism into tiny shards of glass that hurt your soul. &lt;span style="font-style:italic;"&gt;But&lt;/span&gt;, 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"!&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;[some time passed here when I started fooling around with &lt;span style="text-decoration:line-through;"&gt;my imaginary girlfriend&lt;/span&gt; an idea, instead of writing this blog post]&lt;br /&gt;&lt;br /&gt;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). &lt;span style="font-style:italic;"&gt;And&lt;/span&gt;, 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.&lt;br /&gt;&lt;br /&gt;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.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/38145910-3468413186304320077?l=analogmountains.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://analogmountains.blogspot.com/feeds/3468413186304320077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=38145910&amp;postID=3468413186304320077&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/3468413186304320077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/3468413186304320077'/><link rel='alternate' type='text/html' href='http://analogmountains.blogspot.com/2008/03/exacerbate-and-incapacitate-and.html' title='exacerbate and incapacitate (and, apparently, progress)'/><author><name>fredrik</name><uri>http://www.blogger.com/profile/09020055763121796747</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-38145910.post-6203498418762956608</id><published>2008-03-12T23:58:00.005+01:00</published><updated>2008-03-13T00:28:13.925+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='prism'/><category scheme='http://www.blogger.com/atom/ns#' term='mozilla'/><title type='text'></title><content type='html'>I now have a debug XULRunner build, so I started poking at the odd crasher that &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=420777"&gt;bug 420777&lt;/a&gt; acts as a workaround for. Converting from PNG to PNG (which should work, even though it should never be done) causes the whole shebang to SIGABRT when trying to close the buffered output-stream. Turns out it's nsBufferedStream::Close() that is the bad guy, and not nsStorageStream as I previously had guessed. More specifically the line &lt;a href="http://mxr.mozilla.org/mozilla/source/netwerk/base/src/nsBufferedStreams.cpp#109"&gt;nsBufferedStreams.cpp:109&lt;/a&gt;. &lt;a href="http://cesarmoco.wordpress.com/"&gt;Cesar&lt;/a&gt; confirmed on IRC last week that it affected him as well, so either it's a glibc bug that's in both OpenSUSE 10.2 and Ubuntu 7.10 (IIRC), or it's a Mozilla problem. I have no idea at this point, but I'm leaning towards the latter.&lt;br /&gt;&lt;br /&gt;(A partial stack trace is available &lt;a href="http://pastebin.mozilla.org/365296"&gt;here&lt;/a&gt;.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/38145910-6203498418762956608?l=analogmountains.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://analogmountains.blogspot.com/feeds/6203498418762956608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=38145910&amp;postID=6203498418762956608&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/6203498418762956608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/6203498418762956608'/><link rel='alternate' type='text/html' href='http://analogmountains.blogspot.com/2008/03/i-now-have-debug-xulrunner-build-so-i.html' title=''/><author><name>fredrik</name><uri>http://www.blogger.com/profile/09020055763121796747</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-38145910.post-3843420520930677998</id><published>2008-03-11T16:29:00.007+01:00</published><updated>2008-03-11T17:12:58.630+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><category scheme='http://www.blogger.com/atom/ns#' term='mozilla'/><title type='text'>it's not a long way to Tipperary if you live on the outskirts of Tipperary</title><content type='html'>Hopefully we'll get some neat stuff done for Prism this week (we talked on IRC about menus for tray icons and the dock, and if that doesn't happen it's just a matter of triggering plasticmillion's Pavlovian response by filing a bug and it'll be done). There's also a couple of bugs to fix, I'd love to get the icon handling going smoothly (possibly whip up something based on imgLoader that can auto-detect the MIME type based on something else than what's supplied in the &amp;lt;link&amp;gt; tag or file extension -- content uses imgLoader so maybe one can do it without having to write a binary component [imgLoader's methods aren't scriptable]). At the very least, we need more graceful failure modes.&lt;br /&gt;&lt;br /&gt;It's a really fun thing to be involved with, I feel like I'm turning into somewhat of a Mozilla evangelist. Becoming a part of the Prism team was very natural and I have to say if every single person who got started with Mozilla in some way had a Mark Finkle or a Matt Gertner (plasticmillion) as the first point of contact, there would be notices of proverbial cups overflowing with happy geeks all over Planet Mozilla. (Two really super guys, I spent most parts of Friday night vicariously getting Mozilla building using the iPhone SDK with/through Matt. The most pure nerd fun I've had in quite some time. Yes, I am easy to please.)&lt;br /&gt;&lt;br /&gt;I've also started prodding a bit at the half-arsed JS-Dehydra thing I began back when the leaves turned last year (use SpiderMonkey to spid out the JS AST as JSON and massage in Python and make Dehydra run on that). Static checking (or, even better: automatic rewriting) of JS would be cool.&lt;br /&gt;Reading all the incredibly cool posts by Dave Mandelin and Taras Glek really gets my mouth watering. I mean, a blog post like &lt;a href="http://blog.mozilla.com/dmandelin/2008/03/10/i-need-a-theorem-prover/"&gt;this&lt;/a&gt;. I don't understand half of it, and that's a blast. Learning something new implies not understanding it first. (Yes, I am a &lt;span style="font-style:italic;"&gt;huge&lt;/span&gt; Feynman fan.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/38145910-3843420520930677998?l=analogmountains.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://analogmountains.blogspot.com/feeds/3843420520930677998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=38145910&amp;postID=3843420520930677998&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/3843420520930677998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/3843420520930677998'/><link rel='alternate' type='text/html' href='http://analogmountains.blogspot.com/2008/03/hopefully-well-get-some-neat-stuff-done.html' title='it&apos;s not a long way to Tipperary if you live on the outskirts of Tipperary'/><author><name>fredrik</name><uri>http://www.blogger.com/profile/09020055763121796747</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-38145910.post-4151879766464209557</id><published>2008-03-02T00:22:00.007+01:00</published><updated>2008-03-02T01:10:49.844+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='yay'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><category scheme='http://www.blogger.com/atom/ns#' term='prism'/><category scheme='http://www.blogger.com/atom/ns#' term='tnedor'/><category scheme='http://www.blogger.com/atom/ns#' term='mozilla'/><title type='text'>flossing</title><content type='html'>It is surprisingly more satisfying than I had thought filing bugs, poking at the code and sometimes seeing p=nossralf in a check-in log. I mean, it's like a little buzz, more than a few synapses going "wheeee".&lt;br /&gt;&lt;br /&gt;I've decided to learn a bit about the xpcshell HTTP server and writing unit tests for Mozilla in general, since Prism needs some lovin' in that department. Using the HTTP server makes sense, since it enables testing things such as the favicon downloader (and possibly aspects of Refractor as well). It may be too late to impact 0.9, but getting good unit test coverage won't make 1.0 kick any less ass.&lt;br /&gt;&lt;br /&gt;And I need to get one of my other little projects, Tnedor, finished. It's a Python-based xbindkeys replacement with per-application settings (mouse buttons only for now). With an associated GUI application for setting up the configuration. Mouse settings on Linux suck. Bad. And reducing suck should be the goal of all software. (It's called Tnedor because Esuom sounds too Finnish and that's just wrong!)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/38145910-4151879766464209557?l=analogmountains.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://analogmountains.blogspot.com/feeds/4151879766464209557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=38145910&amp;postID=4151879766464209557&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/4151879766464209557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/4151879766464209557'/><link rel='alternate' type='text/html' href='http://analogmountains.blogspot.com/2008/03/flossing.html' title='flossing'/><author><name>fredrik</name><uri>http://www.blogger.com/profile/09020055763121796747</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-38145910.post-3784889966272568700</id><published>2008-02-28T00:20:00.007+01:00</published><updated>2008-02-28T01:33:35.279+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rant'/><title type='text'>seymour, do less</title><content type='html'>&lt;img style="float:right; margin:0 0 10px 10px;" src="http://4.bp.blogspot.com/_2Vy20aExSiY/R8X-4JMM9dI/AAAAAAAAAAo/ZCsQuckrC2g/s320/jakob_no_small.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5171819987598112210" /&gt;The blahgosphere is abuzz with talk of rich Internet applications, and has been for the last couple of months. Adobe's AIR was released the other day, and there's been a lot of talk about the technical merits of the platform, the security aspects, its place in the market, how it will compete with web browsers or the web in general, and so on. This is all well and good, programmers, analysts and strategists all love new platforms; poking at them, smelling them, squeezing, licking, your average verb+object bonanza.&lt;br /&gt;&lt;br /&gt;But there's been little talk of usability, and I view this with some trepidation. The ability to easily create custom widgets and free-flowing designs will make it much easier to bring upon the desktop the curse of the skinners. Nothing good can come of this. I imagine &lt;a href="http://www.useit.com/alertbox/application-mistakes.html"&gt;Jakob Nielsen&lt;/a&gt; cries himself to sleep only to wake up later in a cold sweat.&lt;br /&gt;&lt;br /&gt;I have yet to use a skinned desktop application (of the old steam-powered kind) that actually created a user interface that was clearly better than what could've been accomplished by using the native widget set. At best, and this happens extremely rarely, you get usability parity with a nicer visual presentation. Most of them have sucked more than a rational belief system can comprehend.&lt;br /&gt;&lt;br /&gt;If there is a golden rule for interface design, it is &lt;a href="http://www.jwz.org/doc/linuxvideo.html"&gt;this&lt;/a&gt;: &lt;span style="font-style:italic;"&gt;Whenever a programmer thinks, "Hey, skins, what a cool idea", their computer's speakers should create some sort of cock-shaped sound wave and plunge it repeatedly through their skulls.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Skinning a desktop application used to be reasonably difficult, no native platform SDK provides you with the ability to do so without jumping through at least one hoop. With AIR I wonder if it's even possible to use native widgets. Add to that the fact that it's intended to actually &lt;span style="font-style:italic;"&gt;encourage&lt;/span&gt; Flash or web developers to create skinned desktop applications, and it's a gaudy, blinking, oddly-shaped recipe for suck.&lt;br /&gt;&lt;br /&gt;(One could add to this the accessibility aspect. Custom-widget designs and layouts don't respond to desktop themes that increase legibility, for example. If all AIR applications will communicate with screen readers or not is unknown to me. I know there are APIs to enable that, however.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/38145910-3784889966272568700?l=analogmountains.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://analogmountains.blogspot.com/feeds/3784889966272568700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=38145910&amp;postID=3784889966272568700&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/3784889966272568700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/3784889966272568700'/><link rel='alternate' type='text/html' href='http://analogmountains.blogspot.com/2008/02/seymour-do-less.html' title='seymour, do less'/><author><name>fredrik</name><uri>http://www.blogger.com/profile/09020055763121796747</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_2Vy20aExSiY/R8X-4JMM9dI/AAAAAAAAAAo/ZCsQuckrC2g/s72-c/jakob_no_small.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-38145910.post-8340638691243366565</id><published>2008-02-27T12:00:00.002+01:00</published><updated>2008-02-27T12:10:17.789+01:00</updated><title type='text'>queuetie pie</title><content type='html'>Mercurial Queues is where it's at. The tray icon stuff a single-patch queue, and updating it against trunk is (after svn up-ing my hg base): hg qpop, hg pull -u, hg qpush and if there are conflicts, fix 'em and do a qrefresh.&lt;br /&gt;&lt;br /&gt;And 3 hours chasing down a problem that was EOL-oriented isn't fun. At least I'm intimately familiar with Preprocessor.py and know more about the build system than before. And I've invented at least 4 new ways of cursing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/38145910-8340638691243366565?l=analogmountains.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://analogmountains.blogspot.com/feeds/8340638691243366565/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=38145910&amp;postID=8340638691243366565&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/8340638691243366565'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/8340638691243366565'/><link rel='alternate' type='text/html' href='http://analogmountains.blogspot.com/2008/02/queuetie-pie.html' title='queuetie pie'/><author><name>fredrik</name><uri>http://www.blogger.com/profile/09020055763121796747</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-38145910.post-8010570870564607832</id><published>2008-02-26T12:58:00.003+01:00</published><updated>2008-02-26T13:12:21.289+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='guff'/><category scheme='http://www.blogger.com/atom/ns#' term='mozilla'/><title type='text'>traysleeper</title><content type='html'>I filed &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=419600"&gt;bug 419600&lt;/a&gt; to get the snot mercilessly reviewed out of me. &lt;br /&gt;&lt;br /&gt;For generalized support, I currently assume too much about the MIME types of the image file that's handed to setIcon, but I never set out to make it anything but a Prism fit when I started (where the webapp installer nicely converts images to the proper format). It's all fixable, of course.&lt;br /&gt;&lt;br /&gt;Also, I love Mercurial (hg mv). I check out the SVN trunk to a dir that is also versioned with hg, and clone off that locally. I think I'll try the localbranch extension to see if that makes it easier working on both bugs I find in the upstream stuff as well as the GTK tray stuff.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/38145910-8010570870564607832?l=analogmountains.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://analogmountains.blogspot.com/feeds/8010570870564607832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=38145910&amp;postID=8010570870564607832&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/8010570870564607832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/8010570870564607832'/><link rel='alternate' type='text/html' href='http://analogmountains.blogspot.com/2008/02/traysleeper.html' title='traysleeper'/><author><name>fredrik</name><uri>http://www.blogger.com/profile/09020055763121796747</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-38145910.post-8332504006749308008</id><published>2008-02-25T21:41:00.005+01:00</published><updated>2008-02-25T22:14:17.592+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='progress'/><category scheme='http://www.blogger.com/atom/ns#' term='mozilla'/><title type='text'>webrunner webrunner, going faster miles an hour</title><content type='html'>Oh yeah, the tray code for Linux now has feature parity with the Windows implementation. I never could get a native GtkWindow out of Mozilla, but instead of the whole InterfaceRequestor/Docshell/BaseWindow dance I just called nsIDOMWindowInternal's Focus method and called it a day. (SetZLevel only focuses the window currently.)&lt;br /&gt;&lt;br /&gt;I'm contemplating &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=415948"&gt;menus for tray icons&lt;/a&gt; now. Hacked together some code that builds, but I haven't hooked up the plumbing through JavaScript. My thinking is to pass a menu's &lt;a href="http://mxr.mozilla.org/mozilla/source/layout/xul/base/public/nsIPopupBoxObject.idl"&gt;nsIPopupBoxObject&lt;/a&gt; to the tray code to attach it to an icon that way. Since Prism uses a 1.9 XULRunner, it will have the openPopupAtScreen method, and by getting the position of the tray icon that was clicked to bring up a menu, it can be opened at a reasonably proper location (modulo problems unknown at this time).&lt;br /&gt;If I could get the actual GtkMenu out of Mozilla in some way I could use GTK's own menu positioning code for tray icons, but I don't see that happening.&lt;br /&gt;&lt;br /&gt;Since XUL overlays can be loaded on-demand using document.loadOverlay, there's no reason why there couldn't be a webapp.xul overlay for more advanced usage of Prism (like for tray icon menus). But that's not up to me to decide. Perhaps using an extension is preferable in that case.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/38145910-8332504006749308008?l=analogmountains.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://analogmountains.blogspot.com/feeds/8332504006749308008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=38145910&amp;postID=8332504006749308008&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/8332504006749308008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/8332504006749308008'/><link rel='alternate' type='text/html' href='http://analogmountains.blogspot.com/2008/02/webrunner-webrunner-going-faster-miles.html' title='webrunner webrunner, going faster miles an hour'/><author><name>fredrik</name><uri>http://www.blogger.com/profile/09020055763121796747</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-38145910.post-5562224887124238139</id><published>2008-02-25T17:48:00.004+01:00</published><updated>2008-02-25T18:01:36.627+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='guff'/><title type='text'>being Swedish, I must disagree</title><content type='html'>&lt;a href="http://www.flickr.com/photos/nitot/2289314003/"&gt;This&lt;/a&gt; is hilarious.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/38145910-5562224887124238139?l=analogmountains.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://analogmountains.blogspot.com/feeds/5562224887124238139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=38145910&amp;postID=5562224887124238139&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/5562224887124238139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/5562224887124238139'/><link rel='alternate' type='text/html' href='http://analogmountains.blogspot.com/2008/02/being-swedish-i-must-disagree.html' title='being Swedish, I must disagree'/><author><name>fredrik</name><uri>http://www.blogger.com/profile/09020055763121796747</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-38145910.post-1475573502762863957</id><published>2008-02-21T15:59:00.005+01:00</published><updated>2008-02-25T18:02:06.754+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='idiot'/><category scheme='http://www.blogger.com/atom/ns#' term='mozilla'/><title type='text'>oopsie...</title><content type='html'>I had almost finished writing a blog post saying "it &lt;span style="font-style:italic;"&gt;is&lt;/span&gt; XPCOM biting me, and I'm probably asking for it" when I realized that was indeed the case. What do you call someone who doesn't NS_ADDREF when he's supposed to? Stupid, that's what. (The jury will accept "inexperienced" too, but with me yammering on about "copying the Windows logic" without actually copying the NS_ADDREF, well, it's kinda stupid.)&lt;br /&gt;&lt;br /&gt;Anyway, I found it by setting a watchpoint for the pointer (using "watch *((int*)0xblah)"), found out it was being freed in NS_DestroyXPTCallStub, which of course means its refcount was 0. Hard to call through XPTCall if there's no stub there to actually call through, natch.&lt;br /&gt;&lt;br /&gt;At least it works now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/38145910-1475573502762863957?l=analogmountains.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://analogmountains.blogspot.com/feeds/1475573502762863957/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=38145910&amp;postID=1475573502762863957&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/1475573502762863957'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/1475573502762863957'/><link rel='alternate' type='text/html' href='http://analogmountains.blogspot.com/2008/02/i-had-almost-finished-writing-blog-post.html' title='oopsie...'/><author><name>fredrik</name><uri>http://www.blogger.com/profile/09020055763121796747</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-38145910.post-4280885358819808804</id><published>2008-02-19T23:19:00.014+01:00</published><updated>2008-02-28T01:38:47.402+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sulking'/><category scheme='http://www.blogger.com/atom/ns#' term='mozilla'/><title type='text'>stuck inside of mozil' with the memphis blues again</title><content type='html'>Been trying to figure out why the heck I get a segfault when trying to call OnNotificationAreaClick when the tray icon is clicked. The GTK signal callback gets the correct pointer, but GDB doesn't really help with telling what it actually points to. Not even in ShowIcon, where aListener seems to point to something entirely unrelated:&lt;pre&gt;Breakpoint 1, nsDesktopEnvironment::ShowIcon (this=0x858d2c0,&lt;br /&gt;  aIconId=@0xbfd9ad28, aImageURI=0x858bde0, aListener=&lt;span style="font-weight:bold;"&gt;0x858d738&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;(gdb) x aListener &lt;br /&gt;&lt;span style="color:#700;"&gt;0x858d738: 0xb7a09ac8&lt;/span&gt;&lt;br /&gt;(gdb) p aListener&lt;br /&gt;$7 = (struct nsINotificationAreaListener *) 0x858d738&lt;br /&gt;(gdb) x/wa *(void**)aListener &lt;br /&gt;0xb7a0bac8 &lt;_ZTVN10gfxTextRun16PropertyProviderE+627120&gt;: 0xb7715d4c&lt;/pre&gt;At least using &lt;a href="http://developer.mozilla.org/en/docs/Debugging_on_Linux#How_do_I_determine_the_concrete_type_of_an_object_pointed_to_by_an_interface_pointer.3F"&gt;this guide&lt;/a&gt;. It probably has to do with how nsINotificationAreaListener is defined and actually used (being QI'd through XPConnect, as the WebRunner object is the one implementing the interface). But I don't grok XPCOM enough to actually say that with any degree of confidence. Calling the OnNotification... method in ShowIcon &lt;span style="font-style:italic;"&gt;does work&lt;/span&gt; at least. &lt;br /&gt;Then we come to the callback which GTK calls when the icon is clicked:&lt;pre&gt;Breakpoint 2, notify_cb (icon=0x8545120, data=&lt;span style="font-weight:bold;"&gt;0x858d738&lt;/span&gt;)&lt;br /&gt;(gdb) p data&lt;br /&gt;$9 = (gpointer) 0x858d738&lt;br /&gt;(gdb) x data&lt;br /&gt;&lt;span style="color:#700;"&gt;0x858d738: 0x54746573&lt;/span&gt;&lt;br /&gt;(gdb) x/wa *(void**)data&lt;br /&gt;0x54746573: Cannot access memory at address 0x54746573&lt;br /&gt;(gdb) x/s data&lt;br /&gt;0x858d738: "setTitle"&lt;/pre&gt;The memory access thing is probably what makes it segfault. And yeah, that string is what happens to be there &lt;span style="font-style:italic;"&gt;every single time&lt;/span&gt; I run it through the debugger. The callback's defined thusly:&lt;pre&gt;void notify_cb(GtkStatusIcon *icon,&lt;br /&gt;               gpointer data) {&lt;br /&gt;  nsCOMPtr&amp;lt;nsINotificationAreaListener&amp;gt; listen; &lt;br /&gt;  listen = (nsINotificationAreaListener *)data;&lt;br /&gt;  listen-&amp;gt;OnNotificationAreaClick(0,2);&lt;br /&gt;}&lt;/pre&gt;And hooked up like so:&lt;pre&gt;g_signal_connect(mStatusIcon, "activate", G_CALLBACK(notify_cb),&lt;br /&gt;                 (gpointer)aListener);&lt;/pre&gt;in ShowIcon (mStatusIcon is the GtkStatusIcon pointer, gpointer is typedef-ed as void*). Totally imitating the logic in the Windows tray code (where the pointer is stored as a property attached to the listener window that detects clicks on the icon). The actual segfault happens when the nsCOMPtr tries to AddRef the pointee in the assignment operator.&lt;br /&gt;&lt;br /&gt;I would add a watch to see what actually happens to change the pointer, but since it's a multi-threaded app, GDB kills the watch as soon as the thread it's defined in gets preempted. So, what, Valgrind? Mommy, the big-boy pants are coming on... (Or I'm just doing something stupid that I'm overlooking.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/38145910-4280885358819808804?l=analogmountains.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://analogmountains.blogspot.com/feeds/4280885358819808804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=38145910&amp;postID=4280885358819808804&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/4280885358819808804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/4280885358819808804'/><link rel='alternate' type='text/html' href='http://analogmountains.blogspot.com/2008/02/stuck-in-mozil-with-memphis-blues-again.html' title='stuck inside of mozil&apos; with the memphis blues again'/><author><name>fredrik</name><uri>http://www.blogger.com/profile/09020055763121796747</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-38145910.post-1581203934553704045</id><published>2008-02-18T00:11:00.007+01:00</published><updated>2008-02-18T00:52:03.017+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sulking'/><category scheme='http://www.blogger.com/atom/ns#' term='mozilla'/><title type='text'>sprinkles or gummi bears?</title><content type='html'>Meh. Stupid segmentation faults. All I want to do (is have some fun) and call the nsINotificationAreaListener callback, and instead of sun coming up over Santa Monica Boulevard I get repeated punches to the groin. The joy of replacing dozens of lines of WinAPI guff with a single &lt;code&gt;g_signal_connect&lt;/code&gt; was short-lived. (It can be called immidiately after entering &lt;code&gt;ShowIcon&lt;/code&gt; but when the pointer is stored away and then retrieved in the callback function, similar to the Windows case, there be 'splosions.)&lt;br /&gt;&lt;br /&gt;By the by, GtkStatusIcon is a GObject and not a GtkWidget descendant, which means it doesn't handle events like widgets do. So, no double-clicks for you!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/38145910-1581203934553704045?l=analogmountains.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://analogmountains.blogspot.com/feeds/1581203934553704045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=38145910&amp;postID=1581203934553704045&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/1581203934553704045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/1581203934553704045'/><link rel='alternate' type='text/html' href='http://analogmountains.blogspot.com/2008/02/sprinkles-or-gummi-bears.html' title='sprinkles or gummi bears?'/><author><name>fredrik</name><uri>http://www.blogger.com/profile/09020055763121796747</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-38145910.post-8230957658195492767</id><published>2008-02-16T00:25:00.004+01:00</published><updated>2008-02-16T01:00:43.513+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='tribulations'/><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><category scheme='http://www.blogger.com/atom/ns#' term='mozilla'/><title type='text'>the unbearable slightness of seeing</title><content type='html'>&lt;img style="display:block; margin:0px auto 5px; text-align:center;" src="http://2.bp.blogspot.com/_2Vy20aExSiY/R7YfoZMM9cI/AAAAAAAAAAg/3U59d0bGhv4/s320/Screenshot.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5167352401271518658" /&gt;Okay, so the icon isn't much. But it represents nsINotificationArea support for &lt;s&gt;Webrunner&lt;/s&gt;Prism under Linux (not complete by any means, but it actually shows/hides the icon and sets the tooltip, which at the very least is measurable progress). Most of the time was spent wrestling with the build system, which is about as surprising as something not very surprising. A hard-coded icon file extension in webrunner.js cost me more than a few minutes of sulking too. (And what's the deal with XPM instead of PNG?)&lt;br /&gt;&lt;br /&gt;It uses GtkStatusIcon, which was introduced in GTK+ 2.10, but seeing as how e.g. the printing changes that went into the Firefox 3.0 nightlies also require 2.10 or later, I doubt it's much of a problem. If there's any interest in this stuff upstream, that is.&lt;br /&gt;&lt;br /&gt;Also, I'm really happy there are XULRunner SDK nightlies. Tastes great, less building.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/38145910-8230957658195492767?l=analogmountains.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://analogmountains.blogspot.com/feeds/8230957658195492767/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=38145910&amp;postID=8230957658195492767&amp;isPopup=true' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/8230957658195492767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/8230957658195492767'/><link rel='alternate' type='text/html' href='http://analogmountains.blogspot.com/2008/02/unbearable-slightness-of-seeing.html' title='the unbearable slightness of seeing'/><author><name>fredrik</name><uri>http://www.blogger.com/profile/09020055763121796747</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_2Vy20aExSiY/R7YfoZMM9cI/AAAAAAAAAAg/3U59d0bGhv4/s72-c/Screenshot.png' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-38145910.post-7890393919187288017</id><published>2008-02-08T13:25:00.001+01:00</published><updated>2008-02-16T00:50:47.093+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cherries'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><category scheme='http://www.blogger.com/atom/ns#' term='mozilla'/><title type='text'>having fun with js-ctypes</title><content type='html'>So, after humming and hawing until I was fresh out of hum and down to my last batch of haw, I figured the time was right to try and get js-ctypes working to start contributing more to Mozilla. I have a trunk Firefox debug build I update once a month or so and figured since I popped my build-your-own cherry about a year ago, with PyXPCOM enabled no less, I should be able to get js-ctypes going without too much crying.&lt;br /&gt;&lt;br /&gt;Verdict: well that was easy. Check out the code from the svn repo into mozilla/extensions/, add it to extensions in .mozconfig like so:&lt;pre&gt;ac_add_options --enable-extensions=default,spatialnavigation,python,&lt;span style="font-weight:bold;"&gt;js-ctypes&lt;/span&gt;&lt;/pre&gt;and Bob's your proverbial uncle. It built cleanly on my working Fx trunk build, and it was available to extensions and whatnot.&lt;br /&gt;&lt;br /&gt;Now, I use Linux (openSUSE 10.2 currently) and Mark Finkle &lt;a href="http://starkravingfinkle.org/blog/2007/09/hello-js-ctypes-goodbye-binary-components/"&gt;wrote on his blog when announcing js-ctypes&lt;/a&gt;, "compiles on Linux, but I haven’t got around to testing it." It turns out it built cleanly, but it didn't work. Some quick testing using a hastily thrown together extension showed that &lt;code&gt;nsINativeTypes::Open()&lt;/code&gt; failed &amp;mdash; it didn't load shared libraries (libc.so.6 in this case). After hitting mxr it turned out a &lt;code&gt;PRLibSpec&lt;/code&gt; struct is initialized differently depending on the platform, and the code only covered the WIN32 case. That's &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=416119"&gt;bug #416119&lt;/a&gt;. The fix was easy enough, an #ifdef and a couple lines of code, but I'm still not sure the string &lt;s&gt;voodoo&lt;/s&gt;stuff is correct (I think the &lt;code&gt;PromiseFlatCString&lt;/code&gt; call is redundant as &lt;code&gt;NS_Convert...&lt;/code&gt; returns an &lt;code&gt;nsCAutoString&lt;/code&gt; which is "flat" already).&lt;br /&gt;&lt;br /&gt;That took care of the first problem and js-ctypes now loaded shared libraries in Linux. Score one for the newb. The next step was to try and call some function. I chose &lt;code&gt;puts()&lt;/code&gt;, which is a part of libc and simply outputs a string of characters to stdout. Easy enough, right? Well, no. Since it uses a char* buffer for the string, I chose &lt;code&gt;nsINativeTypes.STRING&lt;/code&gt; when declaring the function like so&lt;a href="#note"&gt;*&lt;/a&gt;:&lt;pre&gt;const nsINativeTypes = Ci.nsINativeTypes;&lt;br /&gt;var library = Cc["@developer.mozilla.org/js-ctypes;1"]&lt;br /&gt;              .createInstance(Ci.nsINativeTypes);&lt;br /&gt;library.open("libc.so.6");&lt;br /&gt;var puts = library.declare("puts", /* function name */&lt;br /&gt;                           nsINativeTypes.INT32, /* return type */&lt;br /&gt;                           nsINativeTypes.SYSV, /* call ABI */&lt;br /&gt;                           nsINativeTypes.STRING /* argument type */&lt;br /&gt;);&lt;br /&gt;var ret = puts("Hello World from js-ctypes!");&lt;/pre&gt;Upon trying that code I was greeted with a segmentation fault. It turned out there was no implementation for the native type STRING in nsNativeMethod.cpp. Since there's no default catch-undefined-and-return-error in the switch blocks in &lt;code&gt;nsNativeMethod::Execute()&lt;/code&gt; and &lt;code&gt;declare()&lt;/code&gt; doesn't care what type you specify (in reality any uint16 will work), when the function was called the call to &lt;code&gt;ffi_prep_cif()&lt;/code&gt; in &lt;code&gt;nsNativeMethod::Execute()&lt;/code&gt; had incomplete information about the parameters and exploded. Adding support for STRING is &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=416229"&gt;bug #416229&lt;/a&gt;. Thankfully, I could reuse the logic for WSTRING but use char* instead of PRUnichar* and fix the problem without any trouble.&lt;br /&gt;&lt;br /&gt;The customary money shot:&lt;img style="display:block; margin:10px auto 10px; text-align:center;" src="http://4.bp.blogspot.com/_2Vy20aExSiY/R6xLMDyZVaI/AAAAAAAAAAQ/dNGeMLPS4Vk/s320/ctypes.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5164585543234311586" /&gt;This was a fun little exercise in building/testing/hacking on a Mozilla project and has left me wanting to do more. Including adding support for struct types and writing some unit tests. My thinking as far as testing goes is to write a shared object/library with a set of known functions that exercise all the native types covered by js-ctypes, integrating that into the build and then adding tests to the unit test framework. I have little or no idea how to do most of those things, but figuring it out will be fun.&lt;br /&gt;&lt;br /&gt;&lt;a name="note"&gt;[*]&lt;/a&gt; Do note that the call ABI has to be specified. That bit me for about 30 minutes before I poked through the code thoroughly and realized the example code in &lt;a href="http://starkravingfinkle.org/blog/2007/09/hello-js-ctypes-goodbye-binary-components/"&gt;Mark Finkle's original post&lt;/a&gt; didn't reflect that.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/38145910-7890393919187288017?l=analogmountains.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://analogmountains.blogspot.com/feeds/7890393919187288017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=38145910&amp;postID=7890393919187288017&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/7890393919187288017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/38145910/posts/default/7890393919187288017'/><link rel='alternate' type='text/html' href='http://analogmountains.blogspot.com/2008/02/having-fun-with-js-ctypes.html' title='having fun with js-ctypes'/><author><name>fredrik</name><uri>http://www.blogger.com/profile/09020055763121796747</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_2Vy20aExSiY/R6xLMDyZVaI/AAAAAAAAAAQ/dNGeMLPS4Vk/s72-c/ctypes.png' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
