[U-Boot] ext4: crash when writing a file

Sébastien Szymanski sebastien.szymanski at armadeus.com
Tue Jan 24 10:58:39 CET 2017


On 01/23/2017 05:38 PM, Brüns, Stefan wrote:
> On Freitag, 20. Januar 2017 18:32:49 CET Sébastien Szymanski wrote:
> [...]
>> Then under the sandbox I do the following:
>>
>> U-Boot 2017.01-00002-g558e41e-dirty (Jan 20 2017 - 16:19:47 +0100)
>>
>> DRAM:  256 MiB
>> MMC:
>> Using default environment
>>
>> In:    serial
>> Out:   serial
>> Err:   serial
>> SCSI:  Net:   No ethernet found.
>> IDE:   Bus 0: not available
>>
>> => host bind 0 /tftproot/rootfs.raw
>>
>> => ls host 0:2
>> <DIR>       1024 .
>> <DIR>       1024 ..
>> <DIR>      16384 lost+found
>> <DIR>       1024 var
>> <DIR>       1024 run
>> <DIR>       1024 root
>> <DIR>       1024 media
>> <DIR>       1024 mnt
>> <DIR>       1024 tmp
>> <SYM>          3 lib32
>> <DIR>       1024 usr
>> <DIR>       1024 proc
>> <DIR>       1024 dev
>> <DIR>       1024 boot
>> <DIR>       1024 sys
>> <DIR>       3072 sbin
>> <DIR>       3072 bin
>> <SYM>         11 linuxrc
>> <DIR>       1024 etc
>> <DIR>       1024 opt
>> <DIR>       3072 lib
>>
>> => ls host 0:2 /boot
>> <DIR>       1024 .
>> <DIR>       1024 ..
>>            26909 imx6ul-opos6uldev.dtb
>> <SYM>          1 dtbs
>>          5359984 opos6ul-linux.bin
>>
>> => host load hostfs - 0 /tftproot/opos6ul-linux.bin
>> 5359984 bytes read in 2 ms (2.5 GiB/s)
>>
>> => printenv filesize
>> filesize=51c970
>>
>> => ext4write host 0:2 0 /boot/opos6ul-linux.bin ${filesize}
>> File System is consistent
>> file found, deleting
>> update journal finished
>> File System is consistent
>> update journal finished
>> Segmentation fault
> 
> As you can repeat this under sandbox, the next step would be to run sandbox 
> under gdb, e.g.:
> $> gdb --args sandbox -c "host bind 0 /tftproot/rootfs.raw ; host load hostfs 
> - 0 /tftproot/opos6ul-linux.bin ; ext4write host 0:2 0 /boot/opos6ul-linux.bin 
> ${filesize}"

Yes, I did this and it crashes exactly where I pointed out in my first post:

(gdb) run
Starting program: /home/sszy/development/armadeus-u-boot/u-boot -c host\
bind\ 0\ /tftproot/rootfs.raw\;\ host\ load\ hostfs\ -\ 0\
/tftproot/opos6ul-linux.bin\;\ ext4write\ host\ 0:2\ 0\
/boot/opos6ul-linux.bin\ \$\{filesize\}
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".


U-Boot 2017.01-00002-g558e41e-dirty (Jan 24 2017 - 10:44:13 +0100)

DRAM:  256 MiB
MMC:
Using default environment

In:    serial
Out:   serial
Err:   serial
SCSI:  Net:   No ethernet found.
IDE:   Bus 0: not available
5359984 bytes read in 2 ms (2.5 GiB/s)
File System is consistent
file found, deleting
update journal finished
File System is consistent
update journal finished

Program received signal SIGSEGV, Segmentation fault.
free (mem=<optimized out>) at common/dlmalloc.c:1586
1586      if (!(inuse_bit_at_offset(next, nextsz)))   /* consolidate
forward */
(gdb) bt
#0  free (mem=<optimized out>) at common/dlmalloc.c:1586
#1  0x000000000044e9a3 in ext4fs_deinit () at fs/ext4/ext4_write.c:722
#2  0x000000000044fd85 in ext4fs_write (fname=<optimized out>,
buffer=<optimized out>, sizebytes=sizebytes at entry=5359984) at
fs/ext4/ext4_write.c:980
#3  0x000000000044fe5f in ext4_write_file (filename=<optimized out>,
buf=<optimized out>, offset=<optimized out>, len=5359984,
actwrite=0x7fffffffd5b8)
    at fs/ext4/ext4_write.c:1012
#4  0x000000000044a41b in fs_write
(filename=filename at entry=0x7ffff4887280 "/boot/opos6ul-linux.bin",
addr=addr at entry=0, offset=offset at entry=0, len=len at entry=5359984,
    actwrite=actwrite at entry=0x7fffffffd5b8) at fs/fs.c:325
#5  0x000000000044a7a3 in do_save (cmdtp=<optimized out>,
flag=<optimized out>, argc=6, argv=<optimized out>, fstype=<optimized
out>) at fs/fs.c:478

Regards,

> 
> Kind regards,
> 
> Stefan
> 


-- 
Sébastien Szymanski
Software Engineer, Armadeus Systems
sebastien.szymanski at armadeus.com
Tel: +33 (0)9 72 29 41 44
Fax: +33 (0)9 72 28 79 26


More information about the U-Boot mailing list