Didn't get any answer from the user's list, so I'm reposting it
here.  Basically want to know how I could write 50+ files using a
vtkDataSetWriter that I can't read with a vtkDataSetReader, and lookin
for a workaround. <br><br>---------- Forwarded message ----------<br><span class="gmail_quote">From: <b class="gmail_sendername">Randall Hand</b> &lt;<a href="mailto:randall.hand@gmail.com">randall.hand@gmail.com</a>&gt;
<br>Date: Sep 29, 2005 8:45 AM<br>Subject: Problem with vtkDataSetReader<br>To: vtkusers &lt;<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>&gt;<br><br></span>I have a piece of code that loads a text file into memory as a
vtkImageData, and then hooks it to a vtkDataSetWriter to write it to a
binary Legacy VTK file.&nbsp; That seems to work just fine, and i've
been using it for months without any trouble.<br>
<br>
However, I just converted a new file and when I try to load it with a
separate VTK program, it segfaults.&nbsp; This new imaging app seems to
be fine, as I can run it with other (larger 768^3 and smaller 128^3)
datasets, but this 640^3 yields segfaults.&nbsp; By enabling
-&gt;DebugOn on the reader, I see the following just prior to crash:<br>
<br style="font-family: courier new,monospace;">
<div style="margin-left: 40px;"><span style="font-family: courier new,monospace;">Debug: In /viz/home/rhand/src/ezViz/Utilities/VTK/IO/vtkDataReader.h, line 170</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">vtkDataSetReader (10037248): vtkDataSetReader (10037248): returning LookupTableName of (null)</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Debug: In /viz/home/rhand/src/ezViz/Utilities/VTK/IO/vtkDataReader.h, line 176</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">vtkDataSetReader (10037248): vtkDataSetReader (10037248): returning FieldDataName of (null)</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Debug: In /viz/home/rhand/src/ezViz/Utilities/VTK/IO/vtkDataReader.h, line 181</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">vtkDataSetReader (10037248): vtkDataSetReader (10037248): returning ReadAllScalars of 0</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Debug: In /viz/home/rhand/src/ezViz/Utilities/VTK/IO/vtkDataReader.h, line 187</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">vtkDataSetReader (10037248): vtkDataSetReader (10037248): returning ReadAllVectors of 0</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Debug: In /viz/home/rhand/src/ezViz/Utilities/VTK/IO/vtkDataReader.h, line 193</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">vtkDataSetReader (10037248): vtkDataSetReader (10037248): returning ReadAllNormals of 0</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Debug: In /viz/home/rhand/src/ezViz/Utilities/VTK/IO/vtkDataReader.h, line 199</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">vtkDataSetReader (10037248): vtkDataSetReader (10037248): returning ReadAllTensors of 0</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Debug: In /viz/home/rhand/src/ezViz/Utilities/VTK/IO/vtkDataReader.h, line 205</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">vtkDataSetReader (10037248): vtkDataSetReader (10037248): returning ReadAllColorScalars of 0</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Debug: In /viz/home/rhand/src/ezViz/Utilities/VTK/IO/vtkDataReader.h, line 211</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">vtkDataSetReader (10037248): vtkDataSetReader (10037248): returning ReadAllTCoords of 0</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Debug: In /viz/home/rhand/src/ezViz/Utilities/VTK/IO/vtkDataReader.h, line 217</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">vtkDataSetReader (10037248): vtkDataSetReader (10037248): returning ReadAllFields of 0</span><br style="font-family: courier new,monospace;">
<br clear="all">
</div>
At this point in the code, i've only done the following:<br>
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; vtkDataSetReader *reader = vtkDataSetReader::New();</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; reader-&gt;DebugOn();</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; reader-&gt;SetFileName(argv[1]);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; reader-&gt;Update();</span><br>
<br>
A dbx on the coredump shows the following:<br>
<div style="margin-left: 40px; font-family: courier new,monospace;">dbx version 7.3.4 (86441_Nov11 MR) Nov 11 2002 11:31:55<br>
Core from signal SIGSEGV: Segmentation violation<br>
(dbx) where<br>
Thread 0x10000<br>
&gt;&nbsp; 0 std::__find_if(const char*,const
char*,std::unary_negate&lt;std::__N1::Is_mask&gt;,std::random_access_iterator_tag)(0x7ffdf8000b9,
0x800df8000ba, 0x85e0c84, 0x8000000810037820, 0x100000001, 0x0, 0x19,
0x1003be40)
[&quot;/j10/mtibuild/v741m/workarea/v7.4.1m/libC/include/stl_algo.h&quot;:159,
0xd8b6ba0]<br>
&nbsp;&nbsp; 1
std::ctype&lt;char&gt;::scan_not(std::ctype_base::mask,const
char*,const char*) const(0xd9587c4, 0x80000008, 0x85e0c84,
0x8000000810037820, 0x100000001, 0x0, 0x19, 0x1003be40)
[&quot;/j10/mtibuild/v741m/workarea/v7.4.1m/libC/include/stl_algo.h&quot;:200,
0xd8b7e14]<br>
&nbsp;&nbsp; 2
std::_Scan_for_not_wspace&lt;std::char_traits&lt;char&gt;
&gt;::operator()(const char*,const char*) const(this = 0xfffffff97c0,
__first = 0x7ffdf8000b9, __last = 0x800df8000ba = &quot;&quot;)
[&quot;/opt/pkg/MIPSpro/7.4/usr/include/CC/istream&quot;:323, 0x41f9d20]<br>
(dbx)<br>
<br>
<br>
</div>
Anyone have any idea what's going wrong?<br><span class="sg">
<br>-- <br>Randall Hand<br>Visualization Scientist, <br>ERDC-MSRC Vicksburg, MS<br>Homepage: <a href="http://www.yeraze.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.yeraze.com</a>


</span><br clear="all"><br>-- <br>Randall Hand<br>Visualization Scientist, <br>ERDC-MSRC Vicksburg, MS<br>Homepage: <a href="http://www.yeraze.com">http://www.yeraze.com</a>