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

[NBug] Crashing on startup when no submodule present #8366

Closed
mwkinney opened this issue Jul 30, 2020 · 17 comments · Fixed by #9819
Closed

[NBug] Crashing on startup when no submodule present #8366

mwkinney opened this issue Jul 30, 2020 · 17 comments · Fixed by #9819

Comments

@mwkinney
Copy link

Current behaviour

Git Extensions crashes on startup with some repos, but not others. Appears to be due to no submodules being present.

Expected behaviour

Git Extensions starts up with all repos without crashing.

Steps to reproduce

Open a repo with no submodules, it may crash.

Error Details

System.NullReferenceException: Object reference not set to an instance of an object.
   at GitUI.BranchTreePanel.RepoObjectsTree.SubmoduleTree.CreateSubmoduleNodes(IEnumerable`1 submodules, GitModule threadModule, List`1& nodes)
   at GitUI.BranchTreePanel.RepoObjectsTree.SubmoduleTree.FillSubmoduleTree(SubmoduleInfoResult result)
   at GitUI.BranchTreePanel.RepoObjectsTree.SubmoduleTree.<LoadNodesAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at GitUI.BranchTreePanel.RepoObjectsTree.Tree.<ReloadNodesAsync>d__28.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at GitUI.BranchTreePanel.RepoObjectsTree.SubmoduleTree.<>c__DisplayClass4_0.<<OnStatusUpdated>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at GitUI.ThreadHelper.<>c__DisplayClass13_0.<<FileAndForget>b__0>d.MoveNext()

Additional information

Crashing caused by what I believe is no submodules being present. This crash doesn't occur with older versions of Git Extensions (2.48.05).

Environment

  • Git Extensions 3.4.3.9999
  • Build d4b0f48
  • Git 2.28.0.windows.1
  • Microsoft Windows NT 10.0.19041.0
  • .NET Framework 4.8.4180.0
  • DPI 96dpi (no scaling)
@duplicates-detector-bot

This comment has been minimized.

@mwkinney mwkinney changed the title [NBug] Object reference not set to an instance of an object. [NBug] Crashing on startup with object reference not set to an instance of an object. Jul 30, 2020
@mwkinney mwkinney changed the title [NBug] Crashing on startup with object reference not set to an instance of an object. [NBug] Crashing on startup when no submodule present Jul 30, 2020
@duplicates-detector-bot
Copy link

Potential duplicates:

  • #6758

@mwkinney
Copy link
Author

mwkinney commented Aug 4, 2020

It's worth mentioning that the older version that works fine 2.48.05 pops this up often. 2.48.05 doesn't crash no matter what is selected off this pop up.
image

@RussKie
Copy link
Member

RussKie commented Oct 4, 2020

@gerhardol do you think you can look at this?

@gerhardol gerhardol self-assigned this Oct 4, 2020
@gerhardol gerhardol added the 📭 needs: author feedback More info/confirmation awaited from OP; issues typically get closed after 30 days of inactivity label Oct 4, 2020
@gerhardol
Copy link
Member

I cannot reproduce, I tried with single submodule lost, all lost or no submodules at all.
Same for latest release and latest master (few chances in this area.)
Please describe a repo to reproduce with.

For the popup to prompt to update submodules at checkout, this is not changed from 2.x. You may control the popup in settings:

image

@RussKie RussKie closed this as completed Oct 4, 2020
@mwkinney
Copy link
Author

I was able to resolve this issue by removing the following from my .gitmodules file. The directories didn't exist on my machine, and the branch wasn't local. I'm not sure if having both would've prevented the startup crash or not. For me, I'm on a large team and everyone is using GE 2.48.05 due to the crash. Hopefully this helps.

[submodule "C:/Project/x/y"]
path = C:/Project/x/y
url = C:/Project/x/y
branch = release/201705

@ghost ghost removed the 📭 needs: author feedback More info/confirmation awaited from OP; issues typically get closed after 30 days of inactivity label Sep 29, 2021
@mwkinney
Copy link
Author

Asking @RussKie or @gerhardol to reopen based on my new findings.

@vbjay
Copy link
Contributor

vbjay commented Sep 29, 2021 via email

@mwkinney
Copy link
Author

I certainly can. I just thought being this was a real-world example of a breaking change in GE beyond 2.48.05 that it would want to be addressed somehow to handle it more gracefully. It wasn't obvious to me what the issue was, and outright prevented using GE. If it's classified user-error, then accept my apologies.

@gerhardol
Copy link
Member

I was able to resolve this issue by removing the following from my .gitmodules file. The directories didn't exist on my machine, and the branch wasn't local. I'm not sure if having both would've prevented the startup crash or not. For me, I'm on a large team and everyone is using GE 2.48.05 due to the crash. Hopefully this helps.

2.48 is not even the latest 2.x release, any specific reason to stay on that release?
(I assume you are using Mono.)
There are no 2.x releases planned by the core team, no Mono users (a reason to why it was impossible to maintain Mono), but contributions could be merged. I doubt this problem wold be considered important enough though.

@vbjay
Copy link
Contributor

vbjay commented Sep 29, 2021 via email

@mwkinney
Copy link
Author

mwkinney commented Sep 29, 2021

I'm on 3.5.4.12724. What I'm saying is that my team has been on 2.48.05 for years now due to this startup crash. This is what I had to do to resolve it. Neither git CLI or SourceTree had a problem with the repo on any of their releases.

@vbjay Got you now. Yes, I did try yes on that menu but it didn't change the outcome (menu presenting on 2.48.05, or crashing on any newer release).

@RussKie
Copy link
Member

RussKie commented Sep 29, 2021 via email

@mwkinney
Copy link
Author

If I knew what the issue was exactly I'd be happy to do that but I don't know how to reproduce it other than what I've provided here and I can't take the risk of cutting down our production repo and passing that along (in case I make a mistake and leave something, I'd be fired and then sued).

I'm good on my side, just like the software and wanted to help fix whatever was going on in case other users run into it, and promptly uninstall. But if it's not enough information, I understand and it's really up to the developers. We can leave this closed out. Thanks for checking in on my update!

@pmiossec
Copy link
Member

For me, I'm on a large team and everyone is using GE 2.48.05 due to the crash.

@mwkinney If the issue is fixed, will your company (with such a large team) do a good donation to the GitExtensions project for allowing it to upgrade to the last version with tons of great features that will improve the whole team their day to day workflow and efficiency? 😁

@mwkinney
Copy link
Author

@pmiossec If it were fixed I'd certainly ask. I'm in charge of nothing though. I pushed the .gitmodules change to our repo so everyone can now after years update. It's a multilayered contractor situation and I'm on the bottom of it all. But the larger partner on top is a very large corporation out of California that everyone knows of.

I was really trying to help the project with a bug report and other users past/present/future that ran into the same issue. Like I said, SourceTree handled it fine, GE 2.x worked fine. For me, if this is software that I were in charge of, I'd want whatever the issue was, handled more gracefully. But I'm sure most of these type of reports (especially when you can't easily reproduce the issue, though I assume many here already know the issue), aren't easily reproducible.

I'm mostly a web guy but I'm capable of digging in and submitting a PR. I don't do that with projects because you can do the work and zero guarantee it's accepted. Or, projects reject it and end up doing it themselves.

I just thought I'd spend a few minutes reporting it, because I know that I would want to know. I appreciate this team and the software created.

@pmiossec
Copy link
Member

pmiossec commented Sep 30, 2021

I was just asking because I have a fix 🤣 I will create a PR tomorrow.

I was really trying to help the project with a bug report and other users past/present/future that ran into the same issue.

What you did was good and thanks for the help. That's just that like you could see, your issue did had a lot of traction because it is highly possible that you're nearly the only one having this problem.

And solving this type of issue is really time consuming and most of the time end up being something badly configured or whatever else specific to the computer of the user. This is the type of bugs where the one encountering it is the best placed to fix it or at least debug it.
So it is comprehensible that the few hours that an opensource developer has are spent on something bringing more added value...

@ghost ghost added the 🚧 status: in progress Issues which have associated PRs label Oct 3, 2021
@ghost ghost removed the 🚧 status: in progress Issues which have associated PRs label Jan 10, 2022
@ghost ghost added the 🚧 status: in progress Issues which have associated PRs label Jan 15, 2022
@ghost ghost removed the 🚧 status: in progress Issues which have associated PRs label Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment