compare-plugin icon indicating copy to clipboard operation
compare-plugin copied to clipboard

Assertion failed - vector subscript out of range

Open jay opened this issue 8 years ago • 9 comments
trafficstars

I'm using Notepad++ 6.9.2 on Windows 7 x64 with the latest CI build of the compare plugin, made from 2e55f818, see https://ci.appveyor.com/project/jsleroy/compare-plugin/build/job/28h8q8a1w5vg0w7n/artifacts.

Notepad++ I have split into 2 vertical panes. In the left pane file1.c and in the right pane file2.c. When I attempt to compare the two files (Plugins > Compare > Compare) Notepad++ will show an assertion failed error. This is 100% reproducible for me. Attached are the files:

Assertion failed - vector subscript out of range.zip

assertion failed - vector subscript out of range

Prior to this I used a CI build from 99e0c6ca and occasionally it would give me the same error when working on random comparisons, however I don't think I ever had a repro case.

Also... is this the canonical repo for the compare plugin? (ie am I reporting this in the right place). I see the @pnedev fork has a master that seems to be more active.

jay avatar Mar 01 '17 21:03 jay

Hello @jay ,

Thanks for reporting, I'll analyse the problem and write back. It's best if you report any future issues / requests in my fork repo as it has diverged from this one and all the development is currently done there.

BR

pnedev avatar Mar 02 '17 10:03 pnedev

Hello again @jay ,

The issue is fixed with https://github.com/pnedev/compare-plugin/commit/51f0a00bbb1bc6ef601d7e25ecb05f3478ac2e8d. Thanks again for reporting it.

BR

pnedev avatar Mar 05 '17 15:03 pnedev

Thanks I have tried the new version and can confirm it works here. I notice a few things though that are different from the previous versions I was using, I don't know that they are bugs:

  • The color has changed to a lighter red and green since the build I was using from 6 months ago: 255,196,196 old red 255,215,215 new red 170,255,170 old green 217,255,217 new green So either I had changed the color long ago and the new builds don't acknowledge the custom color or the default color is different. Reverting back to an old build will show the old colors.

  • Comparing two files with nothing in common is showing blank lines matching which is separating the match/no-match areas into chunks. Try comparing these files for example. Screenshot pnedev/compare-plugin@2e55f818 (committed last week): capture4 Screenshot pnedev/compare-plugin@51f0a00 (committed today): capture3

  • Some graphics artifact things are in the navbar with the original repro case I reported. So now in pnedev@51f0a00 I can scroll down to the bottom of the navbar but it doesn't seem to be proportioned the same. file1.c and file2.c have a less total line count (4941 vs 5165) and also if you see the navbar on the left in the area I circled there's basically slack space that is filled with graphics leftovers (I'm really not sure of the right word for this) so the content is never the same. Here's a screenshot: capture

Again I don't know whether any of this is expected. I can file new issues if wanted.

jay avatar Mar 05 '17 21:03 jay

Another thing I'm noticing is if I have more than one row of tabs in a pane and I compare something it hides all the other rows, but clear all compares puts it back the way it was.

jay avatar Mar 05 '17 23:03 jay

Hello @jay,

The color has changed to a lighter red and green since the build I was using from 6 months ago

The default colors have been changed in the new version. You can set any color you prefer in Settings.

The old and new versions use different INI files; so the settings would not be preserved on switching between them.

Another thing I'm noticing is if I have more than one row of tabs in a pane and I compare something it hides all the other rows, but clear all compares puts it back the way it was.

This is intentionally implemented for a proper alignment. Please see https://github.com/pnedev/compare-plugin/issues/105.

Best regards.

Yaron10 avatar Mar 06 '17 00:03 Yaron10

Hello @jay ,

Thanks once more for reporting the issues you found.

Hello @Yaron10 ,

Thank you for the support, I appreciate that.

As Yaron wrote, the colors and the multi-line tab bar behavior are no bugs - those are done on purpose - he had already given the details (thanks again for that).

Comparing two files with nothing in common is showing blank lines matching which is separating the match/no-match areas into chunks.

That is also the behavior before the "vector-out-of-bounds" fix but I agree that the older compare results are better. I'll investigate that. Jay, could you please file a new issue for that but in my fork? Thanks.

Some graphics artifact things are in the navbar with the original repro case I reported.

The graphics artifact is a bug. The NavBar portion where the artifact is should be just a gray area (as if the file end has been reached). Try again to reproduce the issue and when you are seeing the graphics artifact just minimize and restore the N++ window again - you'll see what the expected behavior should be in that case. It again doesn't look very nice (the visible diffs are misaligned) but it is the expected behavior with the current implementation (it is not a bug). The misalignment is coming from the "Compact Navigation Bar" setting turned on. It tries to compress the diffs preview by skipping preview for similar lines. If the files differ much then the lines skip count is different which leads to different preview lines count between files. Turning off "Compact Navigation Bar" turns off the compression making the line count equal -> aligned NavBar preview. Please file also a new issue about that in my fork. Thanks.

BR

pnedev avatar Mar 06 '17 08:03 pnedev

Hello Pavel,

Thank you for your great work and for looking into the issues reported here.

BR

Yaron10 avatar Mar 07 '17 00:03 Yaron10

@pnedev and @Yaron10 thanks for the info.

Try again to reproduce the issue and when you are seeing the graphics artifact just minimize and restore the N++ window again

@pnedev unfortunately the very issue I reported here now reappears if I scroll to the bottom of a compact navigation after a compare of file1.c and file2.c and then minimize Notepad++.

The line number is different now:

capture

Please let me know if you want me to file a separate issue or you can reopen this one (I can't reopen it on my own).

jay avatar Mar 07 '17 03:03 jay

Hello @jay ,

Thanks again, I'll have a look.

BR

pnedev avatar Mar 07 '17 08:03 pnedev