Operating system: Windows 10 Home
Graphics card: Intel HD Graphics 505, Intel HD Graphics 2500
Broken: 2.78c, 2.79, 2.79b
Worked: Untested on other Blender versions
Short description of error
When a Python script creates a node tree in bpy.data.node_groups, creates nodes in that tree using node_tree.nodes.new(), and attempts to create a link between nodes using node_tree.links.new(), there is a 5-10% chance that the link creation step fails. During such a failure, Blender crashes, and the console prints Error: EXCEPTION_ACCESS_VIOLATION. This can happen when the script is run from Blender's text editor or from an add-on. This is confirmed to occur in Blender 2.78c, 2.79, and 2.79b on two separate Windows 10 Home computers. It does not occur when running Blender in Ubuntu 17.10 using VirtualBox on those same computers.
Exact steps for others to reproduce the error
Open the attached file Node_Tree_Link_Bug.blend and repeatedly run the Python script named Text. A crash may occur the first time the script is run, or a crash may occur after the script is run several times. It is occasionally necessary to run the script dozens of times before a crash occurs.
Note that the attached file produces two links. When a crash occurs, it almost always (>95% of the time) occurs when the first link is being made, and if the first link is successfully made, then the second one is virtually always made as well. I've only seen the second link cause a crash once out of hundreds of script executions.