Upgrade error with updater.phar (occ upgrade phase)

After having issues with the upgrade procedure I downloaded the upgrader.phar file and started the upgrade as suggested.

However, the upgrade fails finally in the occ upgrade steps:

Drop old database table: gallery_albums
Drop old database table: gallery_photos
31/31 [============================] 100%
Remove old (< 9.0) calendar/contact shares
Starting …
Starting …
Starting …
Starting …
Starting …
4/4 [============================] 100%
Fix permissions so avatars can be stored again
Starting …
Starting …
Done
2/2 [============================] 100%
Repair unmerged shares
Starting …
Starting …
Starting …
Starting …
3/3 [============================] 100%
**Starting code integrity check…
***** Error in `php’: malloc(): memory corruption: 0xb874b010 ***
**Magick: abort due to signal 6 (SIGABRT) “Abort”…
**Aborted

I repeated the procedure many times without luck. I also executed

sudo -u www-data php occ maintenance:update:htaccess
sudo -u www-data php occ maintenance:repair

and tried again without luck.

How I can complete the upgrade?