# vtkJSONDataSetWriter crashes when CellData contains StringArray

**URL:** https://discourse.vtk.org/t/vtkjsondatasetwriter-crashes-when-celldata-contains-stringarray/2005
**Category:** Development
**Created:** [October 30, 2019, 10:16am UTC](https://discourse.vtk.org/t/vtkjsondatasetwriter-crashes-when-celldata-contains-stringarray/2005 "2019-10-30T10:16:42Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![lukas](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/l/e9a140/32.png) [@lukas](https://discourse.vtk.org/u/lukas)
#### Post date: [October 30, 2019, 10:16am UTC](https://discourse.vtk.org/t/vtkjsondatasetwriter-crashes-when-celldata-contains-stringarray/2005/1 "2019-10-30T10:16:42Z")

</div>

Hello,

The vtkJSONDataSetWriter seems to have an issue, when the DataSet contains cell data with non-vtkDataArray (e.g. StringArray). This kind of DataSet causes Paraview to crash during “Export Scene”.

Here is the test file that caused the issue:  
[test\_withStringArray.vtu](https://discourse.vtk.org/uploads/short-url/o34MeNmkjeKuyBkwSJFjLsFxouc.vtu) (2.5 KB)

To reproduce this issue:

1. Load test\_withStringArray.vtu into Paraview 5.7.0
2. Export the scene as vtkjs
3. Paraview crashes

The core dump ends with these lines:

> 18 0x7f3211290b91 vtkJSONSceneExporter::WriteData() + 737  
> 17 0x7f321128f51f vtkJSONSceneExporter::WriteDataObject(std::ostream&, vtkDataObject\*, vtkActor\*) + 431  
> 16 0x7f321128f3e8 vtkJSONSceneExporter::WriteDataObject(std::ostream&, vtkDataObject\*, vtkActor\*) + 120  
> 15 0x7f321128d5e3 vtkJSONSceneExporter::WriteDataSet(vtkDataSet\*, char const\*) + 1779  
> 14 0x7f320a5f350c vtkWriter::Write() + 44  
> 13 0x7f3206448344 vtkStreamingDemandDrivenPipeline::UpdateWholeExtent() + 356  
> 12 0x7f32064491ef vtkStreamingDemandDrivenPipeline::Update(int, vtkInformationVector\*) + 255  
> 11 0x7f320640a2aa vtkDemandDrivenPipeline::UpdateData(int) + 138  
> 10 0x7f3206447c91 vtkStreamingDemandDrivenPipeline::ProcessRequest(vtkInformation\*, vtkInformationVector\*\*, vtkInformationVector\*) + 801  
> 9 0x7f320640b777 vtkDemandDrivenPipeline::ProcessRequest(vtkInformation\*, vtkInformationVector\*\*, vtkInformationVector\*) + 1447  
> 8 0x7f3206405dd1 vtkCompositeDataPipeline::ExecuteData(vtkInformation\*, vtkInformationVector\*\*, vtkInformationVector\*) + 257  
> 7 0x7f3206408bd7 vtkDemandDrivenPipeline::ExecuteData(vtkInformation\*, vtkInformationVector\*\*, vtkInformationVector\*) + 55  
> 6 0x7f320640e640 vtkExecutive::CallAlgorithm(vtkInformation\*, int, vtkInformationVector\*\*, vtkInformationVector\*) + 64  
> 5 0x7f320a5f366c vtkWriter::RequestData(vtkInformation\*, vtkInformationVector\*\*, vtkInformationVector\*) + 92  
> 4 0x7f321128afa4 vtkJSONDataSetWriter::WriteData() + 2340  
> 3 0x7f3211289ecf vtkJSONDataSetWriter::WriteDataSetAttributes(vtkDataSetAttributes\*, char const\*) + 943  
> 2 0x7f32112887bc vtkJSONDataSetWriter::WriteArray(vtkDataArray\*, char const\*, char const\*) + 76  
> 1 0x7f3211287f54 vtkJSONDataSetWriter::GetUID(vtkDataArray\*, bool&) + 20  
> 0 0x7f3217c74f20 /lib/x86\_64-linux-gnu/libc.so.6(+0x3ef20) [0x7f3217c74f20]  
> ( 27.195s) [paraview] :0 FATL| Signal: SIGSEGV

Regards  
Lukas

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [October 30, 2019, 5:59pm UTC](https://discourse.vtk.org/t/vtkjsondatasetwriter-crashes-when-celldata-contains-stringarray/2005/2 "2019-10-30T17:59:30Z")

</div>

Thanks Lukas for reporting the issue, I’ll see what I can do to make sure the StringArrays get skipped for now.

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [October 31, 2019, 2:56pm UTC](https://discourse.vtk.org/t/vtkjsondatasetwriter-crashes-when-celldata-contains-stringarray/2005/3 "2019-10-31T14:56:02Z")

</div>

This [PR](https://gitlab.kitware.com/vtk/vtk/merge_requests/6136) will take care of it.
