If the definition of a recursive CTE r is used in the WITH clause without RECURSIVE and this clause is part of the query expression that defines another CTE then the server falls into an infinite recursion calling With_element::clone_parsed_spec() again and again. Ultimately it causes a crash of the server.
Here's a test case that causes such crash:
It should be noted that the definition of cte_r is not considered as the definition of a recursive CTE. Rather it is considered as the definition of a non-recursive CTE referencing the base table or view with the name cte_r. This is because the WITH clause containing this definition lacks the keyword RECURSIVE.
So the expected reaction of the server should be similar to this: