A summary of the problems that occur when a pointer variable is simultaneously manipulated under a dual thread

Source: Internet
Author: User

Source: Http://blog.csdn.net/lezhiyong

Problem:

In the test process of a project, the test in the high-definition stress testing process will occasionally appear the RSS crash, the crash time is uncertain, due to the daemon service in the Guardian, RSS after the crash was pulled back, so this fault in the crash is immediately sent in the network management does not reflect the service stop alarm, Only when testers go to the RSS var/run directory to find files beginning with edum*** does the RSS send crash be specified. According to the description of the crash time provided in the file, sometimes a few days ago, sometimes a few hours ago, testers were more difficult to recall what they were doing. The crash-time stack information that is printed on multiple edum*** files occurs each time the crash appears in different calling code logic. All this will make it difficult to reproduce and locate the problem.

Source of the problem:

The crash thread collapses in using pointers to really create and destroy places in another thread, and the crash thread just uses this pointer copy.
These two operations are sent in two threads.

Summary of issues:

For the wild pointer problem, when the source of the problem found that the problem is relatively easy, but not found before the troubleshooting really tired, more is to test the psychological quality of personnel and analytical ability, summed up some experience as follows:
1, need from the top of the crash point of the various call objects as intermediaries from the source to the place to cause the common pointer, to be careful, patient, the source and place a layer of traced source to find the problem.
2, to be good at analyzing the information provided in the log file, when the first crash is due to low-volume log output level and can not locate and solve the problem when you need to increase the log output level and add some auxiliary positioning output information, the next time the crash when the output of the log information will provide a great help.
3, solve the problem of the wild pointer by reading the code is very important, only in order to the problem when the number of program threads running, function and timing, and variable calls have a clear and comprehensive understanding.
4, when writing procedures to minimize the use of pointers to copy, if not to use, write code must have to have multi-thread running consciousness, from the root of the emergence of the wild pointer.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

A summary of the problems that occur when a pointer variable is simultaneously manipulated under a dual thread

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.