impossible NullPointerException

Had some really strange problems today. After doing a rather trivial update which involved rebooting a machine, the software suddenly started behaving weirdly, throwing exceptions all over the place. Two other systems with the same version of the software showed no problems whatsoever. Programming can be fun, bug hunting…

One of he strangest errors was a NullPointerException problem in a piece of code which was unchanged with previous versions. Checking the code the error was actually impossible. There were only two constructors in the class, one actually initialised the value to a not-null value. The other to a passed value which was checked to be not-null. The field was not modified anywhere else. So what next?

Transferring the database back from the clients machine, the problem was fortunately reproducable. So at least it had something to do with the data which was handled, not simply with what was done.

Some hunting by some of the other guys on the team revealed a problem in the serialization/deserialization code. We are using jboss-serialization partly because it should be faster than native serialization, and partly because it relieves you from the burden defining all classes as serializable. So far so good, except that it appears there was a bug when you try to serialize/deserialize a string which is between 32k and 64k in length. Oops. Thanks Andrei for finding and fixing this, great work. The guys at jboss have incorporated the fix and it is available as jboss-serialization 1.03.
Can it really be that the memory (as is RAM) suddenly got broken by rebooting the machine? Apparently, as reverting to the previous version did not help either, that was the only conclusion I have left. So, the memory was replaced but this did not solve the problem.

Leave a Reply

Your email address will not be published. Required fields are marked *

question razz sad evil exclaim smile redface biggrin surprised eek confused cool lol mad twisted rolleyes wink idea arrow neutral cry mrgreen

*