Please note that I have recently had "The database disk image is malformed" errors a month ago.
The cause was simply a fault in my original 4G RAM card. I was trying to expand the memory by adding another 4G card. My first card had only 3.6G working. When I was doing about 2.5M inserts, they would appear to work, but an "analyze" immediately after would come out with the error. I have an Ubuntu laptop. Note that memtest hasn't worked for a while in Ubuntu (an EFI issue), so I had to download it and install to a USB to find the fault. regs, Kev