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
[DO NOT MERGE] mm/mm_heap: fix crash when CONFIG_DEBUG_MM_INFO is enabled #5969
base: master
Are you sure you want to change the base?
Conversation
When CONFIG_DEBUG_MM_INFO, dbg is used to print few logs during task clean up stage. This causes issue as during task clean up the stdout stream realted semaphore is uninitialized in the func lib_stream_release , but the same sem is used later for dbg logs. Thus, this results in assert failure in lib_filesem.c as the error number we get when taking sem on an invalid sem is EINVAL So, use mllvdbg instead of mvdbg Signed-off-by: Abhishek Akkabathula <a.akkabathul@samsung.com>
@abhishek-samsung How about log mixed with lldvg? |
Hello @sunghan-chang , mixed logs can happen because of this. But this will avoid the crash (caused by assert). Will discuss this with my team and will update you if we find a different approach. |
A bit more context, this issue was introduced by the PR #5742 , before this there was no dependency on stdout file sem for dbg. |
@abhishek-samsung How about remove dependency stdout sem and add syslog buffer for only dbg. The uart write is getting argument buffer and buffer size and takes sem per-buffer. but dbg has not buffer, so I think, occerd log mix issue. |
I think the initial design for dbg was to not use any buffering. Lines 95 to 97 in 0f974de
also, do you mean we will need to maintain two different buffers? Again we need some kind of synchronization between them when outputting right? |
@abhishek-samsung If dbg does not cause log mixed with printf log, then we don't need PR #5742 and any buffer. What we want is just one. No log mixed with printf and dbg. For this, we applied the same sem for both. |
As I remember, initially dbg and printf do not mix logs.
|
This chage need prerepuisites as below Do not use dbg case of after called sched_lock() and irqsave(). If we will change, please also refer to this |
@sunghan-chang and @ewoodev, my team is looking into this. Please give us some time to do the analysis. |
When CONFIG_DEBUG_MM_INFO, dbg is used to print few logs during task clean up stage. This causes issue as during task clean up the stdout stream related semaphore is uninitialized in the func lib_stream_release , but the same sem is used later for dbg logs. Thus, this results in assert failure in lib_filesem.c as the error number we get when taking sem on an invalid sem is EINVAL
So, use mllvdbg instead of mvdbg