Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the meaning of this C++ Error std::length_error

Tags:

While running my program I get this error:

terminate called after throwing an instance of 'std::length_error'
  what():  basic_string::_S_create
Abort trap

I know that you can't do much without the code but I think that this error is too deep in the code to copy all of it. Maybe I can figure it out if I understand what this error means. Is this a sign for an issue with reading or writing at the wrong memory address?

Is there something I can do to get more information about the problem from my program?

like image 466
Janusz Avatar asked Jul 26 '09 04:07

Janusz


1 Answers

It means you tried to create a string bigger than std::string::max_size().

http://msdn.microsoft.com/en-us/library/as4axahk(VS.80).aspx

An exception of type length_error Class is thrown when an operation produces a string with a length greater than the maximum size.

like image 73
Kevin Doyon Avatar answered Sep 20 '22 21:09

Kevin Doyon