From: =?UTF-8?Q?S=c3=a9bastien_Szymanski?= Date: Tue, 24 Jan 2017 10:58:39 +0100 Subject: [U-Boot] ext4: crash when writing a file In-Reply-To: <1913709.keHlVjZkVL@sbruens-linux> References: <9c9637dd-582d-ac8a-fb71-ee5dcb8307bb@armadeus.com> <2757307.t5dS6qHjZC@sbruens-linux> <90bd01f1-165d-6fbb-3328-97b497c439d9@armadeus.com> <1913709.keHlVjZkVL@sbruens-linux> Message-ID: <9f8b2ba8-74ec-3351-daff-194e89ce206e@armadeus.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 >> 1024 . >> 1024 .. >> 16384 lost+found >> 1024 var >> 1024 run >> 1024 root >> 1024 media >> 1024 mnt >> 1024 tmp >> 3 lib32 >> 1024 usr >> 1024 proc >> 1024 dev >> 1024 boot >> 1024 sys >> 3072 sbin >> 3072 bin >> 11 linuxrc >> 1024 etc >> 1024 opt >> 3072 lib >> >> => ls host 0:2 /boot >> 1024 . >> 1024 .. >> 26909 imx6ul-opos6uldev.dtb >> 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=) at common/dlmalloc.c:1586 1586 if (!(inuse_bit_at_offset(next, nextsz))) /* consolidate forward */ (gdb) bt #0 free (mem=) at common/dlmalloc.c:1586 #1 0x000000000044e9a3 in ext4fs_deinit () at fs/ext4/ext4_write.c:722 #2 0x000000000044fd85 in ext4fs_write (fname=, buffer=, sizebytes=sizebytes at entry=5359984) at fs/ext4/ext4_write.c:980 #3 0x000000000044fe5f in ext4_write_file (filename=, buf=, offset=, 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=, flag=, argc=6, argv=, fstype=) 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