Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paket crashes with Null Ref Exception for MBrace #923

Closed
isaacabraham opened this issue Jul 14, 2015 · 14 comments
Closed

Paket crashes with Null Ref Exception for MBrace #923

isaacabraham opened this issue Jul 14, 2015 · 14 comments

Comments

@isaacabraham
Copy link
Contributor

Having a paket.dependencies file with:

source https://www.nuget.org/api/v2
nuget MBrace.Azure -pre

Causes the following NRE and full crash with paket 1.19.0.0 (full crash = windows crash dialog appears).

λ .paket\paket install
Resolving packages:
 - MBrace.Azure 0.6.10-alpha

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at Paket.utils.zipOpt[a,b](FSharpList`1 l1, FSharpList`1 l2)
   at Paket.PreRelease.System-IComparable-CompareTo(Object yobj)
   at Paket.VersionRequirement.CompareTo(Object obj, IComparer comp)
   at Microsoft.FSharp.Collections.SetTreeModule.mem[T](IComparer`1 comparer, T k, SetTree`1 t)
   at [email protected](IEnumerable`1& next)
   at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl()
   at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
   at Paket.NuGetV2.GetPackageDetails(String root, Boolean force, FSharpList`1 sources, PackageName packageName, SemVerInfo version)
   at <StartupCode$Paket-Core>[email protected](FSharpList`1 sources, PackageName packageName, SemVerInfo version)
   at Paket.PackageResolver.getExploredPackage@155(FSharpList`1 globalFrameworkRestrictions, FSharpFunc`2 getPackageDetailsF, Dictionary`2 exploredPackages, PackageRequirement dependency, SemVerInfo version)
   at [email protected](SemVerInfo versionToExplore)
   at Microsoft.FSharp.Collections.ListModule.loop@142-20[T,TState](FSharpFunc`3 f, TState s, FSharpList`1 xs)
   at Paket.PackageResolver.step@199(FSharpList`1 globalFrameworkRestrictions, FSharpFunc`2 getVersionsF, FSharpFunc`2 getPackageDetailsF, Dictionary`2 exploredPackages, Dictionary`2 allVersions, Dictionary`2 conflictHistory, FSharpMap`2 filteredVersions, FSharpList`1 selectedPackageVersions, FSharpSet`1 closedRequirements, FSharpSet`1 openRequirements)
   at Paket.PackageResolver.Resolve(FSharpFunc`2 getVersionsF, FSharpFunc`2 getPackageDetailsF, FSharpList`1 globalFrameworkRestrictions, FSharpList`1 rootDependencies)
   at Paket.DependenciesFile.Resolve(FSharpFunc`2 getSha1, FSharpFunc`2 getVersionF, FSharpFunc`2 getPackageDetailsF)
   at Paket.UpdateProcess.SelectiveUpdate(DependenciesFile dependenciesFile, Boolean updateAll, FSharpOption`1 exclude, Boolean force)
   at Paket.UpdateProcess.SmartInstall(String dependenciesFileName, Boolean updateAll, FSharpOption`1 exclude, UpdaterOptions options)
   at <StartupCode$Paket-Core>[email protected](Unit unitVar0)
   at Paket.Utils.RunInLockedAccessMode[a](String rootFolder, FSharpFunc`2 action)
   at [email protected](ArgParseResults`1 results)
   at Paket.Program.processWithValidation[T](FSharpFunc`2 validateF, FSharpFunc`2 commandF, Command command, String[] args)
   at [email protected](Command command, String[] args)
   at Paket.Program.main()
   at <StartupCode$paket>.$Paket.Program.main@()
@baronfel
Copy link
Contributor

my bad! I'm working on a fix right now.

@isaacabraham
Copy link
Contributor Author

ok cool. this also affects update as well.

@baronfel
Copy link
Contributor

i couldn't find an implementation of 'zip two lists of differing sizes with None extending the shorter one' when I was implementing this. Any ideas where to find one, instead of relying on my hand-rolled implementation?

@isaacabraham
Copy link
Contributor Author

can you post a link to the code in paket where you're doing this?

@baronfel
Copy link
Contributor

https://github.com/fsprojects/Paket/blob/master/src/Paket.Core/SemVer.fs#L6

prereleases are compared segment by segment, and if one set of segments is longer than the other, the longer list is greater.

@baronfel
Copy link
Contributor

very odd. I can't seem to repro on my end, Isaac. I'm able to both install and update given the spec you provide.

@forki
Copy link
Member

forki commented Jul 14, 2015

I can reproduce.

@isaacabraham
Copy link
Contributor Author

Hmmm. Why do we have some people with different outputs here.

@isaacabraham
Copy link
Contributor Author

And where is the NRE occurring?

@baronfel
Copy link
Contributor

it's somewhere in the zipopt function, but I haven't been able to make that fail in some local testing I've been doing just now. my guess would be on the List.nth calls?

@forki
Copy link
Member

forki commented Jul 14, 2015

I think it's outside of zipopt.

forki added a commit that referenced this issue Jul 14, 2015
@forki forki closed this as completed in 07d0336 Jul 14, 2015
@forki
Copy link
Member

forki commented Jul 14, 2015

this is really weird. I can't reproduce after update -f.

I added a bit of null checks anyway. Does it help?

@baronfel
Copy link
Contributor

yeah, that's about as far as I got in my tests too. Quite odd all around.

@forki
Copy link
Member

forki commented Jul 14, 2015

yeah after thinking about it.
The error is probably that we didn't increased the cache format version (JSON file format)

will do that now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants