You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Murphy, James" <Ja...@excelergy.com> on 2001/09/19 17:57:57 UTC

GeneralAttributeCheck threading bug?

Hi all,

I have been seeing some really weird schema validation errors when parsing
simultaneously across several threads.  I have tracked the problem down to
what I believe is an error in GeneralAttributeCheck.  It appears as though
the GeneralAttributeCheck has a static instance (singleton) of its self that
it hands out to TraverseSchema.  This isn't a problem but the fact that
GeneralAttributeCheck contains an XMLBuffer instance that it uses for
various string manipulations is the issue.  In GeneralAttributeCheck.cpp
line 792, the XMLBuffer fBuffer member is used to store the attribute value.
The raw buffer is passed to validate() to perform validation.  If another
thread is performing attribute validation fBuffer is overwritten.  This
causes the validation to fail.

I just wanted to verify with the community that this is in fact a problem,
or is a usage issue?

Regards,
Jim

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: GeneralAttributeCheck threading bug?

Posted by Khaled Noaman <kn...@ca.ibm.com>.
Hi James,

The 'GeneralAttributeCheck' has a threading bug. You are correct about the fact
that the XMLBuffer object will be overwritten when several theads are running at
the same time. Would you please open a Bugzilla bug for that problem?

Thanks,
Khaled

"Murphy, James" wrote:

> Hi all,
>
> I have been seeing some really weird schema validation errors when parsing
> simultaneously across several threads.  I have tracked the problem down to
> what I believe is an error in GeneralAttributeCheck.  It appears as though
> the GeneralAttributeCheck has a static instance (singleton) of its self that
> it hands out to TraverseSchema.  This isn't a problem but the fact that
> GeneralAttributeCheck contains an XMLBuffer instance that it uses for
> various string manipulations is the issue.  In GeneralAttributeCheck.cpp
> line 792, the XMLBuffer fBuffer member is used to store the attribute value.
> The raw buffer is passed to validate() to perform validation.  If another
> thread is performing attribute validation fBuffer is overwritten.  This
> causes the validation to fail.
>
> I just wanted to verify with the community that this is in fact a problem,
> or is a usage issue?
>
> Regards,
> Jim
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org