Menu

#24 Floating-point arithmetic error

open
nobody
None
5
2010-09-08
2010-09-08
Goblin
No

I have experienced crashes using the new lambdamoo-1.8.4 code
Using Valgrind, I have narrowed down my search for the bug to bf_random, which appears to have changed a lot since 1.8.2
After replacing the code with an old version of bf_random, the server runs smoothly...

Valgrind output:
==2776== Process terminating with default action of signal 8 (SIGFPE)
==2776== Integer divide by zero at address 0x62D63DB2
==2776== at 0x807CD22: bf_random (in /home/tim/v10/moo)
==2776== by 0x8071D8E: call_bi_func (in /home/tim/v10/moo)
==2776== by 0x8064C7E: run (in /home/tim/v10/moo)
==2776== by 0x806C57B: run_interpreter (in /home/tim/v10/moo)
==2776== by 0x806CB5C: do_server_verb_task (in /home/tim/v10/moo)
==2776== by 0x808D610: run_server_task (in /home/tim/v10/moo)
==2776== by 0x80882D5: main_loop (in /home/tim/v10/moo)
==2776== by 0x8088D52: main (in /home/tim/v10/moo)

Discussion

  • Goblin

    Goblin - 2010-09-16

    It appears to be doing this on random(0).. Any other case seems to do just fine...

     
  • Goblin

    Goblin - 2013-02-04

    In bf_random(), the test if argument is <= 0 should be placed earlier in the function.. It's an easy fix.

     

Log in to post a comment.