M
Michael Poeltl
hi,
can anybody tell why this 'little stupid *thing* of code' let's python-3.2.2, 2.6.X or python 2.7.2 segfault?
.... if steps == 0:
.... pos = random.randint(-1,1)
.... if pos == 0:
.... return steps
.... steps += 2
.... pos += random.randint(-1,1)
.... return get_steps2(pos,steps)
........ print ( get_steps2() )
....
4
0
8
0
0
0
2
2
166
2
0
0
16
4
2
16
0
0
10
70
152
50
58
0
6
0
0
0
2
8
0
Segmentation fault
?>
funny, isn't it?
I was able to reproduce this segfault on various machines (32bit 64bit), ubuntu, slackware, debian
python.X segfaults on all of them
thx
Michael
can anybody tell why this 'little stupid *thing* of code' let's python-3.2.2, 2.6.X or python 2.7.2 segfault?
.... if steps == 0:
.... pos = random.randint(-1,1)
.... if pos == 0:
.... return steps
.... steps += 2
.... pos += random.randint(-1,1)
.... return get_steps2(pos,steps)
........ print ( get_steps2() )
....
4
0
8
0
0
0
2
2
166
2
0
0
16
4
2
16
0
0
10
70
152
50
58
0
6
0
0
0
2
8
0
Segmentation fault
?>
funny, isn't it?
I was able to reproduce this segfault on various machines (32bit 64bit), ubuntu, slackware, debian
python.X segfaults on all of them
thx
Michael