This bug has been around for a long time (I've been affected for... I can't remember how long, but several months I'd say).
You have more info about what's causing the bug here:
http://forums.gentoo.org/viewtopic-t-750470.html
In short, gdm starts on tty2, where there is ALSO a "login" process. So, while typing on Firefox or wherever, somehow it goes down through to "login", and randomly both crash (which makes me think that, beside this bug, there might be a "login" bug too).
You can check what I'm saying is true this way:
1) Start your machine.
2) When gdm login appears, switch to tty1.
3) Switch back to tty2. Voila! gdm is there.
4) Go back to tty1. Login as root, and restart gdm (/etc/rc.d/gdm restart).
4) INMEDIATELY AFTER you restart gdm, switch back again to tty2. You will see some random strange characters, kind of a login attempt failure (wrong username/password). After a few seconds it dissapears.
As a temporal solution,
comment your tty2 on /etc/inittab (mine is on line 28), so it doesn't start. That way, you will have gdm on tty2, but no "login" process underneath (or... beside xD).