I guess it would help if I would attach the patch!

Attachment: plbuf_bugfix.patch
Description: Binary data

On Jan 28, 2015, at 9:59 PM, Jim Dishaw <j...@dishaw.org> wrote:

> While working on the plot metafile, I fixed a segfault issue that Phil was 
> having with his wxWidgets work.  I made a patch that fixes this issue.  I 
> don't know about the need to push this to patch to master.  The only jarring 
> behavior is a plexit() call that I put in plbuf_control() to catch 
> unrecognized commands.  It is way to catch problems in the plot buffer when 
> working on the code.
> 
> The patch also has some other changes, but there was no easy way to make a 
> patch without those changes.  A quick summary of the changes:
> 
> Removed unneeded malloc() and memcpy for LINE, POLYINE, and FILL when
> remaking the plot.  Temporary storage was used because of the old
> file-based buffer approach.  With the removal of file-based buffer
> code, a different apporach that uses pointers into the plot buffer could
> be used.
> 
> Fixed the bug that caused random segfaults.  This could be manifested
> in several ways, one of them being a POLYLINE with over a billion nodes.
> The root cause was a mismatch in the data sizes between the buffer writer
> and the buffer reader (a wrong sizeof() was used).  Changed the code
> to use sizeof(variable) instead of sizeof(data type).
> 
> Changed the buffer writer to maintain two-byte alignment.  This should
> avoid the performance penalty associated with misaligned arrays.
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> Plplot-devel mailing list
> Plplot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/plplot-devel

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to