wxPdfDoc - Crash in wxPdfTokenizer

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
Post Reply
dschmeer
In need of some credit
In need of some credit
Posts: 3
Joined: Fri Apr 13, 2018 10:04 pm

wxPdfDoc - Crash in wxPdfTokenizer

Post by dschmeer »

I observed some crashes when using wxPdfDoc from multiple threads simultaneously and importing pdf files as templates.

Being able to trace the problem down to wxPdfTokenizer::NextToken(), I found a static wxString buffer there which is obviously not thread-safe. As the buffer is always cleared when entering the function, I see no reason why it should be static. Since I made it non-static, I didn't observe any more crashes.

@Ulrich Telle: Could you please have a look at this?

Thanks in advance

Dieter Schmeer
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxPdfDoc - Crash in wxPdfTokenizer

Post by utelle »

dschmeer wrote:I observed some crashes when using wxPdfDoc from multiple threads simultaneously and importing pdf files as templates.
Thanks for reporting this issue.
dschmeer wrote:Being able to trace the problem down to wxPdfTokenizer::NextToken(), I found a static wxString buffer there which is obviously not thread-safe. As the buffer is always cleared when entering the function, I see no reason why it should be static. Since I made it non-static, I didn't observe any more crashes.

@Ulrich Telle: Could you please have a look at this?
No idea why I made that buffer static. I removed the static attribute and committed the change to the wxPdfDocument github repository.

Regards,

Ulrich
Post Reply