Sentinel-1 calibration + orthorectification: segfault

Hi all,

I have a working OTB chain to compute SAR backscatter, (very similar to S1 tiling), and most of the time it works fine.j
We do however get segmentation faults for requesting specific areas in certain products. One hypothesis is that it happens when the requested area lies outside of the data footprint, but not entirely sure about that.

This is a stripped down version of the code:

# SARCalibration
    sar_calibration = otb.Registry.CreateApplication('SARCalibration')
    sar_calibration.SetParameterString("in", str(input_tiff))
    sar_calibration.SetParameterString("lut", "sigma")
    sar_calibration.SetParameterValue('removenoise', True)
    sar_calibration.SetParameterInt('ram', 128)
    

    # OrthoRectification
    ortho_rect = otb.Registry.CreateApplication('OrthoRectification')
    ortho_rect.ConnectImage("io.in", sar_calibration, "out")

    
    ortho_rect.SetParameterString("map", "utm")
    ortho_rect.SetParameterInt("map.utm.zone", utm_zone)
    ortho_rect.SetParameterValue("map.utm.northhem", utm_northhem)
    ortho_rect.SetParameterFloat("outputs.spacingx", 10.0)
    ortho_rect.SetParameterFloat("outputs.spacingy", -10.0)
    ortho_rect.SetParameterString("interpolator", "linear")
    ortho_rect.SetParameterFloat("opt.gridspacing", 40.0)

    ortho_rect.SetParameterInt("outputs.sizex", 256)
    ortho_rect.SetParameterInt("outputs.sizey", 256)
    ortho_rect.SetParameterInt("outputs.ulx", int(extent["xmin"]))
    ortho_rect.SetParameterInt("outputs.uly", int(extent["ymax"]))
    ortho_rect.Execute()
    ortho_rect.GetImageAsNumpyArray('io.out')

I could reproduce consistently with this product + extent:
S1B_IW_GRDH_1SDV_20191113T155500_20191113T155514_018911_023AAD_5A9C.SAFE
key_epsg = 32635
key_ext = {‘xmin’: 440320.0, ‘ymin’: 6203400.0, ‘xmax’: 442880.0, ‘ymax’: 6205960.0}

My logging reveals similar segfaults for these combinations, but of course, I don’t know if it is always the same cause:
S1B_IW_GRDH_1SDV_20200405T155457_20200405T155511_021011_027DAF_40C9.SAFE/measurement/s1b-iw-grd-vv-20200405t155457-20200405t155511-021011-027daf-001.tiff {‘xmin’: 499200.0, ‘ymin’: 6223880.0, ‘xmax’: 500480.0, ‘ymax’: 6225160.0} EPSG 32635

S1B_IW_GRDH_1SDV_20200405T155457_20200405T155511_021011_027DAF_40C9.SAFE/measurement/s1b-iw-grd-vh-20200405t155457-20200405t155511-021011-027daf-002.tiff {‘xmin’: 441600.0, ‘ymin’: 6203400.0, ‘xmax’: 442880.0, ‘ymax’: 6204680.0} EPSG 32635

S1B_IW_GRDH_1SDV_20200331T154629_20200331T154659_020938_027B71_117F.SAFE/measurement/s1b-iw-grd-vh-20200331t154629-20200331t154659-020938-027b71-002.tiff {‘xmin’: 514560.0, ‘ymin’: 6202120.0, ‘xmax’: 515840.0, ‘ymax’: 6203400.0} EPSG 32635

S1B_IW_GRDH_1SDV_20200331T154629_20200331T154659_020938_027B71_117F.SAFE/measurement/s1b-iw-grd-vh-20200331t154629-20200331t154659-020938-027b71-002.tiff {‘xmin’: 547840.0, ‘ymin’: 6208520.0, ‘xmax’: 549120.0, ‘ymax’: 6209800.0} EPSG 32635

S1B_IW_GRDH_1SDV_20200331T154629_20200331T154659_020938_027B71_117F.SAFE/measurement/s1b-iw-grd-vv-20200331t154629-20200331t154659-020938-027b71-001.tiff {‘xmin’: 531200.0, ‘ymin’: 6214920.0, ‘xmax’: 532480.0, ‘ymax’: 6216200.0} EPSG 32635

Dear @jdries,

Thank you for your report. I was able to reproduce this bug. I opened an issue on gitlab, our development platform.

Best regards.