[reportlab-users] pyRXP - strange non-deterministic errors on python 2.7 and 64-bit Linux

Tim Roberts timr at probo.com
Thu May 19 13:23:08 EDT 2011


Roger Whittaker wrote:

> On Wed, May 18, 2011 at 04:57:22PM -0700, Tim Roberts wrote:

>>

>> My guess is that somebody slipped a clever optimization into the x86-64

>> gcc runtime library that triggered this behavior.

> As far as I can tell, it's not gcc: I built pyRXP with gcc 3.3 (as

> opposed to 4.5) on the same system where I was originally testing

> and still saw the errors.


Well, it IS in gcc (glibc, actually), but I want to make it clear that
this is not a bug in glibc. It's a usage problem.

Let me provide an example of how this kind of thing can happen.
Consider the following C code:

char buffer[20] = "abcdefgh";
strcpy( buffer[1], buffer[0] );

One might hope that the results of this would be "aabcdefgh". But if
you consider a simple implementation of strcpy:

while( *psrc )
*pdst++ = *psrc++;

That will produce the result "aaaaaaaaaaaaaaaaaaaaaaaa..." until it
overwrites code and crashes.

Both of those results are perfectly valid behavior on the part of
strcpy, according to the ANSI standard. The problem here is very
similar, except the copy is being done 8 bytes at a time.

--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the reportlab-users mailing list