-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Description
Hi,
we are trying to validate conformance of some tree structure. Sadly we are seeing a stack overflow, even for simple cases like this:
;; example.cddl
; Root object
Tree = {
root: Node
}
; Simple tree structure
Node = [
value: text,
children: [* Node] ; Here's the recursion - Node contains Nodes
]
Here is some example data:
$ python
>>> import cbor2
>>> d = {
... "root": ["value", [["child1", []], ["child2", []]]]
... }
>>> d
{'root': ['value', [['child1', []], ['child2', []]]]}
>>> cbor2.dumps(d).hex()
'a164726f6f74826576616c75658282666368696c64318082666368696c643280'
Running this through validate crashes the tool:
echo a164726f6f74826576616c75658282666368696c64318082666368696c643280 | xxd -r -p | cddl validate --stdin --cddl example.cddl
[INFO] Root type for validation: Tree
thread 'main' has overflowed its stack
fatal runtime error: stack overflow
Aborted (core dumped)
Is this to be expected or am I just holding it wrong somehow?
Thanks
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working