novitski / bitcoinj

Automatically exported from code.google.com/p/bitcoinj
Apache License 2.0
0 stars 0 forks source link

Motorola devices: File size on disk does not match expected size: 651264 vs 641024 #466

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There is a strange cumulation of

BlockStoreException: File size on disk does not match expected size: 651264 vs 
641024

with these exact values, and it keeps repeating for at least one user.

It is my understanding that 641024 is a constant and 651264 is how large the 
blockstore just happens to be. The difference is 10240 - does that ring any 
bell? Size of x datasets in the store perhaps?

If I look at the phone models of the error report, I exclusively see Motorola 
devices:

DROID X2
MB632 (Motorola PRO+)
MB855 (Motorola Photon 4G)
MB860 (Motorola Atrix)

Does anyone know if Motorola uses some special (buggy) filesystem? Could not 
find anything about this quickly.

Original issue reported on code.google.com by andreas....@gmail.com on 30 Sep 2013 at 4:47

GoogleCodeExporter commented 9 years ago
Huh. The latter value is indeed a constant. The file is supposed to be set to 
that size when it's created and then not changed.

I wonder if the Motorola kernels have problems with mmapping files that are not 
4k page sized. The man page for mmap says:

       A file is mapped in multiples of the page size.  For a file that is
       not a multiple of the page size, the remaining memory is zeroed when
       mapped, and writes to that region are not written out to the file.

So writes beyond the 641024 byte boundary are supposed to be ignored.

(gdb) print 651264 /(1024.0*4)
$3 = 159
(gdb) print 641024 /(1024.0*4)
$4 = 156.5

The size of the block store is somewhat arbitrary. If this was to become a 
common problem, it's easy enough to grow it a bit so its size is always 4k page 
aligned. It requires some code to handle the transition though.

Original comment by hearn@google.com on 30 Sep 2013 at 4:55

GoogleCodeExporter commented 9 years ago
One more Motorola device to the list: DROIDX

Original comment by andreas....@gmail.com on 4 Oct 2013 at 5:47

GoogleCodeExporter commented 9 years ago
This particular kind of blockchain corruption seems to have died out. The last 
reported case was back in January. Either Motorola fixed their devices 
(unlikely) or users took the affected devices out of service (likely).

FWIW, blockchain curruption that remains:
- upgrades from the old block store
- BlackBerry devices

Anyhow, I close this now.

Original comment by andreas....@gmail.com on 16 Aug 2014 at 9:17