Posts

Erlang BGP daemon

I'm writing a BGP daemon in Erlang . It can connect, parse update packets and announce routes. I started up an old Cisco 2620 router and sent route announcement to it until it cried: %SYS-2-MALLOCFAIL: Memory allocation of 65536 bytes failed from 0x8046F3C8, Pool: Processor Free: 79840 Cause: Memory fragmentation Alternate Pool: None Free: 0 Cause: No Alternate pool -Process= "BGP Router", ipl= 0, pid= 84 -Traceback= 804733A4 804754C8 8046F3CC 80851CDC 8081C7D8 80832848 80832F3C 8 %BGP-5-ADJCHANGE: neighbor 172.16.x.x Down No memory Muhahahaha! The program: git clone git://github.com/ThomasHabets/eggpd.git Update later that night I flooded the 2620 again for a few minutes and then disconnected the peer. It stopped responding. Well almost. It answers to ping (17 % packet loss), and my existing telnet session seems to be working somewhat, although there is a delay of about 10 minutes between ...

Buffering in pipes

I'm trying to force a program not to buffer its output to stdout. Any program, all programs. It can't involve changing the source code or depending on weird or unportable stuff. It should be possible. It seems like I'm missing something obvious, but I can't figure out what. Some background info I've written a program ( ind ) that puts itself between a subprocess that it creates and the terminal. It acts as a filter for the output from the subprocess. Like this example, where it prepends "stdout: " to all lines that the subprocess prints to standard output: $ echo hej hej $ ./ind -p 'stdout: ' echo hej stdout: hej The dataflow is, from left to right: echo (the subprocess) -> pipe(2) -> ind -> the terminal (stderr runs through a separate pipe(2). Stdin has not been played with yet) So far so good. The problem is that the subprocess' libc (not the kernel) buffers all output using s...

Solaris installation

In what top scientists are calling "pretty gay", Solaris can't handle disks that used to have non-solaris stuff on them without being wiped first. I thought only the windows installer borked if the partition table looked weird, but no! The installer could not see the disk, and I was dropped into a dtterm where I had to do dd if=/dev/zero of=/dev/dsk/c0t0d0 bs=1048576 and reboot. So... wipe the disk before trying to install Solaris.