The bug
Trading with cartographer will crash the vanilla 1.15.2 server
To reproduce
Not clear how to reproduce. Please refer to the description below.
Our world was generated at v1.10 about 3 years ago, then gradually updated to 1.15.2. Plan to update to 1.16 as soon as possible.
Some days earlier one of players told me when he trades with a group of cartographer, the server would crash. Several attempts, several crashes.
Today I have cured two villagers and make them become cartographers. It seems at first I have successfully done a round of trading(paper to emerald, the first slot). He went to resupply, then I tried to trade again. After the first slot is sold out, server crashed. Tried again and crashed again.
This happens in two different location, one is near to world spawn, another one is about thousands of blocks away.
Not sure if other villagers with different jobs would cause the crash or not, but we can just normally trade with them. Cartographer always causes the crash.
Archive is greater than 4GB so I may not want to try it on the latest snapshot. No local test is done. BTW our server has insufficient performance and sometimes crashes for ticking too long. But I don't think this is the case.
Linked issues
Attachments
Comments

I can not find out any relevance between those two reports. Still confused but I'll wait for 1.16. Hope it will be solved.
Edit: Found something in issue links. Thank you.

The ptoblem can still found in the 1.16.1!
Thank you for your report!
We're actually already tracking this issue in MC-126244, so I resolved and linked this ticket as a duplicate.
However, that ticket has already been resolved as Fixed. The fix will arrive in the next version or is already included in the latest development version of the game.
If you haven't already, you might like to make use of the search feature in the future to see if the issue has already been reported.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – ✍️ Feedback and Suggestions – 📖 Game Wiki