apache / nuttx

Apache NuttX is a mature, real-time embedded operating system (RTOS)
https://nuttx.apache.org/
Apache License 2.0
2.52k stars 1.07k forks source link

Enabling sinfo printing and disabling CONFIG_SYSLOG_TIMESTAMP_REALTIME caused a recursive calling bug? #8959

Closed GooTal closed 1 year ago

GooTal commented 1 year ago

I enabled sinfo printing: 图片

I found that sinfo called nx_vsyslog, then called clock_gettime

  if (OSINIT_HW_READY())
    {
#if defined(CONFIG_SYSLOG_TIMESTAMP_REALTIME)
      /* Use CLOCK_REALTIME if so configured */

      clock_gettime(CLOCK_REALTIME, &ts);

#else
      /* Prefer monotonic when enabled, as it can be synchronized to
       * RTC with clock_resynchronize.
       */

      clock_gettime(CLOCK_MONOTONIC, &ts);
#endif

But clock_gettime called sinfo again, which makes a recursive bug?

Here`s the backtrace from gdb:

图片

anchao commented 1 year ago

@GooTal already fixed by https://github.com/apache/nuttx/pull/8897

GooTal commented 1 year ago

@anchao Thanks a lot