yaml / libyaml

Canonical source repository for LibYAML
http://pyyaml.org/wiki/LibYAML
MIT License
951 stars 316 forks source link

Loader cycles on large input #251

Open Totktonada opened 2 years ago

Totktonada commented 2 years ago

How to reproduce:

$ cmake .
$ make
$ yes '{' | head -n 1048576 | tr -d '\n' > x.yaml
$ ./run-loader x.yaml

I don't know, but maybe it is the same problem as one found by fuzzing in #227.

Totktonada commented 2 years ago

Maybe it is just very slow. I run it on 100K file instead of 1M one:

$ yes '{' | head -n 102400 | tr -d '\n' > 100k.yaml
$ time ./run-loader 100k.yaml 
[1] Loading '100k.yaml': FAILURE (0 documents)

real    0m58.257s
user    0m58.215s
sys 0m0.028s

Approx. 1750 symbols per second (for this particular case with deep nesting, of course).