Home > Back-end >  STD: : map assignment error!
STD: : map assignment error!

Time:09-26

This problem is a bit strange (before running well, drew a diagram, two days to run this program again just hung up the )... One day haven't a clue, want to cry!
Died in the map assignment where=operator cabin in the map! Why will be wrong? Why operator=() to adjust the clear ()? A clear () will be hang, the warrior has a similar situation? Please refers to the way the ,



CodePudding user response:

Quick to a warrior to refers to the road!

CodePudding user response:

Collapsed in the pop-up dialog box, press the corresponding button to enter debugging press Alt + 7 key to view the Call Stack, namely "the Call Stack" from the inside to the following out of from the inner to outer function Call history, double-click a row to the cursor to the Call of the source code or assembly instruction, don't understand when double click on the next line, until we can read ,

CodePudding user response:


Give this information to solve the question?
What type? What are the variables related to operate?

CodePudding user response:

reference shit_moment reply: 3/f

Give this information to solve the question?
What type? What are the variables related to operate?

Variable types are as follows:
STD: : map Map_agv_status_;
AgvStatusType is a structure type, a constructor to initialize all the members, and then there is no other member functions,

CodePudding user response:

AgvStatusType members are the basic data types, there is no dynamic memory allocation,

CodePudding user response:

If so, then there must be some other operation, leading to collapse on here,
This a few words of code position is not a problem for certain,
Also no problem

reference 5 floor lcxhappy2004 reply:
AgvStatusType members are the basic data types, there is no dynamic memory allocation,

CodePudding user response:

refer to 6th floor shit_moment response:
if so, that there must be some other operation, leading to collapse on here,
This a few words of code position is not a problem for certain,
Also no problem

Quote: refer to the fifth floor lcxhappy2004 reply:

AgvStatusType members are the basic data types, there is no dynamic memory allocation,



Thank you, to help analyze!
I don't understand why=assignment to clear (), after going to the erase (), and then collapse, because root () to get head node pointer is null, but why is an empty? Since the size of 0 is the empty also is very normal, isn't it? That is what will crash is to assign the map a large enough space? Not science! The operator is=don't give it assignment?

CodePudding user response:

refer to 6th floor shit_moment response:
if so, that there must be some other operation, leading to collapse on here,
This a few words of code position is not a problem for certain,
Also no problem

Quote: refer to the fifth floor lcxhappy2004 reply:

AgvStatusType members are the basic data types, there is no dynamic memory allocation,


If it is not the problem here, from which direction should I go to find the cause of the problem?

CodePudding user response:

refer to the eighth floor lcxhappy2004 response:
Quote: refer to the sixth floor shit_moment response:

If so, then there must be some other operation, leading to collapse on here,
This a few words of code position is not a problem for certain,
Also no problem

Quote: refer to the fifth floor lcxhappy2004 reply:

AgvStatusType members are the basic data types, there is no dynamic memory allocation,


If it is not the problem here, from which direction should I go to find the cause of the problem?


Look at the variables related to the operation,
If confirmed no problem, the variable related operations are commented out, and see if it did not collapse,
If also collapse, there are some other operation led to this problem,
Shielding little by little, bit by bit positioning,

CodePudding user response:

Saw a mutex,

CodePudding user response:

Recompile, if not to see if there is a cross of dynamic library and so on, please make sure that number of byte alignment is consistent,

CodePudding user response:

The GetListInfo is a what?

CodePudding user response:

I solved this problem, a za a pair of error is the same,
Because I multithreading,
In my two threads using A public map variable, A thread A removal and continually fu on the occasion of the new public mapA variables, pushing the public another thread B mapA assigned to another temporary mapTmp variables, and then at some point, will the mapA variable assigned to mapTmp variable times wrong,
For two threads after locking problem solving,
  • Related