I need to correct myself. By debugging, I found that the code line that causes segmentation fault is
scattered_field_data = -slp_pot * lambda_data
The solver succeeded but calculation of scattered electric field failed. If a small number of elements is used, the program runs fine. The largest number of edges that can let the program succeeds is about 2000, My machine has 32 GB RAM, so 2000 edges should not cause any problems.
Could you anybody help to resolve this issue? I hope bempp could be a useful tool for my project.