This project is read-only.
1

Closed

F# ImagePipeline throws IndexOutOfRangeException

description

Twice now when I’ve run the ImagePipeline sample I’ve had an IndexOutOfRangeException when I press the “stop” button. The exception is reraised but the stacktrace seems to indicate a problem here in BlockingMultiplexer.fs
 
                    let index = 
                       (producers |> Seq.filter (fun info -> info.Collection = waitList.[waitListIndex])
                                  |> Seq.map (fun info -> info.Index)).Single()
                    let lockId = lockOrderFn (!item)
 
Tomas, you might like to quickly review the translation from C#. Otherwise I guess it’s a bug in the original C# code.
Closed Sep 29, 2010 at 12:03 PM by AdeMiller
Fixed with changeset 54190.

comments

AdeMiller wrote Sep 7, 2010 at 7:40 PM

Doesn't repro on C# version.

AdeMiller wrote Sep 7, 2010 at 10:46 PM

I believe this might be a bug in the port.

The C# code
                    if (waitList.Length == 0)
                    {
                        if (token.IsCancellationRequested)
                            yield break;
                        else
                            throw new InvalidOperationException("Producer blocking collections omitted required value " +
                                nextLockId.ToString());
                    }
was ported into F# as
               if waitList.Length = 0 then
                   if token.IsCancellationRequested then 
                       yieldBreak := true
                   else
                       let msg = "Producer blocking collections omitted required value " + nextLockId.ToString()
                       raise (new InvalidOperationException(msg))
I think this is a bug because in F# you have allowed a loop to continue that should be terminated. (I think you need to add some kind of loop break or nonlocal exit to the F# so that you break out of the current iteration.)

AdeMiller wrote Sep 29, 2010 at 12:01 PM

The behavior I see is that the UI locks up.

wrote Sep 29, 2010 at 12:03 PM

wrote Feb 14, 2013 at 9:05 PM

wrote May 16, 2013 at 11:07 AM