debug mode is ok, but release mode will encounter illegal address error

I am using nvdecoder to decode rtsp stream, and then use nvcaffe and tensorrt to do model forward(and I use gpu opencv to do some resize). everything is ok when I am using debug mode, but if I build it with release mode, there will be an encounter illegal address error