-
Notifications
You must be signed in to change notification settings - Fork 479
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
record: Fix crash when the root is not existed #1979
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your fix. It looks good but we have 3 calls to uftrace_shmem_root()
now. I think it's better to add a local variable for it.
Also I'm curious if your system doesn't have a temp directory at all. |
Thanks your reply!
The suggestion is good and I will check it again, so I will convert the issue to draft.
I have it, but many embed devices will use static |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can saved the result of uftrace_shmem_root()
instead.
But I'm curious if it works on a system without shmem..
Thanks, I will modify it
Sorry for my bad explain, I mean mostly embedded devices will use static |
This patch to fix crash when the root is not existed, due to some embed devices maybe not have it Signed-off-by: zyxeeker <zyxeeker@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This patch to fix crash when the root is not existed, due to some embed devices maybe not have it.
source:
My SOC do not have
/dev/shm/
andshmem_bufs
's value has not initialized, soscandir()
not flushshmem_bufs
and it has bad address, then bad thing happened:So I add
access()
to fix it: