Older blog entries for decklin (starting at number 30)

In the bizzare forms of recovery department:

Hardly got any sleep last night, but my hard drive is mostly fixed. Currently moving whatever I don't need all the time off on CDs. For some reason, disaster-type incidents like this leave me stressed out all day. So to concentrate on something else, I turned gaim into a multi-binary package. After a lot of code-package-recode cycles, I finally feel confident that I can debianize just about anything easily. stu (no account, so: Robert S. Edmonds) was quite happy that I did his homework ;-)

I've gotten through new-maintainer! Whee! Just waiting on a reply from the S*cr*t D*b*an C*b*l to my AM's reccomendation. Note to self: I really need to fix muddleftpd's logging before I dupload it. I hope I can figure out a patch to send upstream before the next release.

And meta stuff: I wonder what the point of this latest article is, other that arguing. Hi craig. ;-) I know everyone has opinions, and that's good, but after a while on the net opinions just become not all that interesting compared to actual discussion. There, I think i've guaranteed at least one flame back at me now...

Mozilla seems especially fast today. I finally got around to cron-ifying the build earlier this week, which has been quite helpful. Skin is almost ``there'' as well.

Tired. Very tired. Do not stay up all night with fsck and debugfs, kids. Good night.

Ugh ugh ugh. I have been grappling with fsck for maybe 4 hours now. This is not fun. Pray to the gods of data recovery for me...

On the bright side, I will have a big juicy bug report to send to tytso, once I write up the logs I've been saving. I guess not all is lost.

Put out a new version of aewm last night, and another one to fix the bugs in that today. As ever, comp.windows.x has been quite helpful. Sometimes when you're wrapped up in a piece of code saying ``why can't I get this to *work* arrrrrg!!!'' you can't see that a whole different approach is what you really want.

Set myself up on a URL reminder service to check the home pages of both programs I'm making debs for, as I realized I was out of date for both. I remember at least one person asking about this on #debian, perhaps someone will find the link useful.

I wonder if there's any official document that says you should use /etc/hostname and not /etc/HOSTNAME, because then I could beat Red Hat over the head with it. Of course the upstream author of my package is on Red hat... grr.

Saw X-Men. While there was a lot of bad acting, the good acting outweighed it, and the whole thing was generally enjoyable. Looked up all the actors I had never heard of out of sheer boredom... Hugh looks much better without a beard.

Mulad: check $LOGNAME, maybe...

nullity: tell me about it... *sigh*

This entry brought to you by the new tune ``Let Go'' by Teebee. I'm melting just listening to it... rewind... rewind... rewind... ahhhhhh....

Cripes, I haven't done anything worthwile this week either. Let's see... my Mozilla skin is at least improving a bit. I'm hitting a bit of a wall with the XUL <template> element -- the docs are out of date and there's some extra magic somewhere else in the packages/navigator tree that distingushes between certain kinds of bookmark rules. Humph. New-maint is moving along. I also switched to procmail. As a test, I signed up for a "get paid money to read junk mail" service and cooked up a rule to delete said mail and load the URL contained within, netting me 10 cents without having to look at anything. If capitalism crumbles next week, blame me :-P

ssmtp is ugly ugly ugly. I don't wanna install a real MTA. sent one debian/rules bug fix off but there are a lot more to do.

nealmcb: karma on Slashdot is based on ``writing good comments''? I want some of whatever you're smoking. :-)

Iain: dont feel bad about it. I recently became as old as my parents were when they met, and I haven't even had anyone close to a SO for a while. I still feel ancient.

Time to go catch up on articles...

ObFoistingMyMusicalTasteOnEveryoneElse: MJ Cole - ``Sincere''

To recap on this weekend... I did nothing. Had to let the old brain switch off for a while. Well, I did see Chicken Run finally (I'm a bit behind the curve, as usual.) And I did prepare an NMU of rc, as it's uninstallable on woody. So is es, but I never used that and just tossed it out when I reinstalled. I sent an email to Dale Scheetz and he said he'd be happy to let me adopt it when I'm officialy in the project. Yay! I <HEART> rc. I have to start hacking on the readline interface sometime.

As we all know, the set of all things may be divided into two non-intersecting subsets, namely ``things that are stupid'' and ``things that are not stupid''.

I Am Stupid

I had a reeeeeeally fun morning. I woke up, started checking mail, and noticed everything was barfing due to a read-only file-system. I immediately thought ``crap, errors=remount-ro'', logged out, and proceeded to fsck. As there was a large amount of errors, I wasn't paying too much attention when I gave fsck the go-ahead to remove every directory entry underneath my $home (It also helped that the directory names were replaced with ``???''). I went into full chicken-with-its-head-cut-off panic mode for a few minutes, then proceeded to muck about with debugfs to see what I could do. It must have been my lucky day (hah), because the entries for the directories were still intact, sitting around as deleted files tend to do. Oddly, their dtime was 0, so I don't really know why they showed up in debugfs and not in a normal mount, but I do not pretend to understand the complexities of ext2. I was able to recover everything by doing this:

  1. start debugfs; run unlink on a missing dir
  2. fsck the filesystem, and put that directory entry in lost+found
  3. figure out what it was by looking in it and file it away
  4. lather, rinse, repeat.
Once I figured that out, my blood pressure went down to somewhat near normal. Needless to say, I now have a CD-R backup in my hand, and I'm going to wipe my disk clean and reinstall with it.

Everyone Else Is Stupid

Not one, not two, but three emails today saying, ``your site doesn't work in Netscape. Fix it.'' I just don't understand lusers. If whatever program they're using acts a certain way, it must be the gospel truth. They can't seem to get it through their heads that their compiler might make a useful binary even though undefined behaviour is invoked, or that their web browser might fail to render something that is nevertheless perfectly valid. Some choice quotes from a fellow who tried to pursue the argument:

validation is not important,
apparently, your a crappy bastard.
I even got flamed for using Mozilla! I love it. My conviction that I will always write conforming HTML and not lift a finger to help people who insist on using closed-source browsers has been strengthened quite a bit.

Alan Cox Is Not Stupid

-test4 is working quite well. I suppose there will be only something to report when I have a problem.

thelizard.mozilla.org Is Stupid

'nuff said. I want my CVS! *wahhh*

sanpietro.red-bean.com Is Not Stupid

The following nifty entry allows me to get my e-mail without sending anything over the wire in cleartext:

poll sp.red-bean.com via localhost with protocol pop3 and port 6110:
    user "decklin"
    password "xxxxxxx"
    preconnect "ssh -C -f -n -L 6110:sp.red-bean.com:110 sp.red-bean.com 'sleep 5'"

fetchmail Is Stupid

However, the following equally nifty entry does not, and fails with a parse error:

poll sp.red-bean.com via localhost with protocol pop3 and port 6110:
    preconnect "ssh -C -f -n -L 6110:sp.red-bean.com:110 sp.red-bean.com 'sleep 5'"
    user "decklin"
    password "xxxxxxx"

Classifying the remaining members of the set of all things is left as an exercise for the reader, because I'm tired.

Sleep: Silly me. I should realize that I'm not going to be able to get on with a normal amount of sleep the night after I spend all day in a car/plane. I didn't get going until sometime in the afternoon, which was slightly annoying, as I had told someone I was going to look into a dhsupdate bug report by this morning at the latest. Thankfully, it seemed to work fine for me, except for forgetting about URL-encoding the arguments (well, none of the arguments I typically use have anything but [a-zA-Z] in them). If someone knows a quick way to do that without pulling out Perl, let me know.

aewm: I figured out what was causing the gtk-palette bug to manifest itself on my desktop (which I haven't used all week) and not on my laptop (which I have): My desktop is just too darn fast. Darn it, computer, are you listening? Go slower. Don't make me have to come in there and take one of your processors out... ;-) But seriously, the problem is that I have a bunch of X protocol action happening between 2 programs in a non-well-defined order. Both get an event at ``the same time'', and then send a bunch of protocol requests in response, but what order it all happens in is up to the nasaldemons (well, the scheduler). I think I may be able to solve it with some strategic syncs and/or flushes.

There are some more outstanding aewm issues, but none are really interesting. I put 0.9.11 out, as there was a really embarrassing bug where any command line options would fail. I was hoping to deal with the above before anyone noticed, but no dice (I hate you, Craig ;-). This bug taught me something about C pre-processor macros, which hopefully I can pass along:

Making macros that can be called and treated as if they were functions is good up to a point, but it's easy to take this too far. What burned me in the previously mentioned bug was using a continue statement. Right away this should tell you that the expansion of the macro depends on the context and scope where it is used, so pretending that it's a function will eventually lead to trouble. Make it explicit in the calling code that what is happening is a macro expansion. Another example is when I recently defined something like foo(s, ...) to snprintf(s, sizeof s, "...", ...). I understood it at the time, but then I came back a few weeks later, looked at the calling code, and said, ``crap! that's a buffer overflow!'', since it only had a variable buf and a bunch of things I wanted to print into it (denoted by ... above) in the argument list. A function, of course, can't get the sizeof buf like a macro can, and I didn't immediately remember that it was a macro.

OK, perhaps I just need to start making all my macros be uppercase, (the ones that couldn't be implemented as functions, at least) and this is totally obvious to all of you. Who knows.

Security: I think it was on comp.lang.c where a thread a few weeks ago got on the topic of echoing typed input when a user is entering a password. More specifically, that it's a rather stupid idea because if your environment is insecure enough that someone could read your password over your shoulder, then the same person could read any potentially confidential data you access with that password over your shoulder anyway.

I'm not sure it applies to all cases, but the other day I found myself writing a shell script to edit a CipherSabered file in place. When I got to to the ``read in the key'' part, I almost reflexively turned echoing off. Then I slapped my forehead and remembered the above thread. What was the point of that? I was mainly going to be using this script to edit a file containing passwords for web sites, anyway. It just goes to show you that the force of habit should not always be trusted.

Important People Don't Have To Read Manuals: right after I said ``no more editing'' last time, I remembered I should have thanked Telsa and gilbertt for emailing me their folder-hook entries after I mused about looking that up. Everyone's so nice around here. Speaking of the word ``muse'', this is a very good book.

Music: Listening to Maxwell remixes by Fellowship (mmmmmm) and some weird Brazilian compilation with no one I've ever heard of (well, discounting Jazzanova) on it. Also, my Photek trade will be in the mail soon. Life is good.

Moved my code back to the desktop... Heisenbugs. Yuck. I need sleep before I can deal with this. These things always seem to happen when you have a quick fix for a non-related, embarrasing bug queued up for release.... Sigh. More later.

More tales from vacationland...

Well that silly thing I started off with in my last entry is out. I'm not mourning it. A few more small changes for this morning's release of aewm as well, but what I'm really happy about is that I got a helpful response in comp.windows.x, and with the code I got there, I finally have a decent implementation of xaw-palette. I'm not going to release right away though, because it's not a bug fix, and I would like to test everything on my home machine. I just can't give it a workout on my laptop, what with no Netscape or net access for Mozilla. In the meantime, don't read the source. QOTD is: ``plan to throw one away; you will, anyway.''

Been having lots of network problems lately. First my campus's network starts dropping packets going in and out... getting up to 50% at times. I traceroute, find the problematic router, whois it, email the address given, email the address from the autobounce there, and do I get any thanks? :-P No, but AT&T did fix it this morning. The good part of all this is that craigbro offered me an account at red-bean.

Then, in the middle of that (last night), I somehow broke my home machine. I was logged in with PuTTY, and Windoze froze, so I restarted, redialed, and couldn't get back in. I could ping it, and it was still doing IP-masq fine, but no connections and (when I called home this morning) nothing on the screen. What did I learn from this?

  1. I'm never going to be able to track this bug down, because I don't have access to a PPP-using Windoze machine at home.
  2. Walking your parents through a manual fsck on the phone can be rather difficult. While I immediately know that ``fsck dev/hda3'' is wrong, to a newbie it's just a string of might-as-well-be-random characters. Also when fsck prints an entire screenfull of block bitmap differences and asks you if you want to fix them, it can scare mothers and impressionable children.
I like the latest article. Lots of good discussion. andreas: I belive the problem is that char can be signed. In that case, a negative value for len would pass the check, but then be cast to size_t (an unsigned type) in the call to strncpy. Assuming two's complement representation, it would then become something from 128-255 (for CHAR_BIT == 8 ;-)), and clobber your stack. I am unsure as to how the negative value gets into domain, though... Well anyway, am I close?

spot writes:

its like driving a car with only one thing on the dash, a little LED that says "engine: alive/dead".
You are Ken Thompson, and I claim your car. ;-)

Iain writes:

got 3.56 in C programming
Oh yeah, I forgot! I took that too. Got a 4.12. I'm sure the clc regulars would still be able to beat me though. I think it nets me a somewhat useless but still nifty "Master" certificate in my snailmail box when I get back home. Too busy/lazy to take any others at the moment... (p.s. I am the nth person to spell your name wrong the first time. Do'h.)

OK, that's the last edit I make in place. If someone else posts something I want to comment on, I'll just hold on to it. Can't go hogging the top of recentlog.html all day... :-)

What am I doing here? I'm on vacation. I think I'm addicted. ;-)

Well, I came up with a rather twisted hack on the plane. Despite removing some code duplication in the aewm goodies, I still had some functions which had to have one prototype for GTK+ and another for Xaw. So I decided to do something like:

#ifdef XAW
typedef Widget GenericWidget;
#endif
#ifdef GTK
typedef GtkWidget *GenericWidget;
#endif

Then use GenericWidget in my prototype, and compile to two different .o files. Amusingly enough, it worked. So now I have just about all my common code in one file. Nice.

Since it looks like I haven't written about it before, I will now rant about -ansi. I like to make sure that my C programs are all ANSI-correct, being a subscriber of (and occasional ``good guy'' on) comp.lang.c. Unfortunately -ansi mucks with compilation in rather odd ways. It undefines almost everything in features.h, which would be find with me if I could simply turn __USE_BSD back on. However, -D__USE_BSD doesn't work at all. #define __USE_BSD 1 randomly works and doesn't work depending on what order I include things in, but I wouldn't consider this a tenable solution anyway. This means I have no prototypes in scope for snprintf or strcpy, thus implicitly defining them as returning int and getting type coercion warnings. Note to self: start searching gnu.gcc.bug archives...

And of course, anything in __USE_ISOC9X should be included in -ansi now. :-P

On to my other favorite source of suckage: X11. There's one big problem that's stopping a 1.0 release, and that's windows getting destroyed before we know about it. I will elucidate with some stuff I just sent to craigbro:

Now in the sane case, there's an UnmapNotify at the head of the queue, and a DestroyNotify further down. So we can suck that event off and say "whoa, nellie!" to the code that was going to touch that window. But there's also the degenerate evil hose beast case, brought to you by none other that that wonderful toolkit GTK+. (Hey, I don't mind programming in it, but when i have my WM hat on I hate it.) If you kill a GTK+ window is some circumstances I haven't figured out yet, it destroys itself, puts an UnmapNotify on the queue, and then *doesn't* put the DestroyNotify on until we've already had a chance to return from XNextEvent, not find the DestroyNotify in the list of pending events, and go kablooie.

...Obviously, one could always make an X error handler that does nothing (er, guilty as charged), but i'm not letting that evil kludge spread any further.

The big problem here is that this is not only affecting the WM itself, it's getting in the way of the next feature I want to add to the *-palette goodies: keeping track of iconification. We'll see. If anyone has a decent way of implementing something like XIsWindowValid(), let me know.

Dialups: SSH over a dialup PPP link is slooooow. But then everything seems slow; it's been almost 2 years since I had to suck data through one of these.

Social Engineering: In case you were wondering, (yeah, right), it's by grandfather's Windoze box that has the PPP link. I accidentally erased the dial-up password (mumble mumble Client For Microsoft Networks mumble), so I figured I would take a guess before bothering him... got it on the first try. Sheesh.

ObRandomThought: I need to have mutt not thread my inbox and sent box, just my mailing list folders. Off to the manuals...

And more software stuff: Redid the aewm Changelog. There's another thing out of the way...

In good news, Photek's new LP is scheduled for September. Dillinja, take a hint, eh? We heard Nasty Ways on dub last summer! You're not freakin' Bad Co...

21 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!