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

Index was outside the bounds of the array #1241

Closed
smulikHakipod opened this Issue Sep 28, 2017 · 6 comments

Comments

Projects
None yet
3 participants
@smulikHakipod
Copy link

smulikHakipod commented Sep 28, 2017

GitHub extension version: 2.3.3.38
Visual studio version: 15.3.5

When I am opening a specific pull request from our GitHub Enterprise appliance I am getting this error in the UI.

image

System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at GitHub.Models.DiffUtilities.<ParseFragment>d__1.MoveNext() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.Exports\Models\DiffUtilities.cs:line 0
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at GitHub.InlineReviews.Services.DiffService.<Diff>d__2.MoveNext() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.InlineReviews\Services\DiffService.cs:line 31
--- 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 GitHub.InlineReviews.Services.PullRequestSessionService.<Diff>d__7.MoveNext() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.InlineReviews\Services\PullRequestSessionService.cs:line 51
--- 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 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at GitHub.InlineReviews.Services.PullRequestSession.<UpdateFile>d__16.MoveNext() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.InlineReviews\Services\PullRequestSession.cs:line 200
--- 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 GitHub.InlineReviews.Services.PullRequestSession.<CreateFile>d__17.MoveNext() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.InlineReviews\Services\PullRequestSession.cs:line 234
--- 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 GitHub.InlineReviews.Services.PullRequestSession.<GetFile>d__9.MoveNext() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.InlineReviews\Services\PullRequestSession.cs:line 86
--- 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 GitHub.InlineReviews.Services.PullRequestSession.<GetFile>d__8.MoveNext() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.InlineReviews\Services\PullRequestSession.cs:line 67
--- 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 GitHub.ViewModels.PullRequestDetailViewModel.<CreateChangedFilesTree>d__104.MoveNext() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.App\ViewModels\PullRequestDetailViewModel.cs:line 523
--- 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 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at GitHub.ViewModels.PullRequestDetailViewModel.<Load>d__100.MoveNext() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.App\ViewModels\PullRequestDetailViewModel.cs:line 389    at GitHub.Models.DiffUtilities.<ParseFragment>d__1.MoveNext() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.Exports\Models\DiffUtilities.cs:line 0
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at GitHub.InlineReviews.Services.DiffService.<Diff>d__2.MoveNext() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.InlineReviews\Services\DiffService.cs:line 31
--- 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 GitHub.InlineReviews.Services.PullRequestSessionService.<Diff>d__7.MoveNext() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.InlineReviews\Services\PullRequestSessionService.cs:line 51
--- 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 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at GitHub.InlineReviews.Services.PullRequestSession.<UpdateFile>d__16.MoveNext() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.InlineReviews\Services\PullRequestSession.cs:line 200
--- 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 GitHub.InlineReviews.Services.PullRequestSession.<CreateFile>d__17.MoveNext() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.InlineReviews\Services\PullRequestSession.cs:line 234
--- 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 GitHub.InlineReviews.Services.PullRequestSession.<GetFile>d__9.MoveNext() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.InlineReviews\Services\PullRequestSession.cs:line 86
--- 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 GitHub.InlineReviews.Services.PullRequestSession.<GetFile>d__8.MoveNext() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.InlineReviews\Services\PullRequestSession.cs:line 67
--- 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 GitHub.ViewModels.PullRequestDetailViewModel.<CreateChangedFilesTree>d__104.MoveNext() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.App\ViewModels\PullRequestDetailViewModel.cs:line 523
--- 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 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at GitHub.ViewModels.PullRequestDetailViewModel.<Load>d__100.MoveNext() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.App\ViewModels\PullRequestDetailViewModel.cs:line 389

Thanks!

@jcansdale

This comment has been minimized.

Copy link
Collaborator

jcansdale commented Oct 4, 2017

Hi @smulikHakipod,

Thanks for the report and stack trace!

Could you try doing the same again with this build:
GitHub.VisualStudio-2.3.3.41-Debug.zip

It appears it's attempting to parse some malformed diff text. I'd like to see what it looks like before I blindly fix it. This build should add the diff to the exception message.

Regards, Jamie.

@jcansdale

This comment has been minimized.

Copy link
Collaborator

jcansdale commented Oct 11, 2017

@smulikHakipod, I was wondering if you're still seeing this issue? We'd like to fix it! 😄

@smulikHakipod

This comment has been minimized.

Copy link
Author

smulikHakipod commented Oct 11, 2017

Hey,
Yes I am seeing the messages. I am sorry for not responding, its the holidays right now in Israel.
The new exception:

System.IndexOutOfRangeException: "diff --git a/Collectors/src/OutlookExecutable/MAPIOID.h b/Collectors/src/OutlookExecutable/MAPIOID.h
new file mode 100644
index 0000000..fbfcaa1
--- /dev/null
+++ b/Collectors/src/OutlookExecutable/MAPIOID.h
@@ -0,0 +1,106 @@
+/*
+ *  M A P I O I D . H
+ *
+ *  MAPI OID definition header file
+ *
+ *  Copyright (c) 2009 Microsoft Corporation. All Rights Reserved.

+ */
+
+#ifndef _MAPIOID_
+#define _MAPIOID_
+
+/*
+ *  MAPI 1.0 Object Identifiers (OID's)
+ *
+ *  All MAPI 1.0 OIDs are prefixed by the segment
+ *
+ *      {iso(1) ansi(2) usa(840) microsoft(113556) mapi(3)}
+ *
+ *  All MAPI 1.0 tags are also include the addistion segment
+ *
+ *      {tags(10)}
+ *
+ *  All MAPI 1.0 encodings are also include the addistion segment
+ *
+ *      {encodeings(11)}
+ *
+ *  The set of defined tags are as follows
+ *
+ *   {{mapiprefix} {tags} {tnef(1)}}                        MAPI 1.0 TNEF encapsulation tag
+ *
+ *   {{mapiprefix} {tags} {ole(3)}}                         MAPI 1.0 OLE prefix
+ *   {{mapiprefix} {tags} {ole(3)} {v1(1)}}                 MAPI 1.0 OLE 1.0 prefix
+ *   {{mapiprefix} {tags} {ole(3)} {v1(1)} {storage(1)}}    MAPI 1.0 OLE 1.0 OLESTREAM
+ *   {{mapiprefix} {tags} {ole(3)} {v2(2)}}                 MAPI 1.0 OLE 2.0 prefix
+ *   {{mapiprefix} {tags} {ole(3)} {v2(2)} {storage(1)}}    MAPI 1.0 OLE 2.0 IStorage
+ *
+ *  The set of defined encodings are as follows
+ *
+ *   {{mapiprefix} {encodings} {MacBinary(1)}}              MAPI 1.0 MacBinary
+ */
+
+#define OID_TAG         0x0A
+#define OID_ENCODING    0x0B
+
+#define DEFINE_OID_1(name, b0, b1) \
+    EXTERN_C const BYTE name[]
+
+#define DEFINE_OID_2(name, b0, b1, b2) \
+    EXTERN_C const BYTE name[]
+
+#define DEFINE_OID_3(name, b0, b1, b2, b3) \
+    EXTERN_C const BYTE name[]
+
+#define DEFINE_OID_4(name, b0, b1, b2, b3, b4) \
+    EXTERN_C const BYTE name[]
+
+#define CB_OID_1        9
+#define CB_OID_2        10
+#define CB_OID_3        11
+#define CB_OID_4        12
+
+#ifdef INITOID
+#include <initoid.h>
+#endif
+
+#ifdef  USES_OID_TNEF
+DEFINE_OID_1(OID_TNEF, OID_TAG, 0x01);
+#define CB_OID_TNEF CB_OID_1
+#endif
+
+#ifdef  USES_OID_OLE
+DEFINE_OID_1(OID_OLE, OID_TAG, 0x03);
+#define CB_OID_OLE CB_OID_1
+#endif
+
+#ifdef  USES_OID_OLE1
+DEFINE_OID_2(OID_OLE1, OID_TAG, 0x03, 0x01);
+#define CB_OID_OLE1 CB_OID_2
+#endif
+
+#ifdef  USES_OID_OLE1_STORAGE
+DEFINE_OID_3(OID_OLE1_STORAGE, OID_TAG, 0x03, 0x01, 0x01);
+#define CB_OID_OLE1_STORAGE CB_OID_3
+#endif
+
+#ifdef  USES_OID_OLE2
+DEFINE_OID_2(OID_OLE2, OID_TAG, 0x03, 0x02);
+#define CB_OID_OLE2 CB_OID_2
+#endif
+
+#ifdef  USES_OID_OLE2_STORAGE
+DEFINE_OID_3(OID_OLE2_STORAGE, OID_TAG, 0x03, 0x02, 0x01);
+#define CB_OID_OLE2_STORAGE CB_OID_3
+#endif
+
+#ifdef  USES_OID_MAC_BINARY
+DEFINE_OID_1(OID_MAC_BINARY, OID_ENCODING, 0x01);
+#define CB_OID_MAC_BINARY CB_OID_1
+#endif
+
+#ifdef  USES_OID_MIMETAG
+DEFINE_OID_1(OID_MIMETAG, OID_TAG, 0x04);
+#define CB_OID_MIMETAG CB_OID_1
+#endif
+
+#endif
"
   at GitHub.Models.DiffUtilities.<ParseFragment>d__1.MoveNext() in C:\source\github.com\github\VisualStudio\src\GitHub.Exports\Models\DiffUtilities.cs:line 52
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at GitHub.InlineReviews.Services.DiffService.<Diff>d__2.MoveNext() in C:\source\github.com\github\VisualStudio\src\GitHub.InlineReviews\Services\DiffService.cs:line 35
--- 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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at GitHub.InlineReviews.Services.PullRequestSessionService.<Diff>d__7.MoveNext() in C:\source\github.com\github\VisualStudio\src\GitHub.InlineReviews\Services\PullRequestSessionService.cs:line 58
--- 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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at GitHub.InlineReviews.Services.PullRequestSession.<UpdateFile>d__17.MoveNext() in C:\source\github.com\github\VisualStudio\src\GitHub.InlineReviews\Services\PullRequestSession.cs:line 173
--- 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 System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at GitHub.InlineReviews.Services.PullRequestSession.<GetFile>d__10.MoveNext() in C:\source\github.com\github\VisualStudio\src\GitHub.InlineReviews\Services\PullRequestSession.cs:line 80
--- 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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at GitHub.ViewModels.PullRequestDetailViewModel.<CreateChangedFilesTree>d__104.MoveNext() in C:\source\github.com\github\VisualStudio\src\GitHub.App\ViewModels\PullRequestDetailViewModel.cs:line 523
--- 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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at GitHub.ViewModels.PullRequestDetailViewModel.<Load>d__100.MoveNext() in C:\source\github.com\github\VisualStudio\src\GitHub.App\ViewModels\PullRequestDetailViewModel.cs:line 389    at GitHub.Models.DiffUtilities.<ParseFragment>d__1.MoveNext() in C:\source\github.com\github\VisualStudio\src\GitHub.Exports\Models\DiffUtilities.cs:line 52
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at GitHub.InlineReviews.Services.DiffService.<Diff>d__2.MoveNext() in C:\source\github.com\github\VisualStudio\src\GitHub.InlineReviews\Services\DiffService.cs:line 35
--- 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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at GitHub.InlineReviews.Services.PullRequestSessionService.<Diff>d__7.MoveNext() in C:\source\github.com\github\VisualStudio\src\GitHub.InlineReviews\Services\PullRequestSessionService.cs:line 58
--- 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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at GitHub.InlineReviews.Services.PullRequestSession.<UpdateFile>d__17.MoveNext() in C:\source\github.com\github\VisualStudio\src\GitHub.InlineReviews\Services\PullRequestSession.cs:line 173
--- 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 System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at GitHub.InlineReviews.Services.PullRequestSession.<GetFile>d__10.MoveNext() in C:\source\github.com\github\VisualStudio\src\GitHub.InlineReviews\Services\PullRequestSession.cs:line 80
--- 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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at GitHub.ViewModels.PullRequestDetailViewModel.<CreateChangedFilesTree>d__104.MoveNext() in C:\source\github.com\github\VisualStudio\src\GitHub.App\ViewModels\PullRequestDetailViewModel.cs:line 523
--- 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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at GitHub.ViewModels.PullRequestDetailViewModel.<Load>d__100.MoveNext() in C:\source\github.com\github\VisualStudio\src\GitHub.App\ViewModels\PullRequestDetailViewModel.cs:line 389

Thank you!

@jcansdale

This comment has been minimized.

Copy link
Collaborator

jcansdale commented Oct 11, 2017

Yes I am seeing the messages. I am sorry for not responding, its the holidays right now in Israel.

Sorry to hassle you! I know it's easy for GitHub notifications to slip through the radar.

Thanks for sending the log. This is very revealing...

+ *
+ *  Copyright (c) 2009 Microsoft Corporation. All Rights Reserved.

+ */
+

There appears to be a gap. 😕 This explains the exception but shouldn't be there!

@smulikHakipod

This comment has been minimized.

Copy link
Author

smulikHakipod commented Oct 11, 2017

I think I found the bug
image

@jcansdale

This comment has been minimized.

Copy link
Collaborator

jcansdale commented Oct 12, 2017

I think I found the bug

I think you did. 👍

I've got a local repro now and will work on a fix. Thanks for the report and your investigating!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.