Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

IEnumerable.Join Linq method gives incorrect result on Mono #183

Closed
ghost opened this issue Nov 29, 2013 · 4 comments
Closed

IEnumerable.Join Linq method gives incorrect result on Mono #183

ghost opened this issue Nov 29, 2013 · 4 comments
Labels

Comments

@ghost
Copy link

ghost commented Nov 29, 2013

I've been working on activating testing using tests/fsharp/core/... on non-Windows platforms

On Mono we get some failures in these query tests, these must be due to bugs in the mono runtime. (external to this repo but we have to isolate them and report them on the xamarin bug tracker)

Log below.

vagrant@vagrant-debian-wheezy:/vagrant/tests/fsharp/core$ mono --version
Mono JIT compiler version 3.0.10 ((no/eff4cb5 Fri Jun 7 06:45:28 EDT 2013)
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-proj
ect.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: Included Boehm (with typed GC and Parallel Mark)

vagrant@vagrant-debian-wheezy:/vagrant/tests/fsharp/core$ uname -a

Linux vagrant-debian-wheezy 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2+deb7u2 x86_64 GNU/Linux


FAILURE: queriesOverIEnumerable/test.fsx - test cnewnc06yh9Q4...failed, expected
[(4.2, 4.2); (1.0, 1.0)] got [(6.2, 6.2); (6.2, 9.2); (6.2, 1.0); (4.2, 4.2); (
9.2, 6.2); (9.2, 9.2);
(9.2, 1.0); (1.0, 1.0); (1.0, 6.2); (1.0, 9.2); (1.0, 1.0)]
FAILURE: queriesOverIEnumerable/test.fsx - test cnewnc06yh9Q8...failed, expected
[[]; ["Peter"]; []; ["Freddi"]; []] got [["Don"; "Freddy"; "Don"]; ["Peter"]; [
"Don"; "Freddy"; "Don"]; ["Freddi"];
["Don"; "Freddy"; "Don"]]
FAILURE: queriesOverIQueryable/test.fsx - test cnewnc06yh9Q4...failed, expected

    [(4.2, 4.2); (1.0, 1.0)]

got
[(6.2, 6.2); (6.2, 9.2); (6.2, 1.0); (4.2, 4.2); (9.2, 6.2); (9.2, 9.2);

(9.2, 1.0); (1.0, 1.0); (1.0, 6.2); (1.0, 9.2); (1.0, 1.0)]
FAILURE: queriesOverIQueryable/test.fsx - test cnewnc06yh9Q4...failed, expected

    [(4.2, 4.2); (1.0, 1.0)]

got
[(6.2, 6.2); (6.2, 9.2); (6.2, 1.0); (4.2, 4.2); (9.2, 6.2); (9.2, 9.2);

(9.2, 1.0); (1.0, 1.0); (1.0, 6.2); (1.0, 9.2); (1.0, 1.0)]
FAILURE: queriesOverIQueryable/test.fsx - test cnewnc06yh9Q8...failed, expected

    [[]; ["Peter"]; []; ["Freddi"]; []]

got
[["Don"; "Freddy"; "Don"]; ["Peter"]; ["Don"; "Freddy"; "Don"]; ["Freddi
"];
["Don"; "Freddy"; "Don"]]
FAILURE: queriesOverIQueryable/test.fsx - test rrcnewnc06yh9Q4...failed, expecte
d
[(4.2, 4.2); (1.0, 1.0)]
got
[(6.2, 6.2); (6.2, 9.2); (6.2, 1.0); (4.2, 4.2); (9.2, 6.2); (9.2, 9.2);

(9.2, 1.0); (1.0, 1.0); (1.0, 6.2); (1.0, 9.2); (1.0, 1.0)]
FAILURE: queriesOverIQueryable/test.fsx - test rrcnewnc06yh9Q8...failed, expecte
d
[[]; ["Peter"]; []; ["Freddi"]; []]
got
[["Don"; "Freddy"; "Don"]; ["Peter"]; ["Don"; "Freddy"; "Don"]; ["Freddi
"];
["Don"; "Freddy"; "Don"]]

@cdrnet
Copy link
Contributor

cdrnet commented Nov 29, 2013

Are you by chance using my vagrant image? Would it help if I create a new image with up-to-date mono-3.2.5 (instead of mono-3.0.10) to rule out things that have already been fixed on mono master in the meantime?

@ghost
Copy link
Author

ghost commented Nov 29, 2013

Yes! As you know I had emailed you asking for an update without knowing you'd posted here :) Thanks!

@ghost
Copy link
Author

ghost commented Nov 29, 2013

This is a bug in the Mono Join method implementation for IEnumerables when used with Nullables. Will check if its fixed in 3.2.5. Repro below (there will be a simpler repro)

open System
open System.Linq

type Customer(name:string, cost:float, quantity:Nullable<int>) = 
    member x.Name = name
    member x.Cost = cost
    member x.Quantity = quantity
let c1 = Customer( name="Don", cost=6.2, quantity=Nullable())
let c2 = Customer( name="Peter", cost=4.2, quantity=Nullable(10))

let db = [c1;c2]

db.Join(db,(fun i -> i.Quantity),(fun i -> i.Quantity),(fun i j -> (i.Cost, j.Cost))).ToArray()
// expect [(4.2, 4.2)]
// get  [(6.2, 6.2); (4.2, 4.2)]

@ghost
Copy link
Author

ghost commented Nov 30, 2013

Added as Mono bug https://bugzilla.xamarin.com/show_bug.cgi?id=16530

Closing as this is external

@ghost ghost closed this as completed Nov 30, 2013
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant