[PATCH 0/3] log: Fix segfault in sandbox when LOG_LEVEL_DEFAULT >= LOGL_DEBUG

Sean Anderson
2020-09-13T20:13:58Z

On 9/12/20 5:45 PM, Sean Anderson wrote:
> 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
>
> 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