setOptimizationProfile crashed

I have a dynamic input trt model, I want to use context.setBindingDimensions to run dynamic input batch, according to the doc, before this, I need to call context.setOptimizationProfile to set profile, but when I call this, the app exit with code 139. I have checked context.getEngine().getNbOptimizationProfiles(), it is 1