Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logging can't dump exceptions without losing data with CONFIG_LOG_PRINTK #15372

Closed
andrewboie opened this issue Apr 11, 2019 · 3 comments
Closed
Assignees
Labels
area: Logging bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug Stale

Comments

@andrewboie
Copy link
Contributor

I was making some changes to samples/subsys/logging/logger when I noticed that my exception printouts were garbled:

***** General Protection Fault
***** Exception code: 0x0
Current thread ID = 0x00400000
eax: 0x00400100, ebx: 0x004022d0, ecx: 0x0040231c, edx: 0x004022dc
esi: 0x00000000, edi: 0x00402     0x0000343f (0x400100)
     0x0000368a (0x402304)
     0x00002fca (0x0)
     0x00002938 (0x9919)
     0x000014c8 (0x9919)
     0x000023fd (0x0)
Fatal fault in thread 0x00400000! Aborting.

We're missing some of the call trace and the register dump.

@andrewboie andrewboie added area: Logging bug The issue is a bug, or the PR is fixing a bug labels Apr 11, 2019
@nashif nashif added the priority: low Low impact/importance bug label Apr 12, 2019
@nordic-krch
Copy link
Contributor

yes, that is because that part is called before log_panic occurs. In that case, printk content is formatted to a stirng and stored in the logger buffer. Since the content is stored and not log message like in standard logs it consumes more space in the buffer (approx string length + >20bytes). With series of such messages buffer can get full quite fast.

There are two options:

  • bigger buffer
  • rework handling of printk messages to be exactly like log_messages but without formatting (e.g. ERR level without formatting.). In that case user must take same care as in case of the logger to use log_strdup for transient strings but there are many benefits - less ram used, much faster (same speed as logging, 10-20 times faster).

@carlescufi
Copy link
Member

@andrewboie and @nordic-krch is this still relevant or can we close it?

@github-actions
Copy link

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Logging bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug Stale
Projects
None yet
Development

No branches or pull requests

4 participants