[sword-devel] 1.5.10RC1 available
Troy A. Griffitts
scribe at crosswire.org
Mon Oct 8 00:48:02 MST 2007
Karl and domcox,
Thank you both for spending time to track this down.
The junkbuf in SWBuf is a horrible risk and should be removed. I will
at least double the size for this release, but I might have time to
write a safe impl.
Again, thank you for reporting the issue.
-Troy.
Karl Kleinpaste wrote:
> Troy, on the strange key init bug that has haunted GnomeSword recently,
> domcox has made this observation to me:
>
> | If I increase the size of JUNKBUFSIZE in sword/include/swbuf.h from 8191
> | to 16383 (#define JUNKBUFSIZE 16383): the bug is gone.
> | I now suspect a memory overflow on a swbuf.appendFormatted or
> | swbuf.setFormatted as these methods are limited to JUNKBUFSIZE per call.
>
> I just tried this and can confirm it: Simply making JUNKBUFSIZE twice as
> large makes the problem disappear. GnomeSword makes pretty heavy use of
> appendFormatted() and setFormatted().
>
> I suspect that the issue is that the new modules have larger amounts of
> markup, and recent GnomeSword generates substantially more HTML on its
> own than was previously generated prior to blocked Strongs/morph/lemma
> markup. This combines with the fact that we're seeing this only in
> Greek modules, which are using wide characters, and all in all, it looks
> like we're just generating more stuff than will fit in 8k.
>
> Such a situation is consistent with the increasingly random nature of
> where we've been seeing failures -- at this point, the getZeroContent()
> previously used is gone entirely (because the routine's content has been
> subsumed into another), but we still consistently see the bug (with
> original JUNKBUFSIZE) in the same Greek chapters...and I can make the
> bug stop happening by disabling some of the Strongs/lemma/morph
> features, thus reducing the size of the overall content that is
> formatted and then shipped to the HTML widget.
>
> Is there any grief that can be expected from making a permanent change
> to 16k? We appear to have no reason to suspect anything stranger than
> that overly long appends to a SWbuf are leading to random memory
> corruption in following data structures in memory.
>
> I really hope we're analyzing this correctly...
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
More information about the sword-devel
mailing list