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

Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

Posting a File and Associated Data to a RESTful WebService preferably as JSON2019 Community Moderator ElectionREST URI convention - Singular or plural name of resource while creating itUploading both data and files in one form using Ajax?How do I upload a file with metadata using a REST web service?REST API - file (ie images) processing - best practicesSpring: JSON data and file in the same requestREST API Put large dataPosting a file and JSON data to Spring rest serviceRESTful Web Service Upload/Download Large Data With JSONREST API Design sending JSON data and a file to the api in same requestPost JSONArray to REST servicePUT vs. POST in RESTParsing values from a JSON file?JavaScript/jQuery to download file via POST with JSON dataHow do I upload a file with metadata using a REST web service?How to POST JSON data with Curl from Terminal/Commandline to Test Spring REST?Separate REST JSON API server and client?what's the correct way to send a file from REST web service to client?How do I write JSON data to a file?What is “406-Not Acceptable Response” in HTTP?REST API - file (ie images) processing - best practices

How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page