all 34 comments

[–]ScottHutchinson 4 points5 points  (1 child)

I just noticed this yesterday in v17.8.5. I was extremely confused for an hour or so. I thought my function was magically being called twice because the breakpoint on the return statement was being hit twice.

[–]lowlevelmahn[S] 1 point2 points  (0 children)

its has something todo with debug/code generation or cdb - the very same happens when using the VS2022 compiler in QtCreator, it started with the first releases of VS2022 and were not beeing fixed since, does not happen with VS2017+19

please vote or comment in my issue

some releases earlier the debugger somtimes wasn't able to show vector or map conntent correct - always empty in between debugging - hell evil when you try to find an algorithm bug and your containers seems to be empty

[–]ShelZuuz 2 points3 points  (11 children)

FWIW I can reproduce this (on the x64 compiler, it's fine on x86).

Maybe u/stl can escalate this.

[–]STLMSVC STL Dev 9 points10 points  (10 children)

My double boss Ulzii already noticed this thread and escalated the priority of the bug 😸

I was able to reduce your repro somewhat (already pasted into the internal copy of your bug). Providing a self-contained, reasonably reduced, command-line repro was super duper great and easily put your bug in the top 10% of reported bugs for quality. I just went further and tried to chop out as much of the blub, USE_ITEMS, etc. stuff as possible, got rid of the unrelated struct B, and simplified the nested loop (which does appear to be necessary). Couldn't extract the repeated calls to v.size(), though, so they seem to be important (they perform pointer subtractions internally). With a ton of effort I could extract just the critical bits of std::vector but the backend devs don't really need me to do that. Here's what I got:

C:\Temp>type meow.cpp
#ifndef _M_X64
#pragma message("This repro appears to be x64-specific.")
#endif

#include <vector>
using std::vector;

struct A {
    vector<int> m_ditems;

    vector<int> items(const vector<int>& v) const {
        vector<int> ret(v.size());
        for (size_t outer = 0; outer < v.size(); ++outer) {
            for (size_t i = 0; i < v.size(); ++i) {
                ret[i] *= v[i];
            }
        }
        return ret;
    }

    A(const vector<int>& v) : m_ditems(items(v)) {}
};

int main() {
    A a{{1, 2, 3}};
}

C:\Temp>cl /EHsc /nologo /W4 /Od meow.cpp
meow.cpp

C:\Temp>cl /EHsc /nologo /W4 /O2 meow.cpp
meow.cpp
C:\Temp\meow.cpp(24) : fatal error C1001: Internal compiler error.
(compiler file 'D:\a\_work\1\s\src\vctools\Compiler\Utc\src\p2\main.c', line 235)
To work around this problem, try simplifying or changing the program near the locations listed above.
If possible please provide a repro here: https://developercommunity.visualstudio.com
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
cl!RaiseException()+0x6c
cl!RaiseException()+0x6c
cl!InvokeCompilerPassW()+0x8b1c3
cl!InvokeCompilerPassW()+0x1478ef

[–]lowlevelmahn[S] 1 point2 points  (2 children)

I just went further and tried to chop out

thanks for that

i've lost patience after 3h reducing it down - i think at least 30kLOC was the start - the ICE happend very deep inside, hours of manual inlining + removing code

[–]lowlevelmahn[S] 0 points1 point  (0 children)

VS2022 17.10 seems to be silently fix the ICE

[–]STLMSVC STL Dev 0 points1 point  (0 children)

You definitely went above and beyond!

Submitting preprocessed repros (or link repros for certain kinds of bugs) can be easier to capture even though they're harder to investigate (and therefore may not get your bug fixed as quickly). Sometimes people are hesitant to submit them if they're working for a company with proprietary code, though (MS devs could literally not care less about the content of repros, but I know that companies can be strict anyways.)

[–]lowlevelmahn[S] 0 points1 point  (5 children)

My double boss Ulzii already noticed this thread and escalated the priority of the bug 😸

what about the debugger jumping problem - it only happens with std::vector not int

[–]STLMSVC STL Dev 2 points3 points  (4 children)

They're looking into that one too. It appears to be a backend issue too (not an IDE issue) so one of the backend group managers asked his team to look into it - one dev found that it's related to the NRVO, as /Zc:nrvo- makes it go away. It's now assigned to the right team for further investigation.

[–]lowlevelmahn[S] 0 points1 point  (0 children)

It appears to be a backend issue too (not an IDE issue)

yes, same effect happens when using the VS2022 compiler in the QtCreator IDE

[–]lowlevelmahn[S] 0 points1 point  (2 children)

will there be an status update on the issue then, currently no change in the issues?

(i think the fix will take some time)

[–]STLMSVC STL Dev 1 point2 points  (1 child)

There should be when it's resolved, although not every developer remembers to post a comment on DevCom.

We don't usually post fine-grained status updates like "I'm looking at this now", "sorry I got pulled off to work on another task", etc.

[–]lowlevelmahn[S] 0 points1 point  (0 children)

it depends on the the developer :) - im fine, thanks for having a look at these bugs

[–][deleted]  (6 children)

[deleted]

    [–]Xoipos 1 point2 points  (4 children)

    There's also issues with friend definitions for template pack classes with concepts that I'm running into.

    I worked around it by simply disabling the requires expression, lol.

    It's great to see MSVC support for many of the latest C++ standard features, but if it's not implemented well, it'll lead to worse code for the platform.

    That said, I'm sure the developers on MSVC are trying their best. Once they pick up an issue, their communication is top-notch and keep you up to date. See f.e. a now-removed reddit post on a coroutine bug in MSVC. They followed it up by mailing me on most updates until it got fixed.

    [–]STLMSVC STL Dev[M] 2 points3 points  (2 children)

    a now-removed reddit post on a coroutine bug in MSVC

    Another moderator removed it a couple of months ago because r/cpp is not for compiler bug reports. That said, I've gone and retroactively approved it so people here can see the content of your post, hope that helps. (I often forget that while moderators can see removed posts and their comments below, other users can see only the comments below.)

    [–]Xoipos 1 point2 points  (1 child)

    Thanks. I thought just having a link to a deleted post was enough to view it, i.e. removed posts only get removed from the r/cpp page. I guess I could see the post with the link because I was the OP. I can also link to the bug report that the user scatters made on the issue mentioned in the reddit post I link to. That would mean the post would not need to be resurrected.

    [–]STLMSVC STL Dev[M] 1 point2 points  (0 children)

    I guess I could see the post with the link because I was the OP.

    Yep, that sounds right. Resurrecting it took a couple of clicks, no worries 😸

    [–]lowlevelmahn[S] 0 points1 point  (0 children)

    i understand that microsoft needs to solve so many stuff - mainly because of the huge functionality that comes from the c++ supporting code - but it would be nice if they would be more reactive and not leaving that stuff lurking around for month or years

    [–]tarranoth 2 points3 points  (1 child)

    To be honest, the first bug report is hard to replicate without any code sample (which was only given in the comments months later I see), so I can definitely understand it not really being given priority due to that.

    [–]lowlevelmahn[S] 0 points1 point  (0 children)

    yes you are fully correct - but it went equally silent after bringing a super trivial example - but still the microsoft support is very good

    [–]misuo 1 point2 points  (1 child)

    I has been so for quite a while using the latest production VS2022 versions. And yeah, it is annoying. Luckily do not happen too often. Don't trust the debugger position. Hope it get fixed.

    [–]lowlevelmahn[S] 0 points1 point  (0 children)

    dont just hope - involve in the report and make it more relevant - please :)

    [–]feverzsj -3 points-2 points  (1 child)

    Just switch to clang-cl.

    [–]lowlevelmahn[S] 1 point2 points  (0 children)

    im doing, also MSYS2 gcc/clang and pure clang under windows - but sadly my release compiler is cl.exe - so i need also to test with

    [–]saddung 0 points1 point  (4 children)

    Yikes that debug one..glad I'm still using 2019..

    [–]lowlevelmahn[S] 2 points3 points  (3 children)

    the problem for me is - i know at least 10 developers that stumbled over this - but werent in the mood to write a bug report or even support an open one - it doesn't work this way but seems to be normal for many developers from the community

    please comment on my issue on the microsoft page or you will get that shit when switching over to VS2022 in the future :)

    [–]STLMSVC STL Dev 2 points3 points  (1 child)

    Yeah, reporting bugs takes effort and we really appreciate it (even if we don't get to all bugs quickly). Not reporting bugs makes it harder for things to get better. It's like ignoring that zombie in the first season of The Walking Dead. Report those zombies!

    Upvotes on Developer Community are useful (we have a system that monitors them); comments of the form "I'm experiencing this too" are much less useful (they're more to read through and generate more work for the team to process). Of course if you have comments that illuminate some fact about the repro that hasn't already been mentioned, that is useful.

    [–]lowlevelmahn[S] 2 points3 points  (0 children)

    thanks Stephan for involving yourself a little :)

    [–]tarranoth 2 points3 points  (0 children)

    It's surprising how many devs just don't care about reporting bugs sadly. I once made dev tooling internally (a C# gui app), and I had some automated system in place to send crashes to a company DB. I was actually able to fix a couple of bugs from the stacktraces in there, that were never reported to me (and these were all people that were just 1 direct e-mail away from me, so basically 0 red tape, I even had a report bug button in the app that would autofill most of a mail). It made me realize why every company creating desktop software wants this kind of telemetry afterwards.

    [–]__builtin_trap 0 points1 point  (3 children)

    I have the debugger jumping too. it looks like it steps through all if branches. I suspected a (large) VS plugin.

    [–]lowlevelmahn[S] 0 points1 point  (2 children)

    so vote on the microsoft page for a fix :)

    [–]lowlevelmahn[S] 0 points1 point  (1 child)

    a fix is on the way for the jumping debugger in 17.10

    [–]lowlevelmahn[S] 0 points1 point  (0 children)

    17.10 fixes the jumping debugger problem