help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] [bug] Delay issue


From: Gwenaël Casaccio
Subject: Re: [Help-smalltalk] [bug] Delay issue
Date: Tue, 31 Jan 2012 21:32:08 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111229 Thunderbird/9.0

On 31/01/2012 10:19, Paolo Bonzini wrote:
On 01/28/2012 07:56 PM, Ladislav Marek wrote:
Hi,

after this change, code:

5 timesRepeat: [
[(Delay forSeconds: 2) value: [] onTimeoutDo: [Error signal]] fork].
Processor activeProcess suspend.

I fixed this and will push soon:

diff --git a/kernel/Delay.st b/kernel/Delay.st
index a77da53..40298cc 100644
--- a/kernel/Delay.st
+++ b/kernel/Delay.st
@@ -143,9 +143,10 @@ created.'>
         | activeDelay |
     activeDelay := self activeDelay.
     activeDelay isNil ifTrue: [^self].
+    activeDelay == aDelay
+        ifTrue: [Queue removeLast]
+        ifFalse: [Queue identityRemove: aDelay ifAbsent: []].
     aDelay reset.
-    activeDelay == aDelay ifTrue: [^Queue removeLast].
-    Queue identityRemove: aDelay ifAbsent: [].
     ]

     Delay class >> startDelayLoop [

However I cannot reproduce the problem.

Paolo



_______________________________________________
help-smalltalk mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-smalltalk

I've tried the change you propose before but I had this problem:

Eval [
    | d1 d2 p1 p2 |
    sem := Semaphore new.
    d1 := Delay forSeconds: 1.
    p1 := [ d1 value: [ sem signal ] onTimeoutDo: [ ] ] fork.
    sem wait.

    'value:onTimeoutDo:' displayNl.
    d1 := Delay forMilliseconds: 100.
    d1 value: [ [ true ] whileTrue ] onTimeoutDo: [ ].
]

The vm abort when it checks the process list state (if it's finished). Maybe can you enlight me about that bug ?

#0 0x00007ffff77963a5 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007ffff7799b0b in __GI_abort () at abort.c:92
#2  0x00007ffff7b642ec in _gst_check_process_state () at interp.c:2086
#3 0x00007ffff7b70de6 in _gst_nvmsg_send (receiver=0x7f7061d2f3e0, sendSelector=0x7f7061d3d340, args=<optimized out>, sendArgs=1) at interp.c:2349 #4 0x00007ffff7b47a1b in _gst_va_msg_sendf (resultPtr=0x0, fmt=0x7ffff7b8614e "%v %o changed: %S", ap=0x7fffffffd7a8) at callin.c:305 #5 0x00007ffff7b48557 in _gst_msg_sendf (resultPtr=<optimized out>, fmt=<optimized out>) at callin.c:380 #6 0x00007ffff7b1fb07 in invoke_hook_smalltalk (hook=<optimized out>) at comp.c:485
#7  _gst_invoke_hook (hook=<optimized out>) at comp.c:496
#8 0x00007ffff7b231de in _gst_execute_statements (receiverOOP=0x7f7061d2e000, method=<optimized out>, undeclared=<optimized out>, quiet=true) at comp.c:673 #9 0x00007ffff7b1439d in execute_doit (p=0x7fffffffddd0, temps=0x61bc50, stmts=0x61c0a0, receiverOOP=0x7f7061d2e000, undeclared=true, quiet=false) at gst-parse.c:604 #10 0x00007ffff7b1554e in parse_eval_definition (p=0x7fffffffddd0) at gst-parse.c:762 #11 0x00007ffff7b16bbe in parse_scoped_definition (first_stmt=0x61bbd0, p=0x7fffffffddd0) at gst-parse.c:675 #12 parse_doit (p=0x7fffffffddd0, fail_at_eof=<optimized out>) at gst-parse.c:636
#13 0x00007ffff7b17281 in parse_chunks (p=0x7fffffffddd0) at gst-parse.c:486
#14 0x00007ffff7b17762 in _gst_parse_chunks (currentNamespace=<optimized out>) at gst-parse.c:461 #15 0x00007ffff7b192b2 in _gst_parse_stream (currentNamespace=0x0) at lex.c:1208 #16 0x00007ffff7b4429e in _gst_process_file (fileName=<optimized out>, dir=<optimized out>) at input.c:844 #17 0x0000000000401167 in main (argc=<optimized out>, argv=<optimized out>) at main.c:401





reply via email to

[Prev in Thread] Current Thread [Next in Thread]