the miniseed file available under the following link crashes obspy with a segmentation fault, as soon as you try to write it with STEIM2 encoding:
As you can see when you plot the data, there is a huge spike with a difference larger than 2**30 in the signal which probably causes the crash.
this has been fixed here: https://github.com/obspy/obspy/pull/1658
Fixed in the sense that it now returns a nice error message:
File "/Users/lion/workspace/code/obspy/obspy/core/stream.py", line
1442, in write
write_format(self, filename, **kwargs)
File "/Users/lion/workspace/code/obspy/obspy/io/mseed/core.py", line
922, in _write_mseed
C.byref(packedsamples), flush, verbose, msr) # NOQA
line 833, in _wrapper
obspy.io.mseed.InternalMSEEDError: Encountered 2 error(s) during a call
msr_encode_steim2(8X_CA04A__HHE_D): Unable to represent difference in <=
msr_pack(8X_CA04A__HHE_D): Error packing data samples
STEIM2 can just not store data with spikes of this magnitude.