VTK-7.1: vtkDataWriter doesn't handle vtkBitArray properly for binary file output
While most vtkXxxArrays were ported to vtkAOSDataArrayTemplate vtkBitArray was not,. However, in the binary writer the following code can be found:
unsigned char *cptr=
static_cast<vtkUnsignedCharArray *>(data)->GetPointer(0);
As a result the GetPointer() method of vtkAOSDataArrayTemplate is called and segfaults because the underlying data structure of vtkUnsignedCharArray is now completely different.
Using
unsigned char *cptr = static_cast<unsigned char*>(data->GetPointer(0));
should fit this. (BTW: Considering that then the unsigned char * is cast to char * it might make sense to directly cast to char *.)