-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Stopping due to fatal error: ArgumentException: An item with the same key has already been added. #8760
Comments
I'm having the same error. |
Have the same error here. Seems like it is unsupported to have the same variable name twice in a stack frame, which is of course possible in e.g. C++ Renaming the duplicate variable names in nested blocks solves the debugger hang. |
Hm seems like there is something else going on as well. Only managed to debug a little further, but now the same error, but there are not multiple variables with same name on the same stack frame. |
I'm having the same errors. |
Strangely enough downgrading the extension does not help? Edit: Managed to downgrade to last release version 1.7.1, which resolves the bug. It auto updated before, and I did not notice. |
Yes, forgot to mention that this is a regression that was introduced recently. It was working last week. I did not bisect when exactly it was introduced. |
Regarding duplicate variable names: In my case I have a pretty trivial function that has only some local vars with different names but it's still crashing. |
The problem is with some variable caching I did for supporting data breakpoints in MIEngine: microsoft/MIEngine#1257 I've got a fix working now. The Debug Adapter Protocol has a small issue where we only send the variable name and the stack frame it's associated with (or the parent variable if it's a child), so I'm just converting the cache's dictionaries to use TryAdd methods instead as a quick fix. |
@calgagi Do you know which version(s) this affects? Should we be downgrading to 1.7.1 or is there a pre-release version that should work? Edit: Looks like its still an issue in pre-release 1.8.3 |
One other thing I noticed: this seems to break removing breakpoints for me. Even after clicking in the source code to remove a breakpoint, gdb still stops at that line. |
@mdemoret-nv 1.8.3 is identical to 1.8.2. You should try our previous Insiders -- 1.8.1, which has older debugger binaries. |
Anytime we evaluate a variable more than once (in the same break state while debugging) or stop when there are 2 or more variables with the same name, the debugger will crash. The variable(s) must be in the same stack frame. |
Its funny, even calling |
@WardenGnaw @WardenGnaw I switched C/C++ version to 1.8.1. and issue still persists. So I downgraded it further to 1.7.1 and issue still persists. Can you help please ? |
@WardenGnaw Providing output from Debug Console: (replying here as you closed #8776 |
Switch to 1.7.1 close VSCode and re open VSCode. Just worked for me. |
I tried downgrading C/C++ up till 1.7.1 and issue is still present. Hey, what is Insiders? Is it something different from C/C++ extension? I was getting popup messages in VSCode regarding installing insiders. I didn't downgrade Insiders specifically. I searched for it in list of installed extensions but could not locate it. Any help please? |
After I update the vscode version to latest I get the same error. |
@WardenGnaw As in by Debug Console, there is no error shown, so it seems that the issue I am facing is not same as #8760 . In that case, I request you to re-open issue #8776 and help. |
i am also running into this issue, i'll update this comment when the fix is released and I've tested it edit: fixed for me in v1.8.5 Pre-Release |
I got this error when debugging. System: Ubuntu 18.04 VSCode version:
C/C++ tools extension: v1.8.3 Pre-Release Workspace is in a running docker container. An rec error message in Debug console is shown: Then the debug cannot continue. I have to click the stop button to end the session, other buttons (continue, stepping etc) do not work anymore. |
system: Ubuntu 20.04.1 I have the same problem when debug the OpenJdk source code. I can't delete breakpoints in vscode editor area. So i run the commands in the DEBUG CONSOLE then get this problem. The old version, 1.8.1 or 1.7.1 version works well. Make sure disable auto update extensions. |
System: macOS Monterey: 12.1 (21C52) I ran into the same problem. I wrote this small C code to see if I could narrow it down, and it turns out that it's happening with almost everything. #include <stdlib.h>
#include <stdio.h>
typedef struct test
{
int i;
// struct test *next;
} test;
int main()
{
test first;
first.i = 0;
struct second
{
int i;
} second;
second.i = 1;
int third = 0;
// BREAKPOINT HERE.
return 0;
} Debugging any of the values (first.i, second.i, third) returns the same error:
I decided to see what would happen if I removed the first element, by commenting everything out. This changed the error to:
I then commented out the second, and called the third item again. Which then changed the problem to:
Even something as simple as: int main()
{
int third = 0;
// BREAKPOINT HERE.
return 0;
} will cause the error. I don't have the time to try to figure it out right now, so I'll just switch to the later version. Hopefully I'll be able to come back and help with it. I'm sorry if this information isn't useful and just clutters up this page. Here is everything from the debugger:
Putting anything into the debugger (even if it's not "legal" and would return an error anyway) causes the same problem to occur, for example:
|
I've confirmed that this issue still exists in 1.8.3 |
@PeacefulWhale 1.8.3 is identical to 1.8.2 (VS Code is requiring that we release 2 identical versions of our extension in order to support the Pre-Release channel, see the discussion at microsoft/vscode#142040). The fix is expected to be in our 1.8.4/1.8.5 release later today. |
Ah, thank you, I wasn’t aware of the practice. Thank you for your work! |
I've also was been facing this issue but I've just checked the new release and the issue is gone! Thanks for the quick fix :) |
Yes, it's fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/1.8.4 (or 1.8.5, which is identical, except using that version will auto-update to 1.9.0 (insiders) when we release that). |
My workaround has been to collapse the Variables view and prevent evaluation of variables while stepping. (If it happens again). |
Bug type: Debugger
Describe the bug
I cannot execute any gdb command in the debug console anymore.
When I for example do
-exec ptype geometry1
I get:
Stopping due to fatal error: ArgumentException: An item with the same key has already been added. Key: (Microsoft.MIDebugEngine.AD7StackFrame, geometry1)
The variable name in the error message seems unrelated to my command. It also happens when I add breakpoints through debug console. It seems to always be the first local variable in the call stack that is mentioned in the error message.
Interesting to note though: The actual command succeeds and I can see the output of
ptype
. The error/crash happens just after.Additional context
I cannot include full trace here for legal reasons.
Last messages before the crash are:
The text was updated successfully, but these errors were encountered: