[xmlsec] xmlInitParser() crashes when timer functions are used like CreateTimerQueueTimer()

Yeshwanth C cyeshwanth at gmail.com
Thu Jan 4 21:52:15 PST 2007


It appears that if the thread is switched to some other thread, these calls
to libxml2 all fail.
Because when I ran the same code in a loop and checked the thread id, for
successful runs, the thread ids were all the same.
Could you tell me some way how to switch the thread back to the original
thread before calling these methods? or suggest some other solution?
Regards
Yeshwanth


On 1/5/07, Yeshwanth C <cyeshwanth at gmail.com> wrote:
>
> I just debugged the code.
> The error occurs at the following locations:-
>
> xmlGenericErrorFunc *
> __xmlGenericError(void) {
>     if (IS_MAIN_THREAD)
>  return (&xmlGenericError);
>     else
>  return (&xmlGetGlobalState()->xmlGenericError);
> }
>
> It goes there from here:-
> " if ((xmlGenericError == xmlGenericErrorDefaultFunc) ||
>  (xmlGenericError == NULL))" inside xmlInitParser()
>
> Regards
> Yesh
>
>
>
> On 1/5/07, Yeshwanth C <cyeshwanth at gmail.com> wrote:
> >
> > TimerRoutine is the CALLBACK function where xmlInitParser() is called.
> > Now at the particular time interval say 10 seconds TimerRoutine is called.
> > When xmlInitParser() call is reached it gives the error.  If the callback
> > comes on a different thread, will xmlInitParser() crash?
> > Because if I call TimerRoutine directly from some function but not via
> > CALLBACK it works ok.
> >
> >
> >
> > On 1/4/07, Aleksey Sanin <aleksey at aleksey.com > wrote:
> > >
> > > Well, I don't know exact reasons but it might be some
> > > problems with MS initialization from time callback.
> > > Can you find out where exactly does it crash?
> > >
> > > Aleksey
> > >
> > >
> > > Yeshwanth C wrote:
> > > > Hi
> > > > When I use the timer functions :
> > > > if (!CreateTimerQueueTimer(
> > > >         &hTimer, hTimerQueue, TimerRoutine, &arg , 10000, 0, 0))
> > > > The TimerRoutine is fired.
> > > > But TimerRoutine calls xmlInitParser via a function in a dll.
> > > > xmlInitParser crashes with the following message:
> > > > "The instruction at 0x7c8396d0 referenced memory at 0x00000014.  The
> > >
> > > > memory could not be read"
> > > >
> > > > Any help greatly appreciated
> > > > Regards
> > > > Yesh
> > > >
> > > >
> > > >
> > > ------------------------------------------------------------------------
> > > >
> > > > _______________________________________________
> > > > xmlsec mailing list
> > > > xmlsec at aleksey.com
> > > > http://www.aleksey.com/mailman/listinfo/xmlsec
> > >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.aleksey.com/pipermail/xmlsec/attachments/20070105/a98a2f07/attachment-0002.htm


More information about the xmlsec mailing list