Operations that change non-concurrent collections must have exclusive access. error in Convert(Document.CallBackGetHocr)

Yes, it will be hard to reproduce, since it requires accessing whatever non-thread-safe collection you have by several threads at the same time, but you should be able to mock this up. I’m attaching our stack trace of the location of the error from v20.12 in the hopes that will help you pinpoint the bug location. Can you please let me know if the non-thread safe collection at this location has been fixed?

System.InvalidOperationException: Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection’s state is no longer correct.
at System.Collections.Generic.Dictionary2.FindValue(TKey key) at #=zYoQVCAbCU4j9kycH3YDuIKZ1NIw0h0qFIBTGoQS0pfE7.#=zAk2qTJ0sbnng(String #=zyNlLRg4=) at #=zPkNwMxu1ye97RjWbr0ubC_Xi9pNz3VfRk6D_2axuWxoEshsUtIT$XG7dtDPP.#=z9qSPtmJcM3eo() at #=zPkNwMxu1ye97RjWbr0ubC_Xi9pNz3VfRk6D_2axuWxoEshsUtIT$XG7dtDPP..ctor(#=zUCWcXEH1ly3T22RtJgp18fTpOI0KHgBmtOgcvUxr1nig #=zY$_08RaR0p9I) at #=zXXJGE6zwmDAguaHaPQVRo_HwulVYaT0ohp2__cI=.#=zixnTou$V0B3X(#=zUCWcXEH1ly3T22RtJgp18fTpOI0KHgBmtOgcvUxr1nig #=zxaj05bk=) at #=z8Bb7XmHz$Y3O_z_y34Nrmf9d5_CuoPE1vZIHPhx9_lGw.#=zBbO_Qn_teQvJ() at #=z8Bb7XmHz$Y3O_z_y34Nrmf9d5_CuoPE1vZIHPhx9_lGw.#=zDC_$_SFAoyvN(#=zmn5Fhz_bCV7tp0phpTjxmgRivkLB0o1zzQ== #=zBdcgDTo=, #=zbzVqcf6w2ID$VMkn_nrNFtfgkpq6TKLIgQ==& #=zuLxa7XvHJ0fa, #=zwN7gV$i3ZWLK_lDIOJyCPY$6$CHaVCZexw3RPUZiXZxA #=zBlNOmoM=) at #=zYa_kN$0aM62IUOhkbAze3jtK1TYbsP1uOQ_GBVQ=.#=zDC_$_SFAoyvN(#=zmn5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2jgFxmpRLUV2yYFN2KnU= #=zibShiQ0UntG_, Boolean #=zu2yMRYg=, Boolean #=zZ30dNoM=, #=zbzVqcf6w2ID$VMkn_nrNFtfgkpq6TKLIgQ==& #=zfa0TZe8=, #=zUCWcXEH1ly3T22RtJgp18fTpOI0KHgBmtOgcvUxr1nig& #=zuno_vdbTMB3t, String& #=z00J69rI19cYQ) at #=z3$Mv7JcXUB$u9f96kuosvGuOkWozE8sxwWvoK7uxyqzomYAAkgXEIDs=.#=zy$ct_VHSiYIC(#=z0xbEtHVunPxvflL$_O3Af58SuChIjPLiVAJGgbM= #=zhl8GNFg=, Boolean #=zu2yMRYg=, Boolean #=zZ30dNoM=, #=zUCWcXEH1ly3T22RtJgp18fTpOI0KHgBmtOgcvUxr1nig #=zKXEQVpOevW6_, #=zUl4FX_sunrTyVXVaDB8g3II= #=z1tbOjSn3qFYr, String #=zvxiRZEA=, #=z3tDFAvFbCZ4PoKhyWn1BZXDbVzfle2vwM$L2jgFxmpRLUV2yYFN2KnU= #=zibShiQ0UntG_, #=zbzVqcf6w2ID$VMkn_nrNFtfgkpq6TKLIgQ==& #=zBdcgDTo=, String& #=zLXZGDOut5BgC) at #=zw58R9s_5O1ulLgA8vWckJP8_kNHOg2mdL0Pku2MBTdwqR5JUcW0xVko=.#=zMUgaFa$fMvU4(#=zUl4FX_sunrTyVXVaDB8g3II= #=zXq2KbN8=, Boolean #=zu2yMRYg=, Boolean #=zZ30dNoM=, String #=zvxiRZEA=, #=z3tDFAvFbCZ4PoKhyWn1BZXDbVzfle2vwM$L2jgFxmpRLUV2yYFN2KnU= #=zibShiQ0UntG_, #=zUCWcXEH1ly3T22RtJgp18fTpOI0KHgBmtOgcvUxr1nig #=z3cTm5HC1XVuF, Font #=zQ23fGyYRXUaE, #=zUCWcXEH1ly3T22RtJgp18fTpOI0KHgBmtOgcvUxr1nig& #=zHHt2yCg=, String& #=zkTPG0zI5XDBw, #=zbzVqcf6w2ID$VMkn_nrNFtfgkpq6TKLIgQ==& #=zthfg3hU=) at #=zw58R9s_5O1ulLgA8vWckJP8_kNHOg2mdL0Pku2MBTdwqR5JUcW0xVko=.#=zCKa4WW265k8Y(#=zUl4FX_sunrTyVXVaDB8g3II= #=zXq2KbN8=, Boolean #=zu2yMRYg=, Boolean #=zZ30dNoM=, String #=zvxiRZEA=, #=z3tDFAvFbCZ4PoKhyWn1BZXDbVzfle2vwM$L2jgFxmpRLUV2yYFN2KnU= #=zibShiQ0UntG_, #=zUCWcXEH1ly3T22RtJgp18fTpOI0KHgBmtOgcvUxr1nig #=z3cTm5HC1XVuF, Font #=zQ23fGyYRXUaE, #=zbzVqcf6w2ID$VMkn_nrNFtfgkpq6TKLIgQ==& #=zBdcgDTo=) at #=zw58R9s_5O1ulLgA8vWckJP8_kNHOg2mdL0Pku2MBTdwqR5JUcW0xVko=.#=zCKa4WW265k8Y(#=zUl4FX_sunrTyVXVaDB8g3II= #=zXq2KbN8=, Boolean #=zu2yMRYg=, Boolean #=zZ30dNoM=, String #=zvxiRZEA=, #=z3tDFAvFbCZ4PoKhyWn1BZXDbVzfle2vwM$L2jgFxmpRLUV2yYFN2KnU= #=zibShiQ0UntG_, #=zUCWcXEH1ly3T22RtJgp18fTpOI0KHgBmtOgcvUxr1nig #=z3cTm5HC1XVuF, Font #=zQ23fGyYRXUaE) at Aspose.Pdf.Text.TextState.set_Font(Font value) at Aspose.Pdf.Text.TextState.#=zGtUyFm77p1aA(TextState #=ztiwfUso=, #=zqJg20T2wNGfRaLq7M13GMjxb39OjW_7Ij7l_afrVdOAbQ57kPQ== #=ziu2gPqk=) at Aspose.Pdf.Text.TextState.#=zIPvqkaM=(#=zw58R9s_5O1ulLgA8vWckJP8_kNHOg2mdL0Pku2MBTdwqR5JUcW0xVko= #=zD6y3cYVM4gtl) at Aspose.Pdf.Text.TextSegment.#=zIPvqkaM=(#=zw58R9s_5O1ulLgA8vWckJP8_kNHOg2mdL0Pku2MBTdwqR5JUcW0xVko= #=zD6y3cYVM4gtl) at Aspose.Pdf.Text.TextBuilder.#=z6BEa6Tk=(TextFragment #=zNK6Pnub6KoaE, Int32 #=zmpMQD_Q=, Boolean #=zvt3JvoW5uTyu) at Aspose.Pdf.TextStamp.Put(Page page) at Aspose.Pdf.Page.AddStamp(Stamp stamp) at Wsl.PdfConverter.Implementation.PdfConverter.AddWatermarks(Stream pdfFileStream, IEnumerable1 watermarks) in D:\PROJECTS\ncore-applicationserver-net_2021.1\WSL\PdfConverter\Implementation\PdfConverter.cs:line 528
at Wsl.PdfConverter.Implementation.PdfConverter.AddWatermarks(Byte[] inputPdfFileContent, IEnumerable`1 watermarks) in D:\PROJECTS\ncore-applicationserver-net_2021.1\WSL\PdfConverter\Implementation\PdfConverter.cs:line 524

@ted-1

Decoding the provided stack trace and collecting the related information would take some time. Meanwhile, we request you please try to use the 21.5 or higher version of the API and share your feedback with us. We will surely proceed from this perspective and do the needful to fix the issue.

We apologize for the inconvenience caused.