Custom Query (121 matches)


Show under each result:

Results (49 - 51 of 121)

Ticket Resolution Summary Owner Reporter
#137 fixed PROPOSED FIX:memory corruption and bad aliases xi cegner@…

Reported by cegner@…, 5 years ago.


Libyaml 0.1.2 fails to serialize python longs correctly. The pure python implementation produces correct output. This is a major issue for us since we make heavy use of yaml and the pure python implementation is too slow for our needs (not a criticism, just a statement of fact).

I've given this 'blocker' severity and high priority since long is a basic python type. If this is inappropriate, please let me know. When is the next scheduled release of libyaml?

Minimal test case:

>>> import yaml
>>> from yaml import Dumper
>>> from yaml import CDumper
>>> yaml.__version__
>>> # libyaml doesn't have __version__ support but is 0.1.2

>>> d = { 'hourEastern': 20L, 'hour_eastern': 20L }
>>> yaml.dump( d, Dumper = CDumper )
'{hourEastern: &20 !!python/long 20, hour_eastern: *id001}\n'
>>> yaml.dump( d, Dumper = Dumper )
"{hourEastern: &id001 !!python/long '20', hour_eastern: *id001}\n"

#147 fixed Loader and Dumper leave circular references around xi kristjan@…

Reported by kristjan@…, 5 years ago.


In an environment where the gc module is turned off, having circular references is evil. When yaml.Loader and yaml.Dumper have finished processing a stream, they leave a bound method in their .state attribute. This causes the loaders and dumpers to stick around. We have patched this locally by doing, for example:

    for data in documents:
    dumpter.state = dumper.states = None

Maybe there is a better way. Perhaps the Dumper and Loader should both have close() methods that clear the state. Another way would be to not keep instancemethods in state, but rather class methods and bind them to self at runtime.

#156 fixed libyaml fails to identify simple keys in very long files on 32-bit platforms xi ppelletier@…

Reported by ppelletier@…, 5 years ago.


I have file which contains thousands of relatively short YAML documents, so the file is large (nearly a gigabyte) but the individual documents are not.

I can provide this file if necessary, but I'm not attaching it because it's so large (982M uncompressed, and still 45M when bzip2'ed).

I was getting this error:

Parser error: while parsing a block mapping at line 9259457, column 5
did not find expected key at line 9260367, column 5

This error occurs in both libyaml-0.1.2 and libyaml-0.1.3, but only on 32-bit machines (I tried Ubuntu 8.04 for x86-32, and Intel Mac OS X 10.5 with the compiler in 32-bit mode). If I parse the same file with libyaml on a 64-bit machine (e. g. Ubuntu 8.04 for x86-64), it parses successfully with no error.

I eventually tracked this problem down to an overflow in pointer arithmetic in yaml_parser_save_simple_key(), in yaml-0.1.3/src/scanner.c on line 1125. I changed this:

        simple_key.token_number = 
            parser->tokens_parsed + parser->tokens.tail - parser->tokens.head;

to this:

        simple_key.token_number = 
            parser->tokens_parsed + (parser->tokens.tail - parser->tokens.head);

which caused my file to be parsed successfully, even on 32-bit platforms. So, I would recommend adding this fix to libyaml-0.1.4. Thanks!

Note: See TracQuery for help on using queries.