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

Giving a career talk in my old university, how prominently should I tell students my salary?

Rationale to prefer local variables over instance variables?

What is better: yes / no radio, or simple checkbox?

How to copy the rest of lines of a file to another file

Is this Paypal Github SDK reference really a dangerous site?

What do you call someone who likes to pick fights?

Is there a way to make cleveref distinguish two environments with the same counter?

Is it possible to clone a polymorphic object without manually adding overridden clone method into each derived class in C++?

Called into a meeting and told we are being made redundant (laid off) and "not to share outside". Can I tell my partner?

Having the player face themselves after the mid-game

How to educate team mate to take screenshots for bugs with out unwanted stuff

When an outsider describes family relationships, which point of view are they using?

How can a demon take control of a human body during REM sleep?

ESPP--any reason not to go all in?

How do spaceships determine each other's mass in space?

Strange opamp's output impedance in spice

How do you make a gun that shoots melee weapons and/or swords?

How do I increase the number of TTY consoles?

Do Paladin Auras of Differing Oaths Stack?

Writing text next to a table

Why restrict private health insurance?

Why is there an extra space when I type "ls" on the Desktop?

(Codewars) Linked Lists-Sorted Insert

Cycles on the torus



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
    2 days ago















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
    2 days ago













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

344316




344316







  • 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
    2 days ago












  • 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
    2 days ago







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
2 days ago





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
2 days ago












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

How to get text form Clipboard with JavaScript in Firefox 56?How to validate an email address in JavaScript?How do JavaScript closures work?How do I remove a property from a JavaScript object?How do you get a timestamp in JavaScript?How do I copy to the clipboard in JavaScript?How do I include a JavaScript file in another JavaScript file?Get the current URL with JavaScript?How to replace all occurrences of a string in JavaScriptHow to check whether a string contains a substring in JavaScript?How do I remove a particular element from an array in JavaScript?

Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

List of MPs elected to the English parliament in 1640 (April) Contents List of constituencies and members See also Notes References Navigation menueNational Archives – The Glynde Place ArchivesCobbett's Parliamentary history of England, from the Norman Conquest in 1066 to the year 1803'Aldermen in Parliament', The Aldermen of the City of London: Temp. Henry III – 1912onepage&q&f&#61, false 229