John,
with creduce-latest + clang-3.2 I got the same crash in test #6.
Now I find crash-file in temporary directory in creduce/tests/
Crash-file attached.
Sorry, I not mention early why I try clang-latest + creduce-latest: at
first, to my fun :), and second, in hope to provide useful feedback to
your research group.
I do gcc-bug-hunting relatively rare and for each new one I try new
clang + new creduce :)
May be you find interesting [preliminary] comparison of
creduce-current with clang-3.2/3.4-trunk
1. comparison creduce/tests/run_tests
a) the same tests FAIL and PASS
b) test #6 crash with both clang's versions
c) elapsed time in seconds as run_tests reports
3.2 3.4-current
0: 922 207
1: 23 28
2: 928 212
3: 17 24
6: 2209 1048
2. comparison for real-world tasks:
results are identical with both versions of clang -- reductions hang
Thanks,
Dmitry
2013/6/8 John Regehr <[email protected]>:
> Hi Dmitry,
>
> I'm in the middle of some more C-Reduce changes right now. It might be best
> to not use the current version until things stabilize a bit.
>
>
>> -- tests 0..3 PASS
>> -- tests 4, 5, 7 FAIL with
>
>
> I'll look into this, thanks for letting us know.
>
>
>> 0. <eof> parser at end of file
>> sh: line 1: 23784 Segmentation fault (core dumped)
>> /home/dimhen/build/creduce/creduce/../clang_delta/clang_delta
>> --transformation=return-void --counter=1
>> /home/dimhen/tmp/creduce-WStouG/small.c > /tmp/file0I5kCp
>
>
> Right now we only develop and test using Clang 3.2, so we can't help you
> with crashes against the LLVM top of tree. It's super easy to download the
> 3.2 binary distribution and compile C-Reduce against it, so I'd ask you to
> just do that.
>
> I have not seen any hangs like you are seeing, but it could easily be that I
> have introduced new bugs lately. I'm still making some changes to the core
> of C-Reduce but will hopefully be done soon, and then I'll try to reproduce
> the problems you are seeing.
>
> John
extern int printf (const char *, ...);
static char safe_sub_func_int8_t_s_s ;
static char (safe_mul_func_int8_t_s_s) ;
static char safe_mod_func_int8_t_s_s ;
static char (safe_div_func_int8_t_s_s) ;
char safe_lshift_func_int8_t_s_s_left;
int safe_lshift_func_int8_t_s_s_right;
static char safe_lshift_func_int8_t_s_s( void ) {
return safe_lshift_func_int8_t_s_s_left < 0 || (safe_lshift_func_int8_t_s_s_right = 32) || (safe_lshift_func_int8_t_s_s_left > (127 >> (safe_lshift_func_int8_t_s_s_right))) ? safe_lshift_func_int8_t_s_s_left : (safe_lshift_func_int8_t_s_s_left < safe_lshift_func_int8_t_s_s_right);
}
static char (safe_lshift_func_int8_t_s_u) ;
char safe_rshift_func_int8_t_s_s_left;
int safe_rshift_func_int8_t_s_s_right;
static char safe_rshift_func_int8_t_s_s( void ) {
return safe_rshift_func_int8_t_s_s_left < 0 || ((safe_rshift_func_int8_t_s_s_right) = 32)? (safe_rshift_func_int8_t_s_s_left) : safe_rshift_func_int8_t_s_s_left >> safe_rshift_func_int8_t_s_s_right;
}
short safe_rshift_func_int16_t_s_s_left;
int safe_rshift_func_int16_t_s_s_right;
static short safe_rshift_func_int16_t_s_s( void ) {
return (safe_rshift_func_int16_t_s_s_left = 32) ? ((safe_rshift_func_int16_t_s_s_left)) : (safe_rshift_func_int16_t_s_s_left > safe_rshift_func_int16_t_s_s_right);
}
int safe_sub_func_int32_t_s_s_si1;
int safe_sub_func_int32_t_s_s_si2;
static int safe_sub_func_int32_t_s_s( void ) {
return (safe_sub_func_int32_t_s_s_si2 == 0 || (safe_sub_func_int32_t_s_s_si1 == (-9223372036854775807LL-1) && (safe_sub_func_int32_t_s_s_si2 == -1))) ? (safe_sub_func_int32_t_s_s_si1) : safe_sub_func_int32_t_s_s_si1 / safe_sub_func_int32_t_s_s_si2;
}
unsigned char safe_sub_func_uint8_t_u_u_ui1;
static unsigned char safe_sub_func_uint8_t_u_u( void ) {
unsigned char ui2 = 0;
return safe_sub_func_uint8_t_u_u_ui1 - ui2;
}
static unsigned char (safe_lshift_func_uint8_t_u_s) ;
unsigned char safe_lshift_func_uint8_t_u_u_left;
static unsigned char safe_lshift_func_uint8_t_u_u( void ) {
unsigned int right = 0;
return ((right) = 32) ? (safe_lshift_func_uint8_t_u_u_left) : (safe_lshift_func_uint8_t_u_u_left >> right);
}
unsigned short safe_sub_func_uint16_t_u_u_ui1;
unsigned short safe_sub_func_uint16_t_u_u_ui2;
static unsigned short safe_sub_func_uint16_t_u_u( void ) {
return safe_sub_func_uint16_t_u_u_ui1 - safe_sub_func_uint16_t_u_u_ui2;
}
unsigned short safe_lshift_func_uint16_t_u_s_left;
int safe_lshift_func_uint16_t_u_s_right;
static unsigned short safe_lshift_func_uint16_t_u_s( void ) {
return ((safe_lshift_func_uint16_t_u_s_right) = 32 || (safe_lshift_func_uint16_t_u_s_left > 65535 >> (safe_lshift_func_uint16_t_u_s_right))) ? (safe_lshift_func_uint16_t_u_s_left) : (safe_lshift_func_uint16_t_u_s_left < safe_lshift_func_uint16_t_u_s_right);
}
unsigned short safe_rshift_func_uint16_t_u_s_left;
static unsigned short safe_rshift_func_uint16_t_u_s( void ) {
int right = 0;
return (right < 0) || right >= 32 ? (safe_rshift_func_uint16_t_u_s_left) : safe_rshift_func_uint16_t_u_s_left > right;
}
static unsigned short safe_rshift_func_uint16_t_u_u ;
static unsigned safe_sub_func_uint32_t_u_u ;
static unsigned safe_div_func_uint32_t_u_u ;
int crc32_context;
unsigned int transparent_crc_val;
char * transparent_crc_vname;
int transparent_crc_flag;
static inline void transparent_crc ( void) {
if (transparent_crc_flag) printf ("%s %d\n", transparent_crc_vname, transparent_crc_val);
crc32_context += transparent_crc_val;
}
struct S0 {
unsigned f0 : 2;
const unsigned f1 : 15;
volatile unsigned f2 : 21;
unsigned f3 : 13;
const volatile unsigned f4 : 8;
};
struct S1 {
volatile short f0;
const unsigned f1 : 15;
volatile signed f2 : 26;
volatile signed f3 : 18;
volatile unsigned f4;
volatile unsigned char f5;
short f6;
unsigned f7;
};
struct U2 {
int f0;
int f1;
volatile unsigned short f3;
};
struct U3 {
const unsigned short f0;
long long f1;
};
struct U4 {
};
struct U5 {
unsigned f0 : 28;
};
struct U6 {
long long f0;
const unsigned short f1;
};
struct U7 ;
struct U8 {
unsigned f0;
char f4;
};
static struct U6 g_29[7] = {
};
static struct U8 g_30 ;
static char g_30_1;
static int g_34 = 0x77FC7DF3L;
static char g_43 = 0xC0L;
static int g_75 = -10L;
static unsigned char g_81 = 253UL;
static unsigned short g_89 = 0x5C78L;
static struct U6 g_97 ;
static long long g_97_0;
static volatile struct S1 g_105[5][6][7] ;
static volatile unsigned char g_105_1_4_3_5;
static struct U2 g_108 ;
static volatile unsigned short g_108_2;
static volatile struct U8 g_119 ;
static volatile unsigned int g_119_0;
static volatile char g_119_1;
static struct S0 g_129[1] ;
static unsigned int g_129_0_0;
static unsigned g_154 = 0x0EAA7C0EL;
static const short g_163 = 0x4AC5L;
static const short *g_162 = &g_163;
static char g_168 = 0x60L;
static volatile struct S1 g_171 ;
static volatile short g_171_0;
static struct S1 g_188 ;
static short g_188_6;
static unsigned int g_188_7;
static int g_200 = 0xEA005B03L;
static unsigned g_206 = 0xA8574855L;
static struct U8 *g_211 = &g_30;
static struct U8 ** volatile g_210 = &g_211;
static const volatile struct U3 g_212 ;
static volatile long long g_216 = 0xAD4DA4AE4061B3A2LL;
static volatile long long *g_215 = &g_216;
static volatile long long **g_214 = &g_215;
static volatile unsigned short g_220 = 0x7D69L;
static unsigned short g_240 = 65534UL;
static int *g_263 = &g_75;
static int ** const volatile g_262 = &g_263;
static int ** volatile g_331 = &g_263;
static volatile struct U2 g_332[10][5] ;
static struct U8 ** volatile g_375 = &g_211;
static struct U3 g_396 ;
static long long g_396_1;
static struct S0 g_415 ;
static volatile unsigned int g_415_2;
static char g_481 = 0x55L;
static struct U8 g_482 = {
4294967295UL,4294967295UL};
static int g_490 = 0x7DF2C22FL;
static struct U5 g_515 ;
static short g_648 = 1L;
static struct S0 g_657[8] ;
static const volatile unsigned int g_657_0_4;
static volatile unsigned int g_657_0_2;
static const unsigned int g_657_1_1;
static volatile unsigned g_669 = 1UL;
static volatile struct U5 g_691 ;
static volatile unsigned int g_691_0;
static volatile struct U5 g_800[9][3] ;
static volatile unsigned int g_800_0_0_0;
static unsigned long long g_820 = 5UL;
static unsigned short g_833 = 0UL;
static struct S0 g_869[10][7][3] = {
};
static const volatile unsigned int g_869_0_0_0_4;
static volatile struct S1 g_933[9][8] ;
static volatile short g_933_0_0_0;
static unsigned short g_951[1][9][6] = {
};
static unsigned short g_951_0_0_0;
static unsigned char g_976 = 0xF2L;
static struct S1 g_979 ;
static volatile unsigned char g_979_5;
static volatile unsigned int g_979_4;
static volatile int g_979_3;
static volatile int g_979_2;
static const unsigned int g_979_1;
static volatile short g_979_0;
static struct S1 g_996[9] ;
static short g_996_7_6;
static const struct U2 g_1217 ;
static const volatile unsigned short g_1217_2;
static struct S1 g_1224 ;
static volatile short g_1224_0;
static char g_1294[7] = {
1L, 1L, 0x1EL, 1L, 1L, 0x1EL, 1L};
static char g_1294_0 = 1L;
static int * volatile g_1379 = &g_200;
static const int g_1381 = 0x0785013FL;
static const volatile struct U5 g_1391[10][4] ;
static const volatile unsigned int g_1391_0_0_0;
static volatile int g_1445 = 9L;
static int * volatile g_1466 = &g_34;
static unsigned char g_1471 = 0xB2L;
static int g_1473 = -10L;
static unsigned char func_2(int p_3);
static const struct U2 func_8(char * p_9);
static char * func_11(struct U3 p_12);
static struct U3 func_14( void);
static struct U8 func_20( void);
static struct U6 func_26(void);
static long long func_56( void);
struct U8 __trans_tmp_1;
struct U6 __trans_tmp_2;
unsigned long long func_1_l_486 = 0x1C27A58C53145D30LL;
char *func_1_l_487 = &g_30_1;
char func_1_l_493 = 1L;
static unsigned char func_1(void) {
char *__trans_tmp_4;
unsigned char *l_1470 = &g_1471;
__trans_tmp_4 = func_11(func_14( ));
g_1473 ^= 251UL != (*l_1470 |= func_2((func_8(__trans_tmp_4) , -1L)));
(*g_1466) = ~((*g_1379) = *g_1379);
return g_171_0;
}
const unsigned short func_2_l_1228[9][6][4];
long long func_2_l_1297 = 0xDED5FD757C706F30LL;
struct U4 func_2_l_1461;
long long *func_2_l_1315 = &func_2_l_1297;
const int func_2_l_1357[6];
int func_2_i;
int func_2_j;
int func_2_k;
const int *func_2_l_1380 = &g_1381;
const int *const *func_2_l_1409[7][3] = {
&func_2_l_1380, &func_2_l_1380, &func_2_l_1380};
const int *const *func_2_l_1409_4_2;
const int *const *func_2_l_1409_2_2;
const int *const **func_2_l_1408[5][3][5] = {
{
&func_2_l_1409_2_2, 0, &func_2_l_1409_2_2, &func_2_l_1409_4_2, &func_2_l_1409_2_2
}
};
const char *const func_2_p_4;
const char * func_2_p_5;
int func_2_p_6;
unsigned long long func_2_p_7;
static unsigned char func_2(int p_3) {
if ((**g_375 , (0 | (g_1224 , func_2_p_6 | (p_3 >= *func_2_p_5) ^ func_2_l_1228[7][2][2])) <= g_81 , func_2_p_6))
if (p_3) {
for (g_240 = 0;
g_240 > 52;
g_200 -= 1) ;
const struct U5 *l_1369[1][1][3];
const struct U5 **l_1368[3][7] = {
&l_1369[0][0][2], &l_1369[0][0][2], &l_1369[0][0][2], &l_1369[0][0][2], &l_1369[0][0][2], &l_1369[0][0][2], &l_1369[0][0][2]
};
for (func_2_i = 0;
func_2_i < 1;
func_2_i++) {
for (func_2_j = 0;
func_2_j < 1;
func_2_j++)
for (func_2_k = 0;
func_2_k < 3;
func_2_k++) l_1369[func_2_i][func_2_j][func_2_k] = &g_515;
}
for (g_206 = 6;
g_206 >= 6;
++g_206) {
for (func_2_i = 0;
func_2_p_7 <= 5;
func_2_p_7 += 1)
if (func_2_p_7 < (func_2_p_7 != 0L == func_2_l_1357[0])) ;
}
(*g_1466) = ((p_3 && func_2_p_6 <= g_119_1) != g_657_1_1 > (func_2_p_7 < (safe_lshift_func_uint8_t_u_u( ) >= 0x1054CE9B4A3C4461LL)));
for (g_154 = 0;
g_154 < 2;
++g_154) ;
}
return g_105_1_4_3_5;
}
short *func_8_l_1122 = &g_996_7_6;
short **func_8_l_1121 = &func_8_l_1122;
int func_8_l_1129 = 0x7D65D460L;
unsigned long long func_8_l_1189[2];
unsigned long long func_8_l_1189_0;
int func_8_i;
short *func_8_l_1120 = 0;
short **func_8_l_1119 = &func_8_l_1120;
int func_8_l_1125 = 0L;
unsigned char func_8_l_1118 = 0UL;
unsigned short *func_8_l_1124 = &g_240;
char * func_8_p_10;
static const struct U2 func_8(char * p_9) {
for (func_8_i = 0;
func_8_i < 2;
func_8_i++) func_8_l_1189_0 = 0xA56689DD8B756094LL;
for (g_396_1 = 0;
;
g_396_1 = 0) {
for (g_979.f7 = 0;
;
g_979.f7 += 1) {
if (safe_rshift_func_uint16_t_u_s( )) {
for (g_820 = 0;
(g_820 <= 4);
g_820 += 1)
for (g_188_7 = 0;
g_188_7 <= 2;
g_188_7 += 1) ;
for (g_89 = 0;
g_89 <= 3;
g_89 += 1) {
int l_1161[5][6] = {
0x9ADD0850L, 1L, 0x9ADD0850L, 1L, 0x9ADD0850L, 1L
,
0x9ADD0850L, 1L, 0x9ADD0850L, 1L, 0x9ADD0850L, 1L
,
0x9ADD0850L, 1L, 0x9ADD0850L, 1L, 0x9ADD0850L, 1L
,
0x9ADD0850L, 1L, 0x9ADD0850L, 1L, 0x9ADD0850L, 1L
};
for (g_833 = 0;
g_833 <= 4;
g_833 += 1)
for (g_154 = 0;
g_154 <= 3;
g_154 += 1)
for (g_490 = 6;
g_490 >= 1;
g_490 -= 1)
for (func_8_l_1118 = 0;
func_8_l_1118 <= 3;
func_8_l_1118 += 1) {
int *l_1173[10] = {
&l_1161[4][2], &g_108.f1, &l_1161[4][2], &g_108.f1, &l_1161[4][2], &g_108.f1, &l_1161[4][2], &g_108.f1, &l_1161[4][2], &g_108.f1};
}
}
}
else
for (func_8_l_1129 = 0;
;
func_8_l_1129 += 1)
for (g_97_0 = 0;
;
g_97_0 += 1)
return g_332[g_979.f7 + 4][g_97_0];
}
}
return g_1217;
}
long long func_11_p_13;
static char * func_11(struct U3 p_12) {
if (g_415_2 || 0)
for (g_188_6 = (-4);
g_188_6 <= -2;
g_188_6++)
for (g_396_1 = 7;
g_396_1 >= 2;
g_396_1 -= 1)
for (g_481 = 6;
g_481 >= 2;
g_481 -= 1) ;
return &g_168;
}
unsigned char func_14_l_488 = 4UL;
int *func_14_l_489 = &g_490;
short func_14_p_15;
struct U6 func_14_p_16;
char *const func_14_p_17;
char * func_14_p_19;
static struct U3 func_14( void) {
int p_18 = 0;
*func_14_l_489 &= func_56( );
return g_212;
}
static struct U8 func_20( void) ;
static struct U6 func_26(void) ;
struct U6 __trans_tmp_3;
int *func_56_l_181 = &g_108.f0;
int *func_56_l_182 = &g_75;
int *func_56_l_183 = &g_34;
int func_56_l_197[3];
int func_56_l_290 = 0xE6A03987L;
int func_56_i;
int func_56_l_199 = 0xE241AC8AL;
int func_56_l_203 = 0x9FE1FDFEL;
int func_56_l_204 = (-1L);
int func_56_l_205 = 0L;
unsigned char func_56_l_238 = 0xD8L;
short func_56_l_213 = -1L;
long long *func_56_l_223 = 0;
unsigned short *func_56_l_239 = &g_240;
int func_56_l_241[3];
unsigned int func_56_p_57;
char * func_56_p_58;
static long long func_56( void) {
char l_288[1][4][8] = {
{
0x48L, (-9L), 0L, 0xACL, 0x4EL, 0xACL, 0L, -9L
,
0x48L, (-9L), 0L, 0xACL, 0x4EL, 0xACL, 0L, (-9L)
,
0x48L, -9L, 0L, 0xACL, 0x4EL, 0xACL, 0L, -9L
,
0x48L, -9L, 0L, 0xACL, 0x4EL, 0xACL, 0L, -9L
}
};
for (func_56_i = 0;
func_56_i < 3;
func_56_i++) func_56_l_197[func_56_i] = -6L;
lbl_358: *func_56_l_183 |= (g_171 , __trans_tmp_3 , 0x58ABL > safe_sub_func_uint8_t_u_u( ));
lbl_329: for (g_154 = 0;
g_154 < 23;
++g_154) {
if (7UL & func_56_p_57 | func_56_p_57) ;
else {
for (g_89 = 1;
g_89 <= 7;
g_89 += 1) {
if (!(func_56_l_213 &= (g_212 , func_56_p_57))) {
for (func_56_i = 0;
func_56_i < 3;
func_56_i++) func_56_l_241[func_56_i] = 0xB61E61F3L;
if ((g_220 != (safe_rshift_func_int8_t_s_s( )) == func_56_p_57))
*g_262 = ((func_56_p_57 ^ 0x452DL) , **g_210 , &g_200);
}
}
}
}
for (g_188_7 = -28;
g_188_7 > 1;
++g_188_7)
for (func_56_p_57 = 0;
func_56_p_57 <= 7;
func_56_p_57 += 1)
for (func_56_l_290 = 0;
func_56_l_290 <= 0;
func_56_l_290 += 1)
if (l_288[func_56_l_290][(func_56_l_290 + 1)][func_56_p_57]) {
for (g_81 = 0;
g_81 <= 7;
g_81 += 1)
*g_331 = &func_56_l_197[1];
for (g_81 = 0;
g_81 <= 9;
g_81 += 1)
if (g_108.f0) goto lbl_358;
for (g_34 = 6;
g_34 >= 1;
g_34 -= 1)
*func_56_l_183 ^= (*g_263);
}
return *func_56_l_183;
}
int main_i;
int main_j;
int main_k;
int main_print_hash_value = 0;
char ** main_argv;
int main (void) {
int argc = 0;
if (argc == 2 && 0 == 0) main_print_hash_value = 1;
func_1();
for (main_i = 0;
main_i < 7;
main_i++) {
transparent_crc( );
transparent_crc( );
}
transparent_crc( );
printf ("%d\n", g_34);
printf ("%d\n", g_108.f1);
transparent_crc( );
printf ("%d\n", g_119_0);
transparent_crc( );
for (main_i = 0;
main_i < 8;
main_i++)
transparent_crc( );
transparent_crc( );
printf ("%d\n", g_657_0_2);
transparent_crc( );
printf ("%d\n", g_657_0_4);
if (main_print_hash_value) printf("index = [%d]\n", main_i);
transparent_crc( );
transparent_crc( );
for (main_i = 0;
main_i < 9;
main_i++)
for (main_j = 0;
main_j < 3;
main_j++)
transparent_crc( );
if (main_print_hash_value) printf("index = [%d][%d]\n", main_i, main_j);
transparent_crc( );
transparent_crc( );
for (main_i = 0;
main_i < 10;
main_i++)
for (main_j = 0;
main_j < 7;
main_j++)
for (main_k = 0;
main_k < 3;
main_k++) {
transparent_crc( );
transparent_crc( );
if (main_print_hash_value) printf("index = [%d][%d][%d]\n", main_i, main_j, main_k);
}
for (main_i = 0;
main_i < 9;
main_i++)
for (main_j = 0;
main_j < 8;
main_j++)
transparent_crc( );
for (main_j = 0;
main_j < 9;
main_j++)
for (main_k = 0;
main_k < 6;
main_k++) {
transparent_crc( );
if (main_print_hash_value) printf("index = [%d][%d][%d]\n", main_i, main_j, main_k);
}
transparent_crc( );
printf ("%d\n", g_979_0);
printf ("%d\n", g_979_1);
transparent_crc( );
printf ("%d\n", g_979_3);
transparent_crc( );
printf ("%d\n", g_979_5);
printf ("%d\n", g_1217_2);
transparent_crc( );
for (main_i = 0;
main_i < 7;
main_i++)
printf ("%d\n", g_1294_0);
if (main_print_hash_value) printf;
for (main_i = 0;
main_i < 10;
main_i++)
for (main_j = 0;
main_j < 4;
main_j++)
transparent_crc( );
if (main_print_hash_value) printf("index = [%d][%d]\n", main_i, main_j);
printf ("%d\n", g_1445);
transparent_crc( );
transparent_crc( );
return 0;
}
// this should reproduce the crash:
// /home/dimhen/build/creduce/creduce/../clang_delta/clang_delta --transformation=return-void --counter=1 /home/dimhen/build/creduce/tests/tmp_test6_jFhr6/clang_delta_crash_tmp_fileBGGqON.c