DEMToImageGenerator crash / strange output

Description

I'm trying to run the DEMToImageGenerator example, but I feel like I'm missing something.

Steps to reproduce

$ bin/DEMToImageGenerator out.tif outpr.tif 35 50 6000 6000 0.000833333333333 -0.000833333333333 /Downloads/europe/
2020-05-19 15:01:23 (INFO): Default RAM limit for OTB is 256 MB
2020-05-19 15:01:23 (INFO): GDAL maximum cache size is 795 MB
2020-05-19 15:01:23 (INFO): OTB will use at most 8 threads
2020-05-19 15:01:23 (INFO): Estimated memory for full processing: 549.24MB (avail.: 256 MB), optimal image partitioning: 3 blocks
2020-05-19 15:01:23 (INFO): File out.tif will be written in 4 blocks of 3472x3472 pixels
[~3 minutes later]
Segmentation fault (core dumped)

That's the SRTM DEM. With a lower output resolution the output seems random:

$ bin/DEMToImageGenerator out.tif outpr.tif 35 50 600 600 0.00833333333333 -0.00833333333333 /Downloads/europe/

image

image

The coordinates should correspond to the extent of srtm_44_03.tif:

Data axis to CRS axis mapping: 2,1
Origin = (35.000000000000000,50.000000000000000)
Pixel Size = (0.000833333333333,-0.000833333333333)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=DEFLATE
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  35.0000000,  50.0000000) ( 35d 0' 0.00"E, 50d 0' 0.00"N)
Lower Left  (  35.0000000,  45.0000000) ( 35d 0' 0.00"E, 45d 0' 0.00"N)
Upper Right (  40.0000000,  50.0000000) ( 40d 0' 0.00"E, 50d 0' 0.00"N)
Lower Right (  40.0000000,  45.0000000) ( 40d 0' 0.00"E, 45d 0' 0.00"N)
Center      (  37.5000000,  47.5000000) ( 37d30' 0.00"E, 47d30' 0.00"N)

The output coordinates match that if you account for the difference in precision and/or the pixel convention:

Size is 600, 600
Origin = (34.995833333333337,50.004166666666663)
Pixel Size = (0.008333333333330,-0.008333333333330)
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  34.9958333,  50.0041667) 
Lower Left  (  34.9958333,  45.0041667) 
Upper Right (  39.9958333,  50.0041667) 
Lower Right (  39.9958333,  45.0041667) 
Center      (  37.4958333,  47.5041667) 

Also, GDAL seems much faster than OTB even accounting for any resampling:

time gdalwarp -te 34.9958333 45.0041667 39.9958333 50.0041667 -r cubic -overwrite ~/Downloads/europe/europe.vrt outgdal.tif
Creating output file that is 6000P x 6000L.
Processing ~/Downloads/europe/europe.vrt [1/1] : 0...10...20...30...40...50...60...70...80...90...100 - done.
gdalwarp -te 34.9958333 45.0041667 39.9958333 50.0041667 -r cubic -overwrite   2.06s user 0.19s system 99% cpu 2.254 total

Configuration information

Ubuntu 18.04, OTB develop HEAD, system libs.