$ sudo /usr/sbin/ubiformat /dev/mtd0 --vid-hdr-offset=512 --sub-page-size=512 --flash-image=/dev/loop0
ubiformat: mtd0 (nand), size 536870912 bytes (512.0 MiB), 4096 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 4095 -- 100 % complete
ubiformat: 4096 eraseblocks have valid erase counter, mean value is 3
Floating point exception
However, adding --verbose option the FPE does not occur.
gdb shows:
(gdb) c
Continuing.
ubiformat: mtd0 (nand), size 536870912 bytes (512.0 MiB), 4096 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 4095 -- 100 % complete
ubiformat: 4096 eraseblocks have valid erase counter, mean value is 2
Program received signal SIGFPE, Arithmetic exception.
0x0000555555556ea2 in flash_image (si=<optimized out>, ui=0x7fffffffe0b0, mtd=0x7fffffffe170, libmtd=<optimized out>) at ubi-utils/ubiformat.c:443
443 printf("\r" PROGRAM_NAME ": flashing eraseblock %d -- %2lld %% complete ",
(gdb) bt full
#0 0x0000555555556ea2 in flash_image (si=<optimized out>, ui=0x7fffffffe0b0, mtd=0x7fffffffe170, libmtd=<optimized out>) at ubi-utils/ubiformat.c:443
err = <optimized out>
new_len = <optimized out>
buf = <error reading variable buf (value requires 131072 bytes, which is more than max-value-size)>
ec = <optimized out>
fd = <optimized out>
st_size = <optimized out>
img_ebs = <optimized out>
eb = 0
written_ebs = 0
divisor = 0
skip_data_read = 0
fd = <optimized out>
img_ebs = <optimized out>
eb = <optimized out>
written_ebs = <optimized out>
divisor = <optimized out>
skip_data_read = <optimized out>
st_size = <optimized out>
out_close = <optimized out>
_err = <optimized out>
_err = <optimized out>
err = <optimized out>
new_len = <optimized out>
buf = <optimized out>
ec = <optimized out>
_err = <optimized out>
_err = <optimized out>
_err = <optimized out>
#1 main (argc=<optimized out>, argv=<optimized out>) at ubi-utils/ubiformat.c:909
Note the "divisor = 0"
The code:
if (!args.quiet && !args.verbose) {
printf("\r" PROGRAM_NAME ": flashing eraseblock %d -- %2lld %% complete ",
eb, (long long)(eb + 1) * 100 / divisor);
So this seems to mean --quiet or --verbose will avoid the error.