The failure doesn't always happen, but it's more likely to happen when your BOOT_JDK is significantly different than the JDK sources in both age and 32/64 bit-ness.
=========
$ ./jdk-14-32bit/bin/java -version
java version "14-internal" 2020-03-17
Java(TM) SE Runtime Environment (build 14-internal+0-2019-06-19-0325035.iklam.null)
Java HotSpot(TM) Server VM (build 14-internal+0-2019-06-19-0325035.iklam.null, mixed mode, sharing)
$ ./jdk-12-64bit/bin/java -version
java version "12" 2019-03-19
Java(TM) SE Runtime Environment (build 12+33)
Java HotSpot(TM) 64-Bit Server VM (build 12+33, mixed mode, sharing)
$ ./jdk-12-64bit/bin/java -Xshare:dump -XX:SharedArchiveFile=jdk-12-64bit.jsa
Allocated shared space: 3221225472 bytes at 0x0000000800000000
Loading classes to share ...
Loading classes to share: done.
Reading extra data: done.
Rewriting and linking classes ...
Rewriting and linking classes: done
Number of classes 1244
instance classes = 1176
obj array classes = 60
type array classes = 8
Updating ConstMethods ... done.
Removing unshareable information ... done.
Scanning all metaspace objects ...
Allocating RW objects ...
Allocating RO objects ...
Relocating embedded pointers ...
Relocating external roots ...
Dumping symbol table ...
Dumping objects to closed archive heap region ...
Dumping objects to open archive heap region ...
Relocating SystemDictionary::_well_known_klasses[] ...
Removing java_mirror ... done.
mc space: 8560 [ 0.0% of total] out of 12288 bytes [ 69.7% used] at 0x0000000800000000
rw space: 4021160 [ 21.4% of total] out of 4022272 bytes [100.0% used] at 0x0000000800003000
ro space: 7380296 [ 39.3% of total] out of 7380992 bytes [100.0% used] at 0x00000008003d9000
md space: 2368 [ 0.0% of total] out of 4096 bytes [ 57.8% used] at 0x0000000800ae3000
od space: 6576528 [ 35.1% of total] out of 6578176 bytes [100.0% used] at 0x0000000800ae4000
ca0 space: 466944 [ 2.5% of total] out of 466944 bytes [100.0% used] at 0x00000007bfc00000
oa0 space: 290816 [ 1.6% of total] out of 290816 bytes [100.0% used] at 0x00000007bf800000
total : 18746672 [100.0% of total] out of 18755584 bytes [100.0% used]
$ ./jdk-14-32bit/bin/java -Xshare:auto -XX:SharedArchiveFile=jdk-12-64bit.jsa -XX:+VerifySharedSpaces -version
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0xf76a8ed9, pid=16082, tid=16083
#
# JRE version: (14.0) (build )
# Java VM: Java HotSpot(TM) Server VM (14-internal+0-2019-06-19-0325035.iklam.null, mixed mode, tiered, g1 gc, linux-x86)
# Problematic frame:
# C [libz.so.1+0x1ed9] crc32+0x159
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P" (or dumping to /jdk/dre/build/core.16082)
#
# An error report file with more information is saved as:
# /jdk/dre/build/hs_err_pid16082.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
Aborted (core dumped)
========
For another crash scenario, see JDK-8226404 "bootcycle build uses wrong CDS archive"