Unable to Start PacketTunnel Provider

While generating the Xcode build with Address Sanitizer enabled, I am unable to launch the PacketTunnelProvider provider.

The process is getting killed by the Operating System with the below exception "Thread 1: EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=50 MB, unused=0x0)"

I understood that since Packettunnel Provider extension has only a memory limit of 50 MB, Operating System is killing the process. Is there any other way, we can overcome this limitation and perform Address Sanitizer testing ?

Is there any other way, we can overcome this limitation and perform Address Sanitizer testing ?

There is some advice on this in the Locate Memory Corruption Issues in Your Code section:

For most use cases, the overhead that Address Sanitizer adds to your code should be acceptable for daily development. Running your code with Address Sanitizer increases memory usage by two to three times, and also adds 2x to 5x slowdown of your code. To improve your code’s memory usage, compile your code with the -O1 optimization.

So you could try this to see if it makes a difference in your Packet Tunnel debugging. If it does not then falling back to LLDB may be the only other alternative.

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
Unable to Start PacketTunnel Provider
 
 
Q