Paraview crash when I tried to open a pvd file

There is something wrong when I tried to open the dispgelGTF11NCSN.pvd with paraview.
But it failed ,and crashed .

# Create output files
file_p = XDMFFile(comm, "crackgelGTF11NCSN.pvd")
file_u = XDMFFile(comm, "dispgelGTF11NCSN.pvd")

for file in [file_u, file_p]:
    file.parameters['rewrite_function_mesh'] = False
    file.parameters['flush_output'] = True

# Solve variational problem
cnt = 0; 
for x in np.linspace(0.0,dispMax,nSteps):
    
    # Update displacement BC 
    dispr1.uxr = x 
    # Print simulation information
    if mpiRank == 0: # only prints on processor 0 (parallel runs)
        print "\nStep: ", cnt, "/", nSteps - 1
        print "Strain: ", 100.0*x/100., "%"
    
    # Solve loop for crack convergence
    diff = 1.0; crack_iter = 0
    while diff > 1.e-3 and crack_iter <= 199: # check for stationary crack
        
        # Update crack convergence loop counter
        crack_iter = crack_iter + 1

        # Update the displacements
        #(itern, converged) = solver_u.solve(umin, umax)
        solver_u.solve() 
        # Update the crack
        solver_alpha_p.solve(problem_alpha, phi.vector(), lbp.vector(), ubp.vector())
        # Difference between current and previous PFF solution
        diff = norm(phi.vector() - phi0.vector(),'linf')
        if mpiRank == 0:
            print 'Crack Iteration: ', crack_iter
            print 'Crack convergence: ', diff
        # Set new crack values to old values

        phi0.assign(phi)
    if crack_iter == 200:
        print 'crack iteration fails' 
        exit()
    # Updating the upper bound to account for the irreversibility
    ubp.vector()[:] = phi.vector()
    u0.assign(u)
    # Update simulation counter
    cnt = cnt + 1
    bForce = assemble(PK[1,1]*ds(2))
    if mpiRank == 0:
        print 'Force=',bForce
    
    # Save solution
    if cnt % save_cnt == 0:
        file_u.write_checkpoint(u0,x)
        file_p.write_checkpoint(phi,x)
        sa1="%.9f"%(dispr1.uxr) + ',    ' + "%.9f"%(bForce)
        my_file.write(sa1)
        my_file.write('\n')

I’m new to Fenics and Paraview. Are there any errors in the process of generating files?
Or whether there are related tutorials about the question?

These files should not have the pvd extension, but xdmf, i.e.

# Create output files
file_p = XDMFFile(comm, "crackgelGTF11NCSN.xdmf")
file_u = XDMFFile(comm, "dispgelGTF11NCSN.xdmf")

Thanks for your reply. I change the script into

# Create output files
file_p = XDMFFile(comm, "crackgelGTF11NCSN.xdmf")
file_u = XDMFFile(comm, "dispgelGTF11NCSN.xdmf")

but it didn’t work and tell me an error like this

ERROR: In /build/paraview-NGLASM/paraview-5.0.1+dfsg1/ParaViewCore/ServerImplementation/Core/vtkSIProxy.cxx, line 310
vtkSISourceProxy (0x98422d8): Failed to create vtkXdmfReader. Aborting for debugging purposes.


Aborted (core dumped)

As I cannot reproduce your issue, as your code is not standalone (I cannot copy past it and run it due to lack of variable definitions), I suggest you try it on an even simpler example.

Have you tried to run it on:
https://fenicsproject.org/olddocs/dolfin/latest/python/demos/poisson/demo_poisson.py.html
where you replace the File with XDMFFile and the write_checkpoint command?