# I think my code might have a bug, but I am not sure if it actually does, is it broken code?

I have some C++ code that I am executing from C# dotnet core 2. In my C++, I am using a third party library. My code builds and runs, but after being executed a few million times (2.5 mil last time) I see the following message:

 terminate called after throwing an instance of 'std::length_error'
what():  basic_string::_S_create
Aborted (core dumped)


Now I would like to put my code up here for review, but I don't really understand if it would be against the broken code policy. It might not be broken, because as far as I know the error is being thrown from the third party lib (although as a pretty new C++ dev, I am assuming it's my fault). Would posting this for review be appropriate?

If that message isn't the intended behavior, and you're looking for a solution to that specific issue, the right thing to do is to post a MCVE that reproduces the problem on Stack Overflow.

If that message isn't the intended behavior, and you don't care for a fix because executing a few million times isn't your use-case anyway, then you don't even need to mention it.

The purpose of the "no broken code" rule is to avoid turning reviewers into bug-hunters. It's about what the intent of your post is: if you want to improve your code in every aspect, you're at the right place. If you want to fix a specific issue with your code, you'd better ask on SO.

If you're worried about that problem, then you need a fix for it - it's a SO question.

If you're not worried about that problem and don't care to fix it and your code works as intended in the intended use cases, then you have a CR question - it's possible that a reviewer finds a bug (or two!) in your working code; it's possible a reviewer finds the source of that bug.

• Since my intention was to validate whether I have a bug first and then make sure it is efficient as possible, I will go to so first then come back here. (not back to meta) – Theyouthis Sep 8 '17 at 13:51

Since this is an error that stops your code, it's likely to be off-topic as broken code. However if the error is in the third party code, you can say third_party.error_after_2m_calls errors on occasion. And you are not asking for debugging help. (There isn't a meta question for this, but I've asked a question that has this, and know of more that have too)

If however the error is in your code there are three routes you can go:

• "I'm unsure if your problem is just a warning message, or if your code actually errors out and stops working." std::terminate aborts a program. It's essentially a crash at that point, since there's an uncaught exception. – Zeta Sep 8 '17 at 13:51