[U-Boot] sandbox does not complete efi_selftest

Heinrich Schuchardt xypron.glpk at gmx.de
Tue Sep 18 00:41:12 UTC 2018


On 09/16/2018 07:45 AM, Simon Glass wrote:
> When I run
> 
> $ sandbox/u-boot -D -c "bootefi selftest"
> 
> I get at the end the network timeout failure:
> 
> Setting up 'simple network protocol'
> Failed to open socket: 1 Operation not permitted
> Failed to open socket: 1 Operation not permitted
> Failed to open socket: 1 Operation not permitted
> Setting up 'simple network protocol' succeeded
> 
> Executing 'simple network protocol'
> DHCP Discover
> DHCP Discover
> DHCP Discover
> DHCP Discover
> DHCP Discover
> DHCP Discover
> DHCP Discover
> DHCP Discover
> DHCP Discover
> DHCP Discover
> lib/efi_selftest/efi_selftest_snp.c(311):
> ERROR: Timeout occurred
> lib/efi_selftest/efi_selftest.c(109):
> ERROR: Executing 'simple network protocol' failed

You have to ensure that the network interface used by the simple network
protocol is connected to a DHCP server for this test to succeed. The
loop interface is not a good choice.

> 
> Tearing down 'simple network protocol'
> Tearing down 'simple network protocol' succeeded
> 
> 
> and then at the end:
> 
> Summary: 1 failures
> 
> Preparing for reset. Press any key...
> resetting ...
> 
> Here it hangs waiting for a key.

This key is served by test_efi_selftest.py so this should not pose a
problem if the SandboxConsole class works correctly.

What really needs a fix is this segmentation fault for sandbox_defconfig:

$ valgrind ./u-boot -v -d u-boot.dtb  -c 'bootefi hello'
==12957== Memcheck, a memory error detector
==12957== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==12957== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==12957== Command: ./u-boot -v -d u-boot.dtb -c bootefi\ hello
==12957==


U-Boot 2018.09-00268-g05538f55c0 (Sep 18 2018 - 02:12:40 +0200)

Model: sandbox
DRAM:  128 MiB

Warning: host_lo MAC addresses don't match:
Address in ROM is          f2:49:6f:48:66:70
Address in environment is  00:00:11:22:33:44
==12957== Invalid read of size 1
==12957==    at 0x1C5B3F: memcpy (string.c:526)
==12957==    by 0x177653: eth_raw_bus_post_bind (sandbox-raw-bus.c:45)
==12957==    by 0x15871A: device_bind_common.isra.0 (device.c:150)
==12957==    by 0x1588CE: device_bind_with_driver_data (device.c:222)
==12957==    by 0x15953C: lists_bind_fdt (lists.c:175)
==12957==    by 0x1595D5: dm_scan_fdt_live (root.c:232)
==12957==    by 0x159911: dm_extended_scan_fdt (root.c:338)
==12957==    by 0x1599AD: dm_init_and_scan (root.c:384)
==12957==    by 0x14458C: initr_dm (board_r.c:292)
==12957==    by 0x1B23D5: initcall_run_list (initcall.c:30)
==12957==    by 0x1445E8: board_init_r (board_r.c:879)
==12957==    by 0x127568: main (start.c:321)
==12957==  Address 0x89171a3 is 0 bytes after a block of size 3 alloc'd
==12957==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==12957==    by 0x4B8FF49: strndup (strndup.c:43)
==12957==    by 0x4C1BC90: if_nameindex_netlink (if_index.c:171)
==12957==    by 0x4C1BC90: if_nameindex (if_index.c:208)
==12957==    by 0x17757B: eth_raw_bus_post_bind (sandbox-raw-bus.c:23)
==12957==    by 0x15871A: device_bind_common.isra.0 (device.c:150)
==12957==    by 0x1588CE: device_bind_with_driver_data (device.c:222)
==12957==    by 0x15953C: lists_bind_fdt (lists.c:175)
==12957==    by 0x1595D5: dm_scan_fdt_live (root.c:232)
==12957==    by 0x159911: dm_extended_scan_fdt (root.c:338)
==12957==    by 0x1599AD: dm_init_and_scan (root.c:384)
==12957==    by 0x14458C: initr_dm (board_r.c:292)
==12957==    by 0x1B23D5: initcall_run_list (initcall.c:30)
==12957==
==12957== Invalid read of size 1
==12957==    at 0x1C5B41: memcpy (string.c:527)
==12957==    by 0x177653: eth_raw_bus_post_bind (sandbox-raw-bus.c:45)
==12957==    by 0x15871A: device_bind_common.isra.0 (device.c:150)
==12957==    by 0x1588CE: device_bind_with_driver_data (device.c:222)
==12957==    by 0x15953C: lists_bind_fdt (lists.c:175)
==12957==    by 0x1595D5: dm_scan_fdt_live (root.c:232)
==12957==    by 0x159911: dm_extended_scan_fdt (root.c:338)
==12957==    by 0x1599AD: dm_init_and_scan (root.c:384)
==12957==    by 0x14458C: initr_dm (board_r.c:292)
==12957==    by 0x1B23D5: initcall_run_list (initcall.c:30)
==12957==    by 0x1445E8: board_init_r (board_r.c:879)
==12957==    by 0x127568: main (start.c:321)
==12957==  Address 0x89171a4 is 1 bytes after a block of size 3 alloc'd
==12957==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==12957==    by 0x4B8FF49: strndup (strndup.c:43)
==12957==    by 0x4C1BC90: if_nameindex_netlink (if_index.c:171)
==12957==    by 0x4C1BC90: if_nameindex (if_index.c:208)
==12957==    by 0x17757B: eth_raw_bus_post_bind (sandbox-raw-bus.c:23)
==12957==    by 0x15871A: device_bind_common.isra.0 (device.c:150)
==12957==    by 0x1588CE: device_bind_with_driver_data (device.c:222)
==12957==    by 0x15953C: lists_bind_fdt (lists.c:175)
==12957==    by 0x1595D5: dm_scan_fdt_live (root.c:232)
==12957==    by 0x159911: dm_extended_scan_fdt (root.c:338)
==12957==    by 0x1599AD: dm_init_and_scan (root.c:384)
==12957==    by 0x14458C: initr_dm (board_r.c:292)
==12957==    by 0x1B23D5: initcall_run_list (initcall.c:30)
==12957==

Warning: host_enp2s0 MAC addresses don't match:
Address in ROM is          5e:44:87:71:0f:cb
Address in environment is  00:00:11:22:33:45

Warning: host_wlp4s0 using MAC address from ROM
MMC:
In:    cros-ec-keyb
Out:   vidconsole
Err:   vidconsole
Model: sandbox
SCSI:
Net:   eth0: host_lo, eth1: host_enp2s0, eth2: host_wlp4s0, eth3:
eth at 10002000
Found 0 disks
==12957== Invalid read of size 2
==12957==    at 0x16D4BF: console_truetype_putc_xy (console_truetype.c:279)
==12957==    by 0x16F42B: vidconsole_put_char (vidconsole-uclass.c:375)
==12957==    by 0x16F471: vidconsole_puts (vidconsole-uclass.c:403)
==12957==    by 0x14CF63: console_puts (console.c:250)
==12957==    by 0x14CF63: fputs (console.c:361)
==12957==    by 0x1C7366: printf (vsprintf.c:798)
==12957==    by 0x199D07: efi_disk_register (efi_disk.c:435)
==12957==    by 0x12B273: efi_init_obj_list (bootefi.c:69)
==12957==    by 0x12B362: do_bootefi (bootefi.c:516)
==12957==    by 0x153DD7: cmd_call (command.c:499)
==12957==    by 0x153DD7: cmd_process (command.c:538)
==12957==    by 0x143572: run_pipe_real (cli_hush.c:1677)
==12957==    by 0x143572: run_list_real (cli_hush.c:1875)
==12957==    by 0x143984: run_list (cli_hush.c:2024)
==12957==    by 0x143984: parse_stream_outer (cli_hush.c:3216)
==12957==    by 0x142EA8: parse_string_outer (cli_hush.c:3274)
==12957==  Address 0x138f2db2 is not stack'd, malloc'd or (recently) free'd
==12957==
==12957==
==12957== Process terminating with default action of signal 11 (SIGSEGV)
==12957==  Access not within mapped region at address 0x138F2DB2
==12957==    at 0x16D4BF: console_truetype_putc_xy (console_truetype.c:279)
==12957==    by 0x16F42B: vidconsole_put_char (vidconsole-uclass.c:375)
==12957==    by 0x16F471: vidconsole_puts (vidconsole-uclass.c:403)
==12957==    by 0x14CF63: console_puts (console.c:250)
==12957==    by 0x14CF63: fputs (console.c:361)
==12957==    by 0x1C7366: printf (vsprintf.c:798)
==12957==    by 0x199D07: efi_disk_register (efi_disk.c:435)
==12957==    by 0x12B273: efi_init_obj_list (bootefi.c:69)
==12957==    by 0x12B362: do_bootefi (bootefi.c:516)
==12957==    by 0x153DD7: cmd_call (command.c:499)
==12957==    by 0x153DD7: cmd_process (command.c:538)
==12957==    by 0x143572: run_pipe_real (cli_hush.c:1677)
==12957==    by 0x143572: run_list_real (cli_hush.c:1875)
==12957==    by 0x143984: run_list (cli_hush.c:2024)
==12957==    by 0x143984: parse_stream_outer (cli_hush.c:3216)
==12957==    by 0x142EA8: parse_string_outer (cli_hush.c:3274)
==12957==  If you believe this happened as a result of a stack
==12957==  overflow in your program's main thread (unlikely but
==12957==  possible), you can try to increase the size of the
==12957==  main thread stack using the --main-stacksize= flag.
==12957==  The main thread stack size used in this run was 8388608.
==12957==
==12957== HEAP SUMMARY:
==12957==     in use at exit: 0 bytes in 0 blocks
==12957==   total heap usage: 56 allocs, 56 frees, 5,998 bytes allocated
==12957==
==12957== All heap blocks were freed -- no leaks are possible
==12957==
==12957== For counts of detected and suppressed errors, rerun with: -v
==12957== ERROR SUMMARY: 32 errors from 3 contexts (suppressed: 0 from 0)
Segmentation fault


More information about the U-Boot mailing list