PETSc matrix-matrix multiplication got signal number 11 error in parallel

To answer my own question:

The above return value PETSc.Mat As is not finalized as stated:

To make it completed, it should be followed by

As.assemble()

N.B. For a assembled vector (PETSc.Vec), its ghost info in parallell should be specified with

bs = assemble_vector(L)
b.ghostUpdate(...)

See