wxPdfDoc - Crash in wxPdfTokenizer

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
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

Postby dschmeer » Sat Sep 22, 2018 10:51 pm

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: 824
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxPdfDoc - Crash in wxPdfTokenizer

Postby utelle » Sun Sep 23, 2018 10:38 am

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


Return to “wxCode”

Who is online

Users browsing this forum: No registered users and 1 guest