Occasionally Segfault in Transparent Mode

Steps to reproduce the problem:

1.Setup the mitmproxy in transparent mode (–mode transparent)
2.Load my script to monitor&modify the traffic (in which I catch all the exceptions)
3.The mitmdump will occasionally crack and the faulthandler outputs this:

Any other comments? What have you tried so far?

I use iptables to redirect the traffic from another user by nat:

iptables -t nat -A OUTPUT -p tcp -m owner --uid-owner mitmuser --dport 443 -j REDIRECT --to-port 8080
iptables -t nat -A OUTPUT -p tcp -m owner --uid-owner mitmuser --dport 80 -j REDIRECT --to-port 8080
ip6tables -t nat -A OUTPUT -p tcp -m owner --uid-owner mitmuser --dport 80 -j REDIRECT --to-port 8080
ip6tables -t nat -A OUTPUT -p tcp -m owner --uid-owner mitmuser --dport 443 -j REDIRECT --to-port 8080
sysctl -w net.ipv4.ip_forward=1
sysctl -w net.ipv6.conf.all.forwarding=1
System information

Mitmproxy: 3.0.3
Python: 3.5.2
OpenSSL: OpenSSL 1.1.0g 2 Nov 2017
Platform: Linux-4.4.0-116-generic-x86_64-with-Ubuntu-16.04-xenial