[vtkusers] string compare bug?

Kevin Wright krw at viz-solutions.com
Mon Oct 7 16:19:14 EDT 2002


I just tracked down what looks like an odd bug, and I was wondering if 
anyone out there had any insight.

I'm using a vtkPolyDataReader object to field incoming polydata definitions 
through a socket.  I do this by reading the polydata from the socket into a 
string, then using the input string in the vtkDataReader.

Everything generally worked fine, except in some cases the pipeline would 
not update when new data came down the socket.  Eventually I tracked the 
problem down to vtkDataReader::SetInputString which, before assigning the 
string, does a string compare between the old and new string.

When the new and old datasets were very similar (usually identical 
geometry, slightly changed scalar values) the strncmp would return a 
match.  The string length was correct, and once the string compare was 
removed, everything worked fine.

I'm working on a Windows 2000 machine with VC++ 6.0.  I'm about to try the 
same thing on IRIX and Linux to see what happens, but I was wondering:

1. Has anyone seen this kind of behavior before?
2. Should the string compare really be there at all, given that these 
strings could be very long?

Regards,
Kevin.




More information about the vtkusers mailing list