Opened 6 years ago

Closed 6 years ago

#1459 closed defect (fixed)

segfault violation with thread-sleep! on a flonums

Reported by: kristianlm Owned by:
Priority: major Milestone: someday
Component: unknown Version: 5.0.0
Keywords: Cc:
Estimated difficulty:


When I run thread-sleep! under certain conditions, I get a segfault. I think this is a bug.

1944 klm@kth ~/p/e/c/tests  ➤ cat thread-sleep-segfault.scm 
(import srfi-18)

 (lambda () (thread-sleep! 2.1)))
1944 klm@kth ~/p/e/c/tests  ➤ csi5 -s thread-sleep-segfault.scm # works
1946 klm@kth ~/p/e/c/tests  ➤ csc5 thread-sleep-segfault.scm 
1947 klm@kth ~/p/e/c/tests  ➤ ./thread-sleep-segfault # works
1944 klm@kth ~/p/e/c/tests  ➤ csi5 thread-sleep-segfault.scm # fails
(c) 2008-2018, The CHICKEN Team
(c) 2000-2007, Felix L. Winkelmann
Version 5.0.0 (rev 4e1f1a7c)
linux-unix-gnu-x86-64 [ 64bit dload ptables ]

; loading thread-sleep-segfault.scm ...
; loading /home/klm/.chickens/master/lib/chicken5/9/ ...
; loading /home/klm/.chickens/master/lib/chicken5/9/ ...
; loading /home/klm/.chickens/master/lib/chicken5/9/ ...
Warning (#<thread: thread351>): in thread: segmentation violation

	Call history:

	<eval>	  (thread-sleep! 2.1)	<--

I've tried various values for thread-sleep!:

  • fixnums seem to work ok
  • some rational numbers seem to work
  • I don't think any inexact numbers work
  • 0.5 does not work
  • 1/2 works!
  • 1/3 does not work

If I add '(thread-sleep! 3)' at the end of the file, everything seems to work again. Maybe the repl is causing this?

Change History (2)

comment:1 Changed 6 years ago by kristianlm

I discovered that if you change the file to look like this:

2013 klm@kth ~/p/e/c/tests  ➤ cat thread-sleep-segfault.scm 
(import srfi-18 (only (chicken repl) repl))
 (lambda () (thread-sleep! 0.3)))

Then the segfault appears in all cases (csi -s, csi, csc).

comment:2 Changed 6 years ago by Kooda

Resolution: fixed
Status: newclosed

Fixed in 580d44f6c885872fe446ea263385b1fcd75eed5b

Note: See TracTickets for help on using tickets.