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

Fix: crm_simulate: Prevent segfault on arches with 64bit time_t #769

Merged
merged 2 commits into from
Aug 13, 2015

Conversation

gao-yan
Copy link
Member

@gao-yan gao-yan commented Aug 6, 2015

on an s390x system:

Program terminated with signal SIGSEGV, Segmentation fault.
#0 ha_set_tm_time (source=0x0, target=0xb188f960) at iso8601.c:1004
1004 if (source->tm_year > 0) {
(gdb) bt
#0 ha_set_tm_time (source=0x0, target=0xb188f960) at iso8601.c:1004
#1 crm_time_set_timet (target=0xb188f960, source=source@entry=0x3ffffa670a0) at iso8601.c:1037
#2 0x0000000080004f26 in get_date (data_set=0x3ffffa67218, data_set=0x3ffffa67218) at crm_simulate.c:72
#3 0x0000000080003d20 in main (argc=, argv=0x3ffffa67538) at crm_simulate.c:789

This commit fixes the cast in get_date() which would result in incorrect
values for arches with 64bit time_t

gao-yan added 2 commits August 6, 2015 13:10
on an s390x system:

 Program terminated with signal SIGSEGV, Segmentation fault.
 #0  ha_set_tm_time (source=0x0, target=0xb188f960) at iso8601.c:1004
 1004        if (source->tm_year > 0) {
 (gdb) bt
 #0  ha_set_tm_time (source=0x0, target=0xb188f960) at iso8601.c:1004
 ClusterLabs#1  crm_time_set_timet (target=0xb188f960, source=source@entry=0x3ffffa670a0) at iso8601.c:1037
 #2  0x0000000080004f26 in get_date (data_set=0x3ffffa67218, data_set=0x3ffffa67218) at crm_simulate.c:72
 #3  0x0000000080003d20 in main (argc=<optimized out>, argv=0x3ffffa67538) at crm_simulate.c:789

This commit fixes the cast in get_date() which would result in incorrect
values for arches with 64bit time_t
Once we need them, we should be careful.
beekhof added a commit that referenced this pull request Aug 13, 2015
Fix: crm_simulate: Prevent segfault on arches with 64bit time_t
@beekhof beekhof merged commit 85da495 into ClusterLabs:master Aug 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants