Error reading variable. Cannot create a lazy string with address2019 Community Moderator Electioniostream linker errorRead whole ASCII file into C++ std::stringHow to ensure that you are building against STLportC++: accessing private fields and function from mainstd::async call of member functionSTL map<string, string>, assign 0 value to a key causes compile errorWrong constructor called in custom vector classerror LNK2019: unresolved external symbol "public: __thiscall : constructor issueWhy am I getting multiple definition error when header included?Creating string class with static information

Relationship between sampajanna definitions in SN 47.2 and SN 47.35

Bacteria contamination inside a thermos bottle

When to use a slotted vs. solid turner?

What options are left, if Britain cannot decide?

Did Ender ever learn that he killed Stilson and/or Bonzo?

How do I hide Chekhov's Gun?

Why did it take so long to abandon sail after steamships were demonstrated?

Employee lack of ownership

A diagram about partial derivatives of f(x,y)

Does multi-classing into Fighter give you heavy armor proficiency?

Why do tuner card drivers fail to build after kernel update to 4.4.0-143-generic?

How difficult is it to simply disable/disengage the MCAS on Boeing 737 Max 8 & 9 Aircraft?

Why is a white electrical wire connected to 2 black wires?

Why do newer 737s use two different styles of split winglets?

The German vowel “a” changes to the English “i”

Non-trivial topology where only open sets are closed

What are substitutions for coconut in curry?

Fastest way to pop N items from a large dict

Is honey really a supersaturated solution? Does heating to un-crystalize redissolve it or melt it?

Do I need life insurance if I can cover my own funeral costs?

Violin - Can double stops be played when the strings are not next to each other?

Brexit - No Deal Rejection

Different outputs for `w`, `who`, `whoami` and `id`

Examples of transfinite towers



Error reading variable. Cannot create a lazy string with address



2019 Community Moderator Electioniostream linker errorRead whole ASCII file into C++ std::stringHow to ensure that you are building against STLportC++: accessing private fields and function from mainstd::async call of member functionSTL map<string, string>, assign 0 value to a key causes compile errorWrong constructor called in custom vector classerror LNK2019: unresolved external symbol "public: __thiscall : constructor issueWhy am I getting multiple definition error when header included?Creating string class with static information










2















I have following code:



#include <string>
#include <vector>

class A
public:
std::string s = "test";
;

class B
public:
std::vector<A> vec;
;

int main()

std::vector<B> vec;

A a1 = A();
A a2 = A();

B b1 = B();
b1.vec.push_back(a1);
b1.vec.push_back(a2);

vec.push_back(b1); // push_1
vec.push_back(b1);



Whenever I execute this app under debugger, and execution procecss reachs instruction with comment push_1, the execution process is stopped, and I have two followings informations in my debugger output:




__lhs s = "test"



__rhs s = "error reading variable: Cannot create a lazy string with address 0x0, and a non zero length.




The application exit code is 0.



But when I remove property s of class A, or repleace with for instance int property, this strange behaviour does not occure. Why it is happening? Why the string occurrance in the class A, causes this error?










share|improve this question



















  • 1





    I can't reproduce. What is your platform/compiler? BTW, for a Minimal, Complete, and Verifiable example you are missing #include <vector> and #include <string>.

    – Werner Henze
    Mar 6 at 21:10












  • You're right I missed the headers. The platform is Linux Debian x64, and to compile I'm using g++ (Debian 6.3.0-18+deb9u1) 6.3.0 20170516. The C++ standard version is 14.

    – bielu000
    Mar 6 at 21:17











  • Are you debugging an optimized build?

    – alter igel
    Mar 6 at 21:31











  • @bielu000 I too reckon that this is some kind of an optimized build. Tried this and couldn't reproduce. onlinegdb.com/S18rQTaUE. It's not the same architecture though...

    – aep
    Mar 6 at 22:03











  • I think that you're rightit could be because optimized builds, but I don't have any optimiziation flags set. It is really confusing me - I copied all files and directories of above app into another, new directory, and it works correctly... But the original source still works as I said above. I compared all files, from CmakeLists even to IDE configuration settings, but there are any differents.

    – bielu000
    Mar 7 at 4:51















2















I have following code:



#include <string>
#include <vector>

class A
public:
std::string s = "test";
;

class B
public:
std::vector<A> vec;
;

int main()

std::vector<B> vec;

A a1 = A();
A a2 = A();

B b1 = B();
b1.vec.push_back(a1);
b1.vec.push_back(a2);

vec.push_back(b1); // push_1
vec.push_back(b1);



Whenever I execute this app under debugger, and execution procecss reachs instruction with comment push_1, the execution process is stopped, and I have two followings informations in my debugger output:




__lhs s = "test"



__rhs s = "error reading variable: Cannot create a lazy string with address 0x0, and a non zero length.




The application exit code is 0.



But when I remove property s of class A, or repleace with for instance int property, this strange behaviour does not occure. Why it is happening? Why the string occurrance in the class A, causes this error?










share|improve this question



















  • 1





    I can't reproduce. What is your platform/compiler? BTW, for a Minimal, Complete, and Verifiable example you are missing #include <vector> and #include <string>.

    – Werner Henze
    Mar 6 at 21:10












  • You're right I missed the headers. The platform is Linux Debian x64, and to compile I'm using g++ (Debian 6.3.0-18+deb9u1) 6.3.0 20170516. The C++ standard version is 14.

    – bielu000
    Mar 6 at 21:17











  • Are you debugging an optimized build?

    – alter igel
    Mar 6 at 21:31











  • @bielu000 I too reckon that this is some kind of an optimized build. Tried this and couldn't reproduce. onlinegdb.com/S18rQTaUE. It's not the same architecture though...

    – aep
    Mar 6 at 22:03











  • I think that you're rightit could be because optimized builds, but I don't have any optimiziation flags set. It is really confusing me - I copied all files and directories of above app into another, new directory, and it works correctly... But the original source still works as I said above. I compared all files, from CmakeLists even to IDE configuration settings, but there are any differents.

    – bielu000
    Mar 7 at 4:51













2












2








2


0






I have following code:



#include <string>
#include <vector>

class A
public:
std::string s = "test";
;

class B
public:
std::vector<A> vec;
;

int main()

std::vector<B> vec;

A a1 = A();
A a2 = A();

B b1 = B();
b1.vec.push_back(a1);
b1.vec.push_back(a2);

vec.push_back(b1); // push_1
vec.push_back(b1);



Whenever I execute this app under debugger, and execution procecss reachs instruction with comment push_1, the execution process is stopped, and I have two followings informations in my debugger output:




__lhs s = "test"



__rhs s = "error reading variable: Cannot create a lazy string with address 0x0, and a non zero length.




The application exit code is 0.



But when I remove property s of class A, or repleace with for instance int property, this strange behaviour does not occure. Why it is happening? Why the string occurrance in the class A, causes this error?










share|improve this question
















I have following code:



#include <string>
#include <vector>

class A
public:
std::string s = "test";
;

class B
public:
std::vector<A> vec;
;

int main()

std::vector<B> vec;

A a1 = A();
A a2 = A();

B b1 = B();
b1.vec.push_back(a1);
b1.vec.push_back(a2);

vec.push_back(b1); // push_1
vec.push_back(b1);



Whenever I execute this app under debugger, and execution procecss reachs instruction with comment push_1, the execution process is stopped, and I have two followings informations in my debugger output:




__lhs s = "test"



__rhs s = "error reading variable: Cannot create a lazy string with address 0x0, and a non zero length.




The application exit code is 0.



But when I remove property s of class A, or repleace with for instance int property, this strange behaviour does not occure. Why it is happening? Why the string occurrance in the class A, causes this error?







c++






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 6 at 21:19







bielu000

















asked Mar 6 at 20:58









bielu000bielu000

357318




357318







  • 1





    I can't reproduce. What is your platform/compiler? BTW, for a Minimal, Complete, and Verifiable example you are missing #include <vector> and #include <string>.

    – Werner Henze
    Mar 6 at 21:10












  • You're right I missed the headers. The platform is Linux Debian x64, and to compile I'm using g++ (Debian 6.3.0-18+deb9u1) 6.3.0 20170516. The C++ standard version is 14.

    – bielu000
    Mar 6 at 21:17











  • Are you debugging an optimized build?

    – alter igel
    Mar 6 at 21:31











  • @bielu000 I too reckon that this is some kind of an optimized build. Tried this and couldn't reproduce. onlinegdb.com/S18rQTaUE. It's not the same architecture though...

    – aep
    Mar 6 at 22:03











  • I think that you're rightit could be because optimized builds, but I don't have any optimiziation flags set. It is really confusing me - I copied all files and directories of above app into another, new directory, and it works correctly... But the original source still works as I said above. I compared all files, from CmakeLists even to IDE configuration settings, but there are any differents.

    – bielu000
    Mar 7 at 4:51












  • 1





    I can't reproduce. What is your platform/compiler? BTW, for a Minimal, Complete, and Verifiable example you are missing #include <vector> and #include <string>.

    – Werner Henze
    Mar 6 at 21:10












  • You're right I missed the headers. The platform is Linux Debian x64, and to compile I'm using g++ (Debian 6.3.0-18+deb9u1) 6.3.0 20170516. The C++ standard version is 14.

    – bielu000
    Mar 6 at 21:17











  • Are you debugging an optimized build?

    – alter igel
    Mar 6 at 21:31











  • @bielu000 I too reckon that this is some kind of an optimized build. Tried this and couldn't reproduce. onlinegdb.com/S18rQTaUE. It's not the same architecture though...

    – aep
    Mar 6 at 22:03











  • I think that you're rightit could be because optimized builds, but I don't have any optimiziation flags set. It is really confusing me - I copied all files and directories of above app into another, new directory, and it works correctly... But the original source still works as I said above. I compared all files, from CmakeLists even to IDE configuration settings, but there are any differents.

    – bielu000
    Mar 7 at 4:51







1




1





I can't reproduce. What is your platform/compiler? BTW, for a Minimal, Complete, and Verifiable example you are missing #include <vector> and #include <string>.

– Werner Henze
Mar 6 at 21:10






I can't reproduce. What is your platform/compiler? BTW, for a Minimal, Complete, and Verifiable example you are missing #include <vector> and #include <string>.

– Werner Henze
Mar 6 at 21:10














You're right I missed the headers. The platform is Linux Debian x64, and to compile I'm using g++ (Debian 6.3.0-18+deb9u1) 6.3.0 20170516. The C++ standard version is 14.

– bielu000
Mar 6 at 21:17





You're right I missed the headers. The platform is Linux Debian x64, and to compile I'm using g++ (Debian 6.3.0-18+deb9u1) 6.3.0 20170516. The C++ standard version is 14.

– bielu000
Mar 6 at 21:17













Are you debugging an optimized build?

– alter igel
Mar 6 at 21:31





Are you debugging an optimized build?

– alter igel
Mar 6 at 21:31













@bielu000 I too reckon that this is some kind of an optimized build. Tried this and couldn't reproduce. onlinegdb.com/S18rQTaUE. It's not the same architecture though...

– aep
Mar 6 at 22:03





@bielu000 I too reckon that this is some kind of an optimized build. Tried this and couldn't reproduce. onlinegdb.com/S18rQTaUE. It's not the same architecture though...

– aep
Mar 6 at 22:03













I think that you're rightit could be because optimized builds, but I don't have any optimiziation flags set. It is really confusing me - I copied all files and directories of above app into another, new directory, and it works correctly... But the original source still works as I said above. I compared all files, from CmakeLists even to IDE configuration settings, but there are any differents.

– bielu000
Mar 7 at 4:51





I think that you're rightit could be because optimized builds, but I don't have any optimiziation flags set. It is really confusing me - I copied all files and directories of above app into another, new directory, and it works correctly... But the original source still works as I said above. I compared all files, from CmakeLists even to IDE configuration settings, but there are any differents.

– bielu000
Mar 7 at 4:51












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55032025%2ferror-reading-variable-cannot-create-a-lazy-string-with-address%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55032025%2ferror-reading-variable-cannot-create-a-lazy-string-with-address%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved