Thursday, November 27, 2008

DLink DSL-G604T router and multicast packets

I spent too much time trying to figure out what I couldn't get Bonjour/Zeroconf working between a Mac (bonjour) and a Linux (avahi) box.

Until I finally tried plugging both devices into the router physically with cables. Previously, the linux machine was connected by cable and the mac was using wifi.

Whilst there was no problems communicating between the two machines directly (ping, ssh, etc by IP address).... they just wouldn't see each other's names.

So it seems the problem is with the DLink router (as good as it is) in that it doesn't bridge multicast udp packets from the LAN to the WLAN (wireless lan).

I'll try to upgrade the firmware and see if that improves the situation....

Thursday, November 20, 2008

Segment fault in strcpy

Just today I was doing some programming work on a Sun machine helping to port some code from an older Sun machine to the newer OS.

The client suspected that it was a compiler problem because the newly compiled versions of the same source code didn't work - and they no longer had access to the old compiler.

Using dbx, I discovered that the crash was occuring in the strcpy function, which is pretty well sure to be bug free.

What transpired was that the program was trying to copy into a string, which the newer compiler was optimising into a read-only segment of the library.

The here's the old and new definitions of the variable:


char* string = "initial string value"; /* read only segment, causes crash in strcpy */
char string[100] = "initial string value"; /* read only segment, causes crash in strcpy */
char string[100]; /* uninitialised places the variable in read-write segment - strcpy into this variable works */


This took a few hours to discover, so hopefully sharing this information will save someone else a short piece of their life. :)

Installing Ubuntu Server 8.10 under Parallels

I found some very useful links about how to install Ubuntu under Parallels:

http://paul.annesley.cc/articles/2007/05/01/ubuntu-704-feisty-server-parallels-cdromkernel-workaround

http://www.theosquest.com/2007/12/29/installing-ubuntu-710-server-under-parallels/

Here is the changes I made to the sequence of things, after installation completes, go BACK and ENTER SHELL and run these commands:


umount /dev/scd0
chroot /target /bin/bash
mount /dev/scd0 /media/cdrom
aptitude install linux-generic
aptitude remove linux-server linux-image-server linux-image-2.6.27-7-server
exit
shutdown -h now


I still get the ACPI warning, however the machine boots.

And upon shutdown, I get the "Unable to iterate IDE devices" message, and after the machine halts, Parallels still thinks it's running.