c++ - How to use mtrace for server -


I have successfully used mtrace () in my program, but it's only 16MB The unreadable file is created, I have read that I should use to create a readable file:

  mtrace ./myexe log  

The problem is that I have a server that has some logic and I have to run an application for it, I tried to run it:

  mtrace "./server args" log  

But instead of opening Waiting for server and application on the server, it only outputs the list of non-free memory.

So my question is how do I correctly use mtrace for the server?

Edit:

Run mtrace with unreadable files let me do this:

  mtrace "./server args There are many lines like this:  
  - 0x0000000003941404040440 Free 224404 was never done 0x2384d8b  

And this:

  Memory is not free: ----------------- Address shape caller 0x00000000039600f0 0x48 0x238766c 0x00000000039739e0 0x38f 0x37f0c0cbad 0x00007fc398000960 0x75 on 0x7fc3f3f0b2fd 0x00007fc3980009e0 0x30 on 0x7fc3f3f0b2fd 0x00007fc3c0001240 0x26 on 0x7fc3f3f0b2fd 0x00007fc3c00012a0 0x7fc3f3f0b2fd on 0x7fc3f3f0b2fd 0x00007fc3c0001f20 0x2a on 0x7fc3f3f0b2fd 0x00007fc3c0001ee0 0x29 to 0x27 0x00007fc3c0001f90 On 0x7fc3f3f0b2fd 0x00007fc3c0001fd0 0x22 to 0x2a on 0x7fc3f3f0b2fd 0x00007fc3c00026c0 0x29 on 0x7fc3f3f0b2fd 0x00007fc3c0002030 0x2a 0x7fc3f3f0b2fd 0x00007fc3c0002700 0x22 0x7fc3f3f0b2fd 0x00007fc3c0002730 0x29 on 0x7fc3f3f0b2fd 0x00007fc3c00032d0 0x26 on 0x7fc3f3f0b2fd 0x00007fc3c00034d0 0x27 on 0x7fc3f3f0b2fd 0x00007fc3c00035b0 0x22 on 0x7fc3f3f0b2fd 0x00007fc3c00035e0 0x7fc3f3f0b2fd on 0x37f1081182 0x00007fc3c00084b0 0x28 to 0x37 to 0x29 0x00007fc3c00082b0 0x9 0x7fc3f3f0b2fd 0x00007fc3c000a2f0 0xb on f1081182 0x00007fc3c000a650 0x26 0x7fc3f3f0b2fd 0x00007fc3c000ac10 0x7fc3f3f0b2fd 0x00007fc3c000af90 0x7fc3f3f0b2fd 0x00007fc3c000b870 0x38 W on 0x7fc3f3f0b2fd 0x00007fc3c0011fd0 0x1e on 0xc on 0x7fc3f3f0b2fd 0x00007fc3c0012c30 0x40 on 0x7fc3f3f0b2fd 0x00007fc3c0012040 0x2a on 0x37f1081182 0x00007fc3c0014f10 on 0x7fc3f3f0b2fd 0x00007fc3c0014700 0xb on 0x1e 0x37f1081182 0x00007fc3c000b360 0x29 0x7fc3f3f0b2fd 0x00007fc3c000ede0 0xc on 0x37f1081182 0x00007fc3c00118a0 0x22 on 0x7fc3f3f0b2fd 0x00007fc3c0011f30 0x37f1081182 on 0x2c 0x00007fc3c0014fa0 0xb on 0x37f1081182 0x00007fc3c00151d0 0x88 on 0x7fc3f7cc05c9 0x00007fc3c001d4b0 0x37f1081182 0x00007fc3c003e960 on 0xb on 0x7fc3f7cc05c9 0x00007fc3c0024a00 at 0x88 0x40 0x7fc3f3f0b2fd 0x00007fc3c003edb0 0x88 on 0x7fc3f3f0b2fd 0x00007fc3c003ee40 0x170 on 0xb on 0x7fc3f3f0b2fd 0x00007fc3c003f050 on 0x37f0c118a3 0x00007fc3c003efc0 0x88 0x170 on 0x37f0c118a3 0x00007fc3c003f1d0 0x88 on 0x7fc3f3f0b2fd 0x00007fc3c003f260 0x170 on 0x37f0c118a3 0x00007fc3c003f3e0 0x88 on 0x7fc3f3f0b2fd 0x00007fc3c003f470 0x170 on 0x37f0c118a3 0x00007fc3c003f5f0 0x88 on 0x7fc3f3f0b2fd 0x00007fc3c003f680 0x170 on 0x37f0c118a3 0x00007fc3c003f800 0x37f0c118a3 on 0x7fc3f3f0b2fd 0x00007fc3c003f890 0x170 to 0x88 0x00007fc3c0040890 0 0x7fc3f3f0b2fd 0x7fc3efa7e on    

I think about using the mtrace command Are misunderstanding. Based on this, it seems that mtrace only converts logfile into something human readable. In order to create a logfile in the first place, you need to run the application.

To do this, create is a logfile that you previously enabled to reconnect with mtrace () (C function) and debugging in your code. Please. Next you normally run the program:

  ./ server args  

that will write any memory problem in a lamphil whose name is MALLOC_TRACE Environment variables

Then read the logfile that you run

  mtrace server & lt; Logfilename & gt;  

Edit: For general debugging of memory problems, I will advise you to search for Valgrind instead (unless you know about Valgrind and its proper reason Has not been used for the case). / P>


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -