-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
core: glfsheal encounter a SIGSEGV in __strftime_internal #4240
base: devel
Are you sure you want to change the base?
Conversation
Can one of the admins verify this patch? |
2 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
CLANG-FORMAT FAILURE: index 1c95411a2..54d9a7186 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -1299,7 +1299,7 @@ afr_mark_split_brain_source_sinks_by_policy(
"Invalid child (%d) "
"selected by policy %s.",
fav_child, policy_str);
- return -1;
+ return -1;
} else if (fav_child >= 0) {
time = replies[fav_child].poststat.ia_mtime;
tm_ptr = localtime(&time); |
@GeorgeLjz what is the value of fav_child in crash? Can you please share "thread apply all bt full" data from the coredump here? |
|
I remember that the value of fav_child is something bigger than 80000000, and priv->child_count is 0 when I begin debug this issue, so I suppose I find the root cause for this crash, but after I re-open the coredump file, it seems the value of fav_child became normal with 0, and priv->child_count is 2, so I need re-investigate this issue, sorry for it. |
from the latest investigation, the negative value of replies[fav_child].poststat.ia_ctime=-8580258564328249088 |
glfsheal encounter a SIGSEGV in __strftime_interna called from afr_mark_split_brain_source_sinks_by_policy Root cause: ctime is negative Solution: change ctime to 0 when ctime is negative before strftime Fixes: gluster#4239 Change-Id: If6a356db60298da39a48c7979abdfbac03521aa7
} else if (fav_child >= 0) { | ||
time = replies[fav_child].poststat.ia_mtime; | ||
if (time < 0) { |
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 instead of putting a check on time value we should try to figure out why ia_mtime < 0, The glfsheal you are using is old(release-7) and the latest code is completely changed so i am not sure it is a right way to fix the issue.
@pranithk @karthik-us Can you please share your view on the same.
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.
figure out why ia_mtime or ia_ctime <0 maybe not so easy, but when one of the values is negative, it will make "Segmentation fault" with strftime call, and in the latest glusterfs code, it also has not the protection for it, so I suggest the protection maybe a work-around for this issue.
glfsheal encounter a SIGSEGV in __strftime_interna called from afr_mark_split_brain_source_sinks_by_policy
Root cause: mis-compare between the int and unisgned int
Solution: convert the compare between 2 ints
Fixes: #4239
Change-Id: If6a356db60298da39a48c7979abdfbac03521aa7