I tracked this down to UnsafeCharField calling setInt() rather than setChar() on sun.misc.Unsafe. I’m not sure exactly why the other fields are unset (or changed), but it looks like Unsafe lives up to its name and is affecting neighbouring fields when the setter doesn’t match the type.
It looks like the problem was introduced in Avro 1.7.5 in
AVRO-1282. I’m marking it as a Blocker since the bug can cause data corruption.
Here’s a test with a fix. Without the fix the test fails. I also added a test for ReflectData#getSchema for a char type, which was missing.