#20 ✓resolved
Rusty Klophaus

[BUG] Serialized Pids and Refs can cause crash after a restart

Reported by Rusty Klophaus | January 4th, 2009 @ 09:17 AM

Found by Dave Peticolas.

After a restart, a user may hit the site with a session cookie from an old run. Nitrogen will attempt to verify the session, and in the process send a {Pid, verify, Ref} message to the Pid.

If the Pid is now running some other process, it can choke on the message, potentially crashing the system.

This arises because Pids and Refs are re-used.

To solve, either:

1) Don't use a Pid to look up a session, use a Guid instead, and then have a Guid -> Pid lookup table. Potential bottlenecks here.

2) Find some way to check if the Pid is valid before sending a message to the Pid. One possibility is to generate a unique value each time Nitrogen starts up, serialize this in the session cookie, and then check to make sure that the two match. This presents challenges when we run more than one Nitrogen instance.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Nitrogen Web Framework for Erlang

People watching this ticket

Referenced by

Pages