python segfault

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top