mpreisler / trac-issues-test

Testing trac to github issue migration, please ignore.
0 stars 0 forks source link

"Strange behavior" of DHScan.perform_xslt_transformation #10

Closed mpreisler closed 9 years ago

mpreisler commented 9 years ago

TODO If this call (below) is not executed, there will come some strange behaviour

The comment is entirely correct. If the line is not executed (or at least openscap.common.err_desc()) python seems to refuse to read from temporary_file.

This is what happens if it's commented out: {{{ Traceback (most recent call last): File "/home/mpreisle/Devel/scap-workbench/src/scap_workbench/scan.py", line 185, in __cb_preview_report desc = transformed_temp.read() TypeError: expected string or Unicode object, NoneType found }}} At this point I have no idea why this is happening. The bindings are in SWIG so I don't think it is caused by them, furthermore valgrind only reports errors outside of the scope.

mpreisler commented 9 years ago

Imported from trac issue 2. Created by mpreisle on 2011-09-08T17:21:04, last modified: 2014-01-29T16:10:07

mpreisler commented 9 years ago

Trac comment by mpreisle on 2011-09-13 14:13:03:

Seems to be caused by the params parameter of oscap_apply_xslt. If the amount of it's elements is not even the behaviour is reproduced.

mpreisler commented 9 years ago

Trac comment by mpreisle on 2011-09-13 14:42:24:

It definitely is caused/affected by the params parameter, however I have reproduced this with even amount of params. Probably some tuple <-> const char\ issue in the bindings.

mpreisler commented 9 years ago

Trac comment by mpreisle on 2011-09-13 15:38:50:

I think this could be remedied by changing http://git.fedorahosted.org/git/?p=openscap.git;a=blob;f=swig/openscap.i;h=bc33b29dd3f64ee6aae3221017c5f4007598154b;hb=HEAD#l73 to copy the internal python char buffers and then deallocating them in freearg.

However I am still not sure why this causes trouble.

valgrind reports no errors...

mpreisler commented 9 years ago

Trac comment by mpreisle on 2011-09-15 15:33:36:

The charpp_swig.patch file is my vain attempt to investigate this further. That patch copies internal python buffers and doesn't use them directly (so it leaks until the freearg typemap is reimplemented).

This doesn't change the behaviour in any way unfortunately!

mpreisler commented 9 years ago

Trac comment by mpreisle on 2011-10-27 11:40:59:

Changing priority since this issue doesn't affect anything, removing the milestone. Still, this is a mystery!

mpreisler commented 9 years ago

Trac comment by isimluk on 2014-01-29 16:10:07:

I am closing this mystery. It affects only old scap-workbench. Whoever likes to dig into mysteries can use closed tickets.