Skip to content

log: Fix segfault in sandbox when LOG_LEVEL_DEFAULT >= LOGL_DEBUG

Sean Anderson u-boot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 of 3 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 3 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] log: Fix segfault in sandbox when LOG_LEVEL_DEFAULT >= LOGL_DEBUG
Quoted 10 lines · Sean Anderson

Since the syslog feature has been introduced, sandbox no longer boots when LOG_LEVEL_DEFAULT prints cdebug messages. This is because it tries to call net_init before initf_dm.

Sean Anderson (3):
dev: Disambiguate errors in uclass_find
net: Expose some errors generated in net_init
log: syslog: Handle errors in net_init

Quoted 9 lines
 common/log_syslog.c   |  4 +++-
 drivers/core/uclass.c | 16 +++++++++++++++-
 include/net.h         |  2 +-
 net/eth-uclass.c      |  3 +++
 net/net.c             | 15 +++++++++++----
 test/dm/core.c        |  2 +-
 test/dm/test-main.c   |  2 +-
 7 files changed, 35 insertions(+), 9 deletions(-)

This causes CI to fail in an interesting way [1]. Running ut log on a fresh boot will have no failures. However, if ut log is run after ut dm, then the tests will fail. From further investigation, it appears that sb_log_tx_handler is not called at all when the tests fail.

I don't know whether this is a "real" test failure or a failure of the unit testing framework. ut dm doesn't appear to be idempotent; every time I run it on the same boot I get additional errors. What's stranger is that running ut all has no failures, but running ut dm has 2 (both for usb_flash).

--Sean

[1] https://dev.azure.com/seanga2/u-boot/_build/results?buildId=30&view=logs&j=50449d1b-398e-53ae-48fa-6bf338edeb51&t=97605dd2-f5a5-5dd7-2118-315ffdc8bcd6&l=455