Here are the diffs I used on Gentoo to test with gcc 4.6.1:
and here are the messages from the tests:
Cheers,
--Denys
On Mon, 2011-07-18 at 21:53 +0200, Denys Duchier wrote:
Here are the diffs I used on Gentoo to test with gcc 4.6.1:
and here are the messages from the tests:
Going through the failures:
tests/plugin/options: fails because "-Wformat" is not enabled by default in my gcc, but is in yours. Minor issue.
tests/cpychecker/PyArg_ParseTuple/correct_codes_S_and_U: tests/cpychecker/PyArg_ParseTuple/correct_converter: tests/cpychecker/PyArg_ParseTuple/without_PY_SSIZE_T_CLEAN: tests/cpychecker/PyArg_ParseTuple/incorrect_codes_S_and_U: All of these are segfaulting for some reason.
tests/cpychecker/refcounts/fold_conditional: int vs Py_ssize_t issue. I seen that you're on i686. I've been doing my devel work on a 64-bit box; I think I may have accidentally assumed that a type coercion happens in this test. I'm interested in seeing what the output looks like when adding "-fdump-tree-gimple" to the gcc invocation line for that test on your machine (it should generate a file like "input.c.004t.gimple").
As for the segfaults, these are going to be more fiddly. It may be that we're running into the garbage collection issue - the plugin currently ignores the gcc garbage collection - which has merely been a theoretical problem up until now - or it could be something else.
To get a backtrace from the plugin, you need to locate the invocation line for the gcc harness, then add "-v" to the options to see the invocation of the c compiler ("cc1"). You should then be able to run it under gdb like this:
$ gdb --args FULL ARGS OF cc1 INVOCATION (gdb) run
and hopefully it will crash in a predictable, repeatable way.
(gdb) bt
There are some more notes on debugging the plugin in the README.rst
Hope this is helpful Dave
David Malcolm dmalcolm@redhat.com writes:
tests/cpychecker/refcounts/fold_conditional: int vs Py_ssize_t issue. I seen that you're on i686. I've been doing my devel work on a 64-bit box; I think I may have accidentally assumed that a type coercion happens in this test. I'm interested in seeing what the output looks like when adding "-fdump-tree-gimple" to the gcc invocation line for that test on your machine (it should generate a file like "input.c.004t.gimple").
Here it is:
fold_conditional (struct PyObject * self, struct PyObject * args) { struct PyObject * D.11808; Py_ssize_t D.11809; struct _typeobject * D.11812; struct PyObject * list;
list = PyList_New (5); if (list == 0B) goto <D.11806>; else goto <D.11807>; <D.11806>: D.11808 = 0B; return D.11808; <D.11807>: D.11809 = MEM[(struct PyVarObject *)list].ob_size; if (D.11809 != 5) goto <D.11810>; else goto <D.11811>; <D.11810>: D.11808 = list; return D.11808; <D.11811>: D.11812 = list->ob_type; if (D.11812 != &PyList_Type) goto <D.11813>; else goto <D.11814>; <D.11813>: D.11808 = list; return D.11808; <D.11814>: D.11808 = list; return D.11808; }
I'll look into the segfaults later.
Cheers,
--Denys
On Tue, 2011-07-19 at 13:28 +0200, Denys Duchier wrote:
David Malcolm dmalcolm@redhat.com writes:
tests/cpychecker/refcounts/fold_conditional: int vs Py_ssize_t issue. I seen that you're on i686. I've been doing my devel work on a 64-bit box; I think I may have accidentally assumed that a type coercion happens in this test. I'm interested in seeing what the output looks like when adding "-fdump-tree-gimple" to the gcc invocation line for that test on your machine (it should generate a file like "input.c.004t.gimple").
Here it is:
fold_conditional (struct PyObject * self, struct PyObject * args) { struct PyObject * D.11808; Py_ssize_t D.11809; struct _typeobject * D.11812; struct PyObject * list;
list = PyList_New (5); if (list == 0B) goto <D.11806>; else goto <D.11807>; <D.11806>: D.11808 = 0B; return D.11808; <D.11807>: D.11809 = MEM[(struct PyVarObject *)list].ob_size;
Thanks!
Interestingly both D.11809 and the "ob_size" field are declared as Py_ssize_t, so I'm not quite sure what's going on.
Having said that, I'm the middle of a big reworking of the state management, to better distinguish between l-values and r-values (so that I can sanely track reads/writes to arrays); hopefully I'll figure things out after that
Dave
David Malcolm dmalcolm@redhat.com writes:
To get a backtrace from the plugin, you need to locate the invocation line for the gcc harness, then add "-v" to the options to see the invocation of the c compiler ("cc1"). You should then be able to run it under gdb like this:
$ gdb --args FULL ARGS OF cc1 INVOCATION (gdb) run
Here is what I get (does it help?):
$ LD_PRELOAD=/lib/libpthread.so.0 gdb --args /usr/libexec/gcc/i686-pc-linux-gnu/4.6.1/cc1 -quiet -I /usr/include/python2.7 -iplugindir=/usr/lib/gcc/i686-pc-linux-gnu/4.6.1/plugin tests/cpychecker/PyArg_ParseTuple/correct_codes_S_and_U/input.c -D_FORTIFY_SOURCE=2 -iplugindir=/usr/lib/gcc/i686-pc-linux-gnu/4.6.1/plugin -quiet -dumpbase input.c -mtune=generic -march=i686 -auxbase-strip tests/cpychecker/PyArg_ParseTuple/correct_codes_S_and_U/output.o -version -fplugin=/home/denys/src/my-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/PyArg_ParseTuple/correct_codes_S_and_U/script.py -o /tmp/ccWOUJE3.s GNU gdb (Gentoo 7.2 p1) 7.2 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu". For bug reporting instructions, please see: http://bugs.gentoo.org/... Reading symbols from /usr/libexec/gcc/i686-pc-linux-gnu/4.6.1/cc1...(no debugging symbols found)...done. (gdb) run Starting program: /usr/libexec/gcc/i686-pc-linux-gnu/4.6.1/cc1 -quiet -I /usr/include/python2.7 -iplugindir=/usr/lib/gcc/i686-pc-linux-gnu/4.6.1/plugin tests/cpychecker/PyArg_ParseTuple/correct_codes_S_and_U/input.c -D_FORTIFY_SOURCE=2 -iplugindir=/usr/lib/gcc/i686-pc-linux-gnu/4.6.1/plugin -quiet -dumpbase input.c -mtune=generic -march=i686 -auxbase-strip tests/cpychecker/PyArg_ParseTuple/correct_codes_S_and_U/output.o -version -fplugin=/home/denys/src/my-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/PyArg_ParseTuple/correct_codes_S_and_U/script.py -o /tmp/ccWOUJE3.s [Thread debugging using libthread_db enabled] GNU C (Gentoo 4.6.1 p1.0, pie-0.4.5) version 4.6.1 (i686-pc-linux-gnu) compiled by GNU C version 4.6.1, GMP version 5.0.2, MPFR version 3.0.1-p4, MPC version 0.9 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Versions of loaded plugins: python: Unknown version. GNU C (Gentoo 4.6.1 p1.0, pie-0.4.5) version 4.6.1 (i686-pc-linux-gnu) compiled by GNU C version 4.6.1, GMP version 5.0.2, MPFR version 3.0.1-p4, MPC version 0.9 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Versions of loaded plugins: python: Unknown version. Compiler executable checksum: ecffa214b63698a3e0a522cca777cd13
Program received signal SIGSEGV, Segmentation fault. 0x0848457a in lookup_attribute () (gdb) bt #0 0x0848457a in lookup_attribute () #1 0x08489141 in build_pointer_type_for_mode () #2 0x08489273 in build_pointer_type () #3 0xb79ed91f in gcc_TypeDecl_get_pointer (self=0xb7537670, closure=0x0) at autogenerated-tree.c:3963 #4 0xb787203d in ?? () from /usr/lib/libpython2.7.so.1.0 (gdb) f 3 #3 0xb79ed91f in gcc_TypeDecl_get_pointer (self=0xb7537670, closure=0x0) at autogenerated-tree.c:3963 3963 return gcc_python_make_wrapper_tree(build_pointer_type(self->t)); (gdb) list 3958 }; 3959 3960 static PyObject * 3961 gcc_TypeDecl_get_pointer(PyGccTree *self, void *closure) 3962 { 3963 return gcc_python_make_wrapper_tree(build_pointer_type(self->t)); 3964 } 3965 3966 static PyGetSetDef gcc_TypeDecl_getset_table[] = { 3967 {"pointer", (gdb)
--Denys
On Tue, 2011-07-19 at 15:42 +0200, Denys Duchier wrote:
David Malcolm dmalcolm@redhat.com writes:
To get a backtrace from the plugin, you need to locate the invocation line for the gcc harness, then add "-v" to the options to see the invocation of the c compiler ("cc1"). You should then be able to run it under gdb like this:
$ gdb --args FULL ARGS OF cc1 INVOCATION (gdb) run
Here is what I get (does it help?):
[snip]
Program received signal SIGSEGV, Segmentation fault. 0x0848457a in lookup_attribute () (gdb) bt #0 0x0848457a in lookup_attribute () #1 0x08489141 in build_pointer_type_for_mode () #2 0x08489273 in build_pointer_type () #3 0xb79ed91f in gcc_TypeDecl_get_pointer (self=0xb7537670, closure=0x0) at autogenerated-tree.c:3963 #4 0xb787203d in ?? () from /usr/lib/libpython2.7.so.1.0 (gdb) f 3 #3 0xb79ed91f in gcc_TypeDecl_get_pointer (self=0xb7537670, closure=0x0) at autogenerated-tree.c:3963 3963 return gcc_python_make_wrapper_tree(build_pointer_type(self->t)); (gdb) list 3958 }; 3959 3960 static PyObject * 3961 gcc_TypeDecl_get_pointer(PyGccTree *self, void *closure) 3962 { 3963 return gcc_python_make_wrapper_tree(build_pointer_type(self->t)); 3964 } 3965 3966 static PyGetSetDef gcc_TypeDecl_getset_table[] = { 3967 {"pointer",
Thanks for the info.
It looks like you don't have debugging information available for either gcc, or for python. Having debug info for gcc might help us figure out what's going on in frames 0 to 2.
I wonder if self->t is NULL in frame 3. If it's not NULL, I wonder what the corresponding tree value is.
Running: (gdb) print self->t (gdb) call debug_tree(self->t) (gdb) print *(self->t) might help (but then again, might not).
Dave
On Tue, 2011-07-19 at 19:56 -0400, David Malcolm wrote:
On Tue, 2011-07-19 at 15:42 +0200, Denys Duchier wrote:
David Malcolm dmalcolm@redhat.com writes:
To get a backtrace from the plugin, you need to locate the invocation line for the gcc harness, then add "-v" to the options to see the invocation of the c compiler ("cc1"). You should then be able to run it under gdb like this:
$ gdb --args FULL ARGS OF cc1 INVOCATION (gdb) run
Here is what I get (does it help?):
[snip]
Program received signal SIGSEGV, Segmentation fault. 0x0848457a in lookup_attribute () (gdb) bt #0 0x0848457a in lookup_attribute () #1 0x08489141 in build_pointer_type_for_mode () #2 0x08489273 in build_pointer_type () #3 0xb79ed91f in gcc_TypeDecl_get_pointer (self=0xb7537670, closure=0x0) at autogenerated-tree.c:3963 #4 0xb787203d in ?? () from /usr/lib/libpython2.7.so.1.0 (gdb) f 3 #3 0xb79ed91f in gcc_TypeDecl_get_pointer (self=0xb7537670, closure=0x0) at autogenerated-tree.c:3963 3963 return gcc_python_make_wrapper_tree(build_pointer_type(self->t)); (gdb) list 3958 }; 3959 3960 static PyObject * 3961 gcc_TypeDecl_get_pointer(PyGccTree *self, void *closure) 3962 { 3963 return gcc_python_make_wrapper_tree(build_pointer_type(self->t)); 3964 } 3965 3966 static PyGetSetDef gcc_TypeDecl_getset_table[] = { 3967 {"pointer",
I managed to reproduce this on an i686 box, and I have fixed it; all selftests now pass on the i686 box I'm working on (all with gcc 4.6.0, fwiw)
If you "git pull", does the revised code work for you now?
It turned out to be a much deeper problem than I expected: gcc_TypeDecl_get_pointer() was calling:
gcc_python_make_wrapper_tree(build_pointer_type(self->t));
where (tree)(self->t) had TREE_CODE() == TYPE_DECL, and thus tree_code_type[TYPE_DECL] is tcc_declaration.
build_pointer_type() assumes the tree passed in is of tcc_type.
So my code was violating GCC's internal type system. (FWIW, I've been using an optimized build of GCC, in which the type checking for trees is disabled; it looks like I ought to do my development against a debug build with the tree type checking turned on).
Somehow this was surviving on x86_64, with gcc.TypeDecl.pointer was returning a pointer to a thing that was being treated as a type; somehow all usage of the resulting thing managed to work, despite violating type constraints.
On i686 it was less "fortunate", and segfaulted almost immediately, during the lookup of the "may_alias" attribute (on the type_decl-being-treated-as-a-type).
The bug should now be fixed, as of commit 1d42de33a0ce9225d98fa35b1fa44ad57c9305a3, and I committed some other test suite fixes for i686 as 99b36c7501b555acc0491928f4a5f9a6b141265a
Thanks for reporting this bug! Dave
Hi David, here is the new transcript after updating:
python testcpybuilder.py -v test_module_with_type (__main__.SimpleTest) ... ok test_simple_compilation (__main__.SimpleTest) ... ok test_version_parsing (__main__.SimpleTest) ... ok
---------------------------------------------------------------------- Ran 3 tests in 0.447s
OK python run-test-suite.py tests/plugin/identifiers: OK tests/plugin/diagnostics: FAIL
returncode: 1 compiling: /usr/bin/i686-pc-linux-gnu-gcc-4.6.1 -ggdb -c -o tests/plugin/diagnostics/output.o -fplugin=/home/denys/src/my-python-plugin/python.so -fplugin-arg-python-script=tests/plugin/diagnostics/script.py -Wno-format tests/plugin/diagnostics/input.c Stdout:
Stderr: tests/plugin/diagnostics/input.c: In function ‘main’: tests/plugin/diagnostics/input.c:23:1: error: this is an error (with positional args) tests/plugin/diagnostics/input.c:23:1: error: this is an error (with keyword args) tests/plugin/diagnostics/input.c:25:1: warning: this is a warning (with positional args) [-Wdiv-by-zero] tests/plugin/diagnostics/input.c:25:1: warning: this is a warning (with keyword args) [-Wdiv-by-zero] tests/plugin/diagnostics/input.c:23:1: error: a warning with some embedded format strings %s and %i tests/plugin/diagnostics/input.c:23:1: note: This is the start of the function tests/plugin/diagnostics/input.c:25:1: note: This is the end of the function--- Expected stderr +++ Actual stderr @@ -1,4 +1,4 @@ -tests/plugin/diagnostics/input.c: In function 'main': +tests/plugin/diagnostics/input.c: In function ‘main’: tests/plugin/diagnostics/input.c:23:1: error: this is an error (with positional args) tests/plugin/diagnostics/input.c:23:1: error: this is an error (with keyword args) tests/plugin/diagnostics/input.c:25:1: warning: this is a warning (with positional args) [-Wdiv-by-zero]
tests/plugin/initializers: OK tests/plugin/version: OK tests/plugin/types: OK tests/plugin/function-types: OK tests/plugin/callback-exception: OK tests/plugin/callback-args: OK tests/plugin/syntax-error: OK tests/plugin/options: FAIL
returncode: 1 compiling: /usr/bin/i686-pc-linux-gnu-gcc-4.6.1 -ggdb -c -o tests/plugin/options/output.o -fplugin=/home/denys/src/my-python-plugin/python.so -fplugin-arg-python-script=tests/plugin/options/script.py tests/plugin/options/input.c Stdout: Help on class Option in module gcc:
class Option(__builtin__.object) | Methods defined here: | | __init__(...) | x.__init__(...) initializes x; see help(type(x)) for signature | | __repr__(...) | x.__repr__() <==> repr(x) | | ---------------------------------------------------------------------- | Data descriptors defined here: | | help | (string) The help text shown for this option | | is_driver | (bool) Is this a driver option? | | is_enabled | True/False for whether or not this option is enabled, raising a NotImplementedError for options for which the plugin cannot tell | | is_optimization | (bool) Does this option control an optimization? | | is_target | (bool) Is this a target-specific option? | | is_warning | (bool) Does this option control a warning message? | | text | (string) The command-line text used to set this option | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | __new__ = <built-in method __new__ of type object> | T.__new__(S, ...) -> a new object with type S, a subtype of T
gcc.Option('-funroll-loops') option.text: '-funroll-loops' option.help: 'Perform loop unrolling when iteration count is known' option.is_enabled: False option.is_warning: False option.is_optimization: True option.is_driver: False option.is_target: False gcc.Option('-fjump-tables') option.text: '-fjump-tables' option.help: 'Use jump tables for sufficiently large switch statements' option.is_enabled: True option.is_warning: False option.is_optimization: True option.is_driver: False option.is_target: False gcc.Option('-Wuninitialized') option.text: '-Wuninitialized' option.help: 'Warn about uninitialized automatic variables' option.is_enabled: True option.is_warning: True option.is_optimization: False option.is_driver: False option.is_target: False gcc.Option('-Wformat') option.text: '-Wformat' option.help: 'Warn about printf/scanf/strftime/strfmon format string anomalies' option.is_enabled: True option.is_warning: True option.is_optimization: False option.is_driver: False option.is_target: False Stderr: Traceback (most recent call last): File "tests/plugin/options/script.py", line 59, in <module> option = gcc.Option('-foptimize-for-web-scale') ValueError: Could not find command line argument with text '-foptimize-for-web-scale'--- Expected stdout +++ Actual stdout @@ -66,7 +66,7 @@ gcc.Option('-Wformat') option.text: '-Wformat' option.help: 'Warn about printf/scanf/strftime/strfmon format string anomalies' - option.is_enabled: False + option.is_enabled: True option.is_warning: True option.is_optimization: False option.is_driver: False
tests/plugin/parameters: OK tests/plugin/sys: OK tests/plugin/translation-units: OK tests/plugin/functions: OK tests/plugin/constants: OK tests/plugin/arrays: OK tests/cpychecker/unknown-function: OK tests/cpychecker/absinterp/arrays: OK tests/cpychecker/PyArg_ParseTuple/typedefs: OK tests/cpychecker/PyArg_ParseTuple/keywords: FAIL
returncode: 1 compiling: /usr/bin/i686-pc-linux-gnu-gcc-4.6.1 -ggdb -c -o tests/cpychecker/PyArg_ParseTuple/keywords/output.o -fplugin=/home/denys/src/my-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/PyArg_ParseTuple/keywords/script.py -I/usr/include/python2.7 tests/cpychecker/PyArg_ParseTuple/keywords/input.c Stdout:
Stderr: tests/cpychecker/PyArg_ParseTuple/keywords/input.c: In function ‘parse_to_a_typedef’: tests/cpychecker/PyArg_ParseTuple/keywords/input.c:32:37: error: keywords to PyArg_ParseTupleAndKeywords are not NULL-terminated [-fpermissive]--- Expected stderr +++ Actual stderr @@ -1,2 +1,2 @@ -tests/cpychecker/PyArg_ParseTuple/keywords/input.c: In function 'parse_to_a_typedef': +tests/cpychecker/PyArg_ParseTuple/keywords/input.c: In function ‘parse_to_a_typedef’: tests/cpychecker/PyArg_ParseTuple/keywords/input.c:32:37: error: keywords to PyArg_ParseTupleAndKeywords are not NULL-terminated [-fpermissive]
tests/cpychecker/PyArg_ParseTuple/correct_codes_S_and_U: OK tests/cpychecker/PyArg_ParseTuple/correct_converter: OK tests/cpychecker/PyArg_ParseTuple/codes_accepting_null: OK tests/cpychecker/PyArg_ParseTuple/incorrect_codes_S_and_U: FAIL
returncode: 1 compiling: /usr/bin/i686-pc-linux-gnu-gcc-4.6.1 -ggdb -c -o tests/cpychecker/PyArg_ParseTuple/incorrect_codes_S_and_U/output.o -fplugin=/home/denys/src/my-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/PyArg_ParseTuple/incorrect_codes_S_and_U/script.py -I/usr/include/python2.7 tests/cpychecker/PyArg_ParseTuple/incorrect_codes_S_and_U/input.c Stdout:
Stderr: tests/cpychecker/PyArg_ParseTuple/incorrect_codes_S_and_U/input.c: In function ‘incorrect_usage_of_S_and_U’: tests/cpychecker/PyArg_ParseTuple/incorrect_codes_S_and_U/input.c:29:26: error: Mismatching type in call to PyArg_ParseTuple with format code "SU" [-fpermissive] argument 3 ("&val1") had type "int *" (pointing to 32 bits) but was expecting one of "struct PyStringObject * *" or "struct PyObject * *" for format code "S" tests/cpychecker/PyArg_ParseTuple/incorrect_codes_S_and_U/input.c:29:26: error: Mismatching type in call to PyArg_ParseTuple with format code "SU" [-fpermissive] argument 4 ("&val2") had type "int *" (pointing to 32 bits) but was expecting one of "struct PyUnicodeObject * *" or "struct PyObject * *" for format code "U"--- Expected stderr +++ Actual stderr @@ -1,4 +1,4 @@ -tests/cpychecker/PyArg_ParseTuple/incorrect_codes_S_and_U/input.c: In function 'incorrect_usage_of_S_and_U': +tests/cpychecker/PyArg_ParseTuple/incorrect_codes_S_and_U/input.c: In function ‘incorrect_usage_of_S_and_U’: tests/cpychecker/PyArg_ParseTuple/incorrect_codes_S_and_U/input.c:29:26: error: Mismatching type in call to PyArg_ParseTuple with format code "SU" [-fpermissive] argument 3 ("&val1") had type "int *" (pointing to 32 bits)
tests/cpychecker/PyArg_ParseTuple/incorrect_code_z_hash: FAIL
returncode: 1 compiling: /usr/bin/i686-pc-linux-gnu-gcc-4.6.1 -ggdb -c -o tests/cpychecker/PyArg_ParseTuple/incorrect_code_z_hash/output.o -fplugin=/home/denys/src/my-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/PyArg_ParseTuple/incorrect_code_z_hash/script.py -I/usr/include/python2.7 tests/cpychecker/PyArg_ParseTuple/incorrect_code_z_hash/input.c Stdout:
Stderr: tests/cpychecker/PyArg_ParseTuple/incorrect_code_z_hash/input.c: In function ‘incorrect_code_z_hash’: tests/cpychecker/PyArg_ParseTuple/incorrect_code_z_hash/input.c:34:26: error: Mismatching type in call to PyArg_ParseTuple with format code "z#" [-fpermissive] argument 4 ("&len") had type "float *" (pointing to 32 bits) but was expecting "int *" (pointing to 32 bits) for format code "z#"--- Expected stderr +++ Actual stderr @@ -1,4 +1,4 @@ -tests/cpychecker/PyArg_ParseTuple/incorrect_code_z_hash/input.c: In function 'incorrect_code_z_hash': +tests/cpychecker/PyArg_ParseTuple/incorrect_code_z_hash/input.c: In function ‘incorrect_code_z_hash’: tests/cpychecker/PyArg_ParseTuple/incorrect_code_z_hash/input.c:34:26: error: Mismatching type in call to PyArg_ParseTuple with format code "z#" [-fpermissive] argument 4 ("&len") had type "float *" (pointing to 32 bits)
tests/cpychecker/fileptr-missing-error-check: OK tests/cpychecker/locate-methods: OK tests/cpychecker/refcounts/correct_py_none: OK tests/cpychecker/refcounts/correct_object_ctor: OK tests/cpychecker/refcounts/incorrect_py_none: FAIL
returncode: 1 compiling: /usr/bin/i686-pc-linux-gnu-gcc-4.6.1 -ggdb -c -o tests/cpychecker/refcounts/incorrect_py_none/output.o -fplugin=/home/denys/src/my-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/incorrect_py_none/script.py -I/usr/include/python2.7 tests/cpychecker/refcounts/incorrect_py_none/input.c Stdout: _Py_NoneStruct.ob_refcnt: RefcountValue(0) state.return_rvalue: PointerToRegion(gcctype='struct PyObject *', loc=None, region=RegionForGlobal(gcc.VarDecl('_Py_NoneStruct'))) Stderr: tests/cpychecker/refcounts/incorrect_py_none/input.c: In function ‘losing_refcnt_of_none’: tests/cpychecker/refcounts/incorrect_py_none/input.c:26:5: error: ob_refcnt of return value is 1 too low tests/cpychecker/refcounts/incorrect_py_none/input.c:26:5: note: when returning at: return Py_None; tests/cpychecker/refcounts/incorrect_py_none/input.c:26:5: note: consider using "Py_RETURN_NONE;"--- Expected stderr +++ Actual stderr @@ -1,4 +1,4 @@ -tests/cpychecker/refcounts/incorrect_py_none/input.c: In function 'losing_refcnt_of_none': +tests/cpychecker/refcounts/incorrect_py_none/input.c: In function ‘losing_refcnt_of_none’: tests/cpychecker/refcounts/incorrect_py_none/input.c:26:5: error: ob_refcnt of return value is 1 too low tests/cpychecker/refcounts/incorrect_py_none/input.c:26:5: note: when returning at: return Py_None; tests/cpychecker/refcounts/incorrect_py_none/input.c:26:5: note: consider using "Py_RETURN_NONE;"
tests/cpychecker/refcounts/use_after_dealloc: FAIL
returncode: 1 compiling: /usr/bin/i686-pc-linux-gnu-gcc-4.6.1 -ggdb -c -o tests/cpychecker/refcounts/use_after_dealloc/output.o -fplugin=/home/denys/src/my-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/use_after_dealloc/script.py -I/usr/include/python2.7 tests/cpychecker/refcounts/use_after_dealloc/input.c Stdout: Trace 0: Transitions: 'PyLong_FromLong() succeeds' 'taking False path' 'taking True path' 'returning' Return value: repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/use_after_dealloc/input.c', line=30), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/use_after_dealloc/input.c', line=30))) str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/use_after_dealloc/input.c', line=30)) from tests/cpychecker/refcounts/use_after_dealloc/input.c:30 r->ob_refcnt: RefcountValue(1) r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/use_after_dealloc/input.c', line=30), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) Exception: (struct PyObject *)0 from tests/cpychecker/refcounts/use_after_dealloc/input.c:28
Trace 1: Transitions: 'PyLong_FromLong() succeeds' 'taking False path' 'taking False path' 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/use_after_dealloc/input.c:30' error: ReadFromDeallocatedMemory() error: reading from deallocated memory at tests/cpychecker/refcounts/use_after_dealloc/input.c:42: memory deallocated at tests/cpychecker/refcounts/use_after_dealloc/input.c:41 PyLongObject allocated at tests/cpychecker/refcounts/use_after_dealloc/input.c:30: repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/use_after_dealloc/input.c', line=30)) str(): PyLongObject allocated at tests/cpychecker/refcounts/use_after_dealloc/input.c:30 r->ob_refcnt: None r->ob_type: None Exception: (struct PyObject *)0 from tests/cpychecker/refcounts/use_after_dealloc/input.c:28
Trace 2: Transitions: 'PyLong_FromLong() fails' 'taking True path' 'returning' Return value: repr(): ConcreteValue(gcctype='struct PyObject *', loc=None, value=0L) str(): (struct PyObject *)0L Exception: RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) Stderr: tests/cpychecker/refcounts/use_after_dealloc/input.c: In function ‘use_after_dealloc’: tests/cpychecker/refcounts/use_after_dealloc/input.c:42:5: error: reading from deallocated memory at tests/cpychecker/refcounts/use_after_dealloc/input.c:42: memory deallocated at tests/cpychecker/refcounts/use_after_dealloc/input.c:41 tests/cpychecker/refcounts/use_after_dealloc/input.c:30:15: note: when PyLong_FromLong() succeeds at: PyObject *tmp = PyLong_FromLong(0x1000); tests/cpychecker/refcounts/use_after_dealloc/input.c:32:8: note: when taking False path at: if (!tmp) { tests/cpychecker/refcounts/use_after_dealloc/input.c:41:5: note: reaching: Py_DECREF(tmp); tests/cpychecker/refcounts/use_after_dealloc/input.c:41:5: note: when taking False path at: Py_DECREF(tmp); tests/cpychecker/refcounts/use_after_dealloc/input.c:41:5: note: reaching: Py_DECREF(tmp); tests/cpychecker/refcounts/use_after_dealloc/input.c:41:5: note: when calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/use_after_dealloc/input.c:30 at: Py_DECREF(tmp); tests/cpychecker/refcounts/use_after_dealloc/input.c:42:5: note: reaching: Py_INCREF(tmp);--- Expected stderr +++ Actual stderr @@ -1,4 +1,4 @@ -tests/cpychecker/refcounts/use_after_dealloc/input.c: In function 'use_after_dealloc': +tests/cpychecker/refcounts/use_after_dealloc/input.c: In function ‘use_after_dealloc’: tests/cpychecker/refcounts/use_after_dealloc/input.c:42:5: error: reading from deallocated memory at tests/cpychecker/refcounts/use_after_dealloc/input.c:42: memory deallocated at tests/cpychecker/refcounts/use_after_dealloc/input.c:41 tests/cpychecker/refcounts/use_after_dealloc/input.c:30:15: note: when PyLong_FromLong() succeeds at: PyObject *tmp = PyLong_FromLong(0x1000); tests/cpychecker/refcounts/use_after_dealloc/input.c:32:8: note: when taking False path at: if (!tmp) {
tests/cpychecker/refcounts/too_many_increfs: FAIL
returncode: 1 compiling: /usr/bin/i686-pc-linux-gnu-gcc-4.6.1 -ggdb -c -o tests/cpychecker/refcounts/too_many_increfs/output.o -fplugin=/home/denys/src/my-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/too_many_increfs/script.py -I/usr/include/python2.7 tests/cpychecker/refcounts/too_many_increfs/input.c Stdout: Trace 0: Transitions: 'PyLong_FromLong() succeeds' 'returning' Return value: repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/too_many_increfs/input.c', line=26), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/too_many_increfs/input.c', line=26))) str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/too_many_increfs/input.c', line=26)) from tests/cpychecker/refcounts/too_many_increfs/input.c:26 r->ob_refcnt: RefcountValue(2) r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/too_many_increfs/input.c', line=26), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) Exception: (struct PyObject *)0 from tests/cpychecker/refcounts/too_many_increfs/input.c:24
Trace 1: Transitions: 'PyLong_FromLong() fails' error: NullPtrDereference() error: dereferencing NULL (tmp->ob_refcnt) at tests/cpychecker/refcounts/too_many_increfs/input.c:30 Exception: RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) Stderr: tests/cpychecker/refcounts/too_many_increfs/input.c: In function ‘too_many_increfs’: tests/cpychecker/refcounts/too_many_increfs/input.c:31:5: error: ob_refcnt of return value is 1 too high tests/cpychecker/refcounts/too_many_increfs/input.c:26:9: note: PyLongObject allocated at: tmp = PyLong_FromLong(0x1000); tests/cpychecker/refcounts/too_many_increfs/input.c:26:9: note: when PyLong_FromLong() succeeds at: tmp = PyLong_FromLong(0x1000); tests/cpychecker/refcounts/too_many_increfs/input.c:31:5: note: when returning at: return tmp; tests/cpychecker/refcounts/too_many_increfs/input.c:30:5: error: dereferencing NULL (tmp->ob_refcnt) at tests/cpychecker/refcounts/too_many_increfs/input.c:30 tests/cpychecker/refcounts/too_many_increfs/input.c:26:9: note: when PyLong_FromLong() fails at: tmp = PyLong_FromLong(0x1000);--- Expected stderr +++ Actual stderr @@ -1,4 +1,4 @@ -tests/cpychecker/refcounts/too_many_increfs/input.c: In function 'too_many_increfs': +tests/cpychecker/refcounts/too_many_increfs/input.c: In function ‘too_many_increfs’: tests/cpychecker/refcounts/too_many_increfs/input.c:31:5: error: ob_refcnt of return value is 1 too high tests/cpychecker/refcounts/too_many_increfs/input.c:26:9: note: PyLongObject allocated at: tmp = PyLong_FromLong(0x1000); tests/cpychecker/refcounts/too_many_increfs/input.c:26:9: note: when PyLong_FromLong() succeeds at: tmp = PyLong_FromLong(0x1000);
tests/cpychecker/refcounts/loop_n_times: OK tests/cpychecker/refcounts/not_setting_exception: FAIL
returncode: 1 compiling: /usr/bin/i686-pc-linux-gnu-gcc-4.6.1 -ggdb -c -o tests/cpychecker/refcounts/not_setting_exception/output.o -fplugin=/home/denys/src/my-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/not_setting_exception/script.py -I/usr/include/python2.7 tests/cpychecker/refcounts/not_setting_exception/input.c Stdout: Trace 0: Transitions: 'returning' Return value: repr(): ConcreteValue(gcctype='struct PyObject *', loc=None, value=0L) str(): (struct PyObject *)0L Exception: (struct PyObject *)0 from tests/cpychecker/refcounts/not_setting_exception/input.c:27 Stderr: tests/cpychecker/refcounts/not_setting_exception/input.c: In function ‘not_setting_exception’: tests/cpychecker/refcounts/not_setting_exception/input.c:32:5: error: returning (PyObject*)NULL without setting an exception tests/cpychecker/refcounts/not_setting_exception/input.c:32:5: note: when returning at: return NULL;--- Expected stderr +++ Actual stderr @@ -1,3 +1,3 @@ -tests/cpychecker/refcounts/not_setting_exception/input.c: In function 'not_setting_exception': +tests/cpychecker/refcounts/not_setting_exception/input.c: In function ‘not_setting_exception’: tests/cpychecker/refcounts/not_setting_exception/input.c:32:5: error: returning (PyObject*)NULL without setting an exception tests/cpychecker/refcounts/not_setting_exception/input.c:32:5: note: when returning at: return NULL;
tests/cpychecker/refcounts/returning_dead_object: FAIL
returncode: 1 compiling: /usr/bin/i686-pc-linux-gnu-gcc-4.6.1 -ggdb -c -o tests/cpychecker/refcounts/returning_dead_object/output.o -fplugin=/home/denys/src/my-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/returning_dead_object/script.py -I/usr/include/python2.7 tests/cpychecker/refcounts/returning_dead_object/input.c Stdout: Trace 0: Transitions: 'PyLong_FromLong() succeeds' 'taking False path' 'taking True path' 'returning' Return value: repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/returning_dead_object/input.c', line=29), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/returning_dead_object/input.c', line=29))) str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/returning_dead_object/input.c', line=29)) from tests/cpychecker/refcounts/returning_dead_object/input.c:29 r->ob_refcnt: RefcountValue(0) r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/returning_dead_object/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) Exception: (struct PyObject *)0 from tests/cpychecker/refcounts/returning_dead_object/input.c:27
Trace 1: Transitions: 'PyLong_FromLong() succeeds' 'taking False path' 'taking False path' 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/returning_dead_object/input.c:29' 'returning' Return value: repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/returning_dead_object/input.c', line=29), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/returning_dead_object/input.c', line=29))) str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/returning_dead_object/input.c', line=29)) from tests/cpychecker/refcounts/returning_dead_object/input.c:29 r->ob_refcnt: None r->ob_type: None Exception: (struct PyObject *)0 from tests/cpychecker/refcounts/returning_dead_object/input.c:27
Trace 2: Transitions: 'PyLong_FromLong() fails' 'taking True path' 'returning' Return value: repr(): ConcreteValue(gcctype='struct PyObject *', loc=None, value=0L) str(): (struct PyObject *)0L Exception: RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) Stderr: tests/cpychecker/refcounts/returning_dead_object/input.c: In function ‘returning_dead_object’: tests/cpychecker/refcounts/returning_dead_object/input.c:43:1: error: ob_refcnt of return value is 1 too low tests/cpychecker/refcounts/returning_dead_object/input.c:29:15: note: PyLongObject allocated at: PyObject *tmp = PyLong_FromLong(0x1000); tests/cpychecker/refcounts/returning_dead_object/input.c:29:15: note: when PyLong_FromLong() succeeds at: PyObject *tmp = PyLong_FromLong(0x1000); tests/cpychecker/refcounts/returning_dead_object/input.c:31:8: note: when taking False path at: if (!tmp) { tests/cpychecker/refcounts/returning_dead_object/input.c:39:5: note: reaching: Py_DECREF(tmp); tests/cpychecker/refcounts/returning_dead_object/input.c:39:5: note: when taking True path at: Py_DECREF(tmp); tests/cpychecker/refcounts/returning_dead_object/input.c:42:5: note: reaching: return tmp; tests/cpychecker/refcounts/returning_dead_object/input.c:43:1: note: when returning tests/cpychecker/refcounts/returning_dead_object/input.c:43:1: error: returning pointer to deallocated memory tests/cpychecker/refcounts/returning_dead_object/input.c:29:15: note: when PyLong_FromLong() succeeds at: PyObject *tmp = PyLong_FromLong(0x1000); tests/cpychecker/refcounts/returning_dead_object/input.c:31:8: note: when taking False path at: if (!tmp) { tests/cpychecker/refcounts/returning_dead_object/input.c:39:5: note: reaching: Py_DECREF(tmp); tests/cpychecker/refcounts/returning_dead_object/input.c:39:5: note: when taking False path at: Py_DECREF(tmp); tests/cpychecker/refcounts/returning_dead_object/input.c:39:5: note: reaching: Py_DECREF(tmp); tests/cpychecker/refcounts/returning_dead_object/input.c:39:5: note: when calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/returning_dead_object/input.c:29 at: Py_DECREF(tmp); tests/cpychecker/refcounts/returning_dead_object/input.c:42:5: note: reaching: return tmp; tests/cpychecker/refcounts/returning_dead_object/input.c:43:1: note: when returning tests/cpychecker/refcounts/returning_dead_object/input.c:39:5: note: memory deallocated here--- Expected stderr +++ Actual stderr @@ -1,4 +1,4 @@ -tests/cpychecker/refcounts/returning_dead_object/input.c: In function 'returning_dead_object': +tests/cpychecker/refcounts/returning_dead_object/input.c: In function ‘returning_dead_object’: tests/cpychecker/refcounts/returning_dead_object/input.c:43:1: error: ob_refcnt of return value is 1 too low tests/cpychecker/refcounts/returning_dead_object/input.c:29:15: note: PyLongObject allocated at: PyObject *tmp = PyLong_FromLong(0x1000); tests/cpychecker/refcounts/returning_dead_object/input.c:29:15: note: when PyLong_FromLong() succeeds at: PyObject *tmp = PyLong_FromLong(0x1000);
tests/cpychecker/refcounts/unrecognized_function: OK tests/cpychecker/refcounts/correct_decref: OK tests/cpychecker/refcounts/missing_decref: FAIL
returncode: 1 compiling: /usr/bin/i686-pc-linux-gnu-gcc-4.6.1 -ggdb -c -o tests/cpychecker/refcounts/missing_decref/output.o -fplugin=/home/denys/src/my-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/missing_decref/script.py -I/usr/include/python2.7 tests/cpychecker/refcounts/missing_decref/input.c Stdout: Trace 0: Transitions: 'PyList_New() succeeds' 'taking False path' 'PyLong_FromLong() succeeds' 'taking False path' 'PyList_SetItem() succeeds' 'returning' Return value: repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/missing_decref/input.c', line=27), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/missing_decref/input.c', line=27))) str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/missing_decref/input.c', line=27)) from tests/cpychecker/refcounts/missing_decref/input.c:27 r->ob_refcnt: RefcountValue(1) r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/missing_decref/input.c', line=27), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) PyLongObject allocated at tests/cpychecker/refcounts/missing_decref/input.c:30: repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/missing_decref/input.c', line=30)) str(): PyLongObject allocated at tests/cpychecker/refcounts/missing_decref/input.c:30 r->ob_refcnt: RefcountValue(0) r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/missing_decref/input.c', line=30), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) Exception: (struct PyObject *)0 from tests/cpychecker/refcounts/missing_decref/input.c:24
Trace 1: Transitions: 'PyList_New() succeeds' 'taking False path' 'PyLong_FromLong() fails' 'taking True path' 'returning' Return value: repr(): ConcreteValue(gcctype='struct PyObject *', loc=None, value=0L) str(): (struct PyObject *)0L PyListObject allocated at tests/cpychecker/refcounts/missing_decref/input.c:27: repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/missing_decref/input.c', line=27)) str(): PyListObject allocated at tests/cpychecker/refcounts/missing_decref/input.c:27 r->ob_refcnt: RefcountValue(1) r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/missing_decref/input.c', line=27), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) Exception: RegionForGlobal(gcc.VarDecl('PyExc_MemoryError'))
Trace 2: Transitions: 'PyList_New() fails' 'taking True path' 'returning' Return value: repr(): ConcreteValue(gcctype='struct PyObject *', loc=None, value=0L) str(): (struct PyObject *)0L Exception: RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) Stderr: tests/cpychecker/refcounts/missing_decref/input.c: In function ‘missing_decref’: tests/cpychecker/refcounts/missing_decref/input.c:38:1: error: ob_refcnt of PyListObject is 1 too high tests/cpychecker/refcounts/missing_decref/input.c:27:10: note: PyListObject allocated at: list = PyList_New(1); tests/cpychecker/refcounts/missing_decref/input.c:27:10: note: when PyList_New() succeeds at: list = PyList_New(1); tests/cpychecker/refcounts/missing_decref/input.c:28:8: note: when taking False path at: if (!list) tests/cpychecker/refcounts/missing_decref/input.c:30:10: note: reaching: item = PyLong_FromLong(42); tests/cpychecker/refcounts/missing_decref/input.c:30:10: note: when PyLong_FromLong() fails at: item = PyLong_FromLong(42); tests/cpychecker/refcounts/missing_decref/input.c:33:8: note: when taking True path at: if (!item) tests/cpychecker/refcounts/missing_decref/input.c:34:9: note: reaching: return NULL; tests/cpychecker/refcounts/missing_decref/input.c:38:1: note: when returning--- Expected stderr +++ Actual stderr @@ -1,4 +1,4 @@ -tests/cpychecker/refcounts/missing_decref/input.c: In function 'missing_decref': +tests/cpychecker/refcounts/missing_decref/input.c: In function ‘missing_decref’: tests/cpychecker/refcounts/missing_decref/input.c:38:1: error: ob_refcnt of PyListObject is 1 too high tests/cpychecker/refcounts/missing_decref/input.c:27:10: note: PyListObject allocated at: list = PyList_New(1); tests/cpychecker/refcounts/missing_decref/input.c:27:10: note: when PyList_New() succeeds at: list = PyList_New(1);
tests/cpychecker/refcounts/fold_conditional: OK tests/cpychecker/refcounts/object_leak: FAIL
returncode: 1 compiling: /usr/bin/i686-pc-linux-gnu-gcc-4.6.1 -ggdb -c -o tests/cpychecker/refcounts/object_leak/output.o -fplugin=/home/denys/src/my-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/object_leak/script.py -I/usr/include/python2.7 tests/cpychecker/refcounts/object_leak/input.c Stdout: Trace 0: returned: ConcreteValue(gcctype='struct PyObject *', loc=None, value=0L) Trace 1: returned: ConcreteValue(gcctype='struct PyObject *', loc=None, value=0L) Stderr: tests/cpychecker/refcounts/object_leak/input.c: In function ‘object_leak’: tests/cpychecker/refcounts/object_leak/input.c:29:5: error: ob_refcnt of PyLongObject is 1 too high tests/cpychecker/refcounts/object_leak/input.c:26:15: note: PyLongObject allocated at: PyObject *tmp = PyLong_FromLong(0x1000); tests/cpychecker/refcounts/object_leak/input.c:26:15: note: when PyLong_FromLong() succeeds at: PyObject *tmp = PyLong_FromLong(0x1000); tests/cpychecker/refcounts/object_leak/input.c:29:5: note: when returning at: return NULL; tests/cpychecker/refcounts/object_leak/input.c:29:5: error: returning (PyObject*)NULL without setting an exception tests/cpychecker/refcounts/object_leak/input.c:26:15: note: when PyLong_FromLong() succeeds at: PyObject *tmp = PyLong_FromLong(0x1000); tests/cpychecker/refcounts/object_leak/input.c:29:5: note: when returning at: return NULL;--- Expected stderr +++ Actual stderr @@ -1,4 +1,4 @@ -tests/cpychecker/refcounts/object_leak/input.c: In function 'object_leak': +tests/cpychecker/refcounts/object_leak/input.c: In function ‘object_leak’: tests/cpychecker/refcounts/object_leak/input.c:29:5: error: ob_refcnt of PyLongObject is 1 too high tests/cpychecker/refcounts/object_leak/input.c:26:15: note: PyLongObject allocated at: PyObject *tmp = PyLong_FromLong(0x1000); tests/cpychecker/refcounts/object_leak/input.c:26:15: note: when PyLong_FromLong() succeeds at: PyObject *tmp = PyLong_FromLong(0x1000);
tests/examples/hello-world: OK 29 successes; 12 failures Failed tests: tests/plugin/diagnostics tests/plugin/options tests/cpychecker/PyArg_ParseTuple/keywords tests/cpychecker/PyArg_ParseTuple/incorrect_codes_S_and_U tests/cpychecker/PyArg_ParseTuple/incorrect_code_z_hash tests/cpychecker/refcounts/incorrect_py_none tests/cpychecker/refcounts/use_after_dealloc tests/cpychecker/refcounts/too_many_increfs tests/cpychecker/refcounts/not_setting_exception tests/cpychecker/refcounts/returning_dead_object tests/cpychecker/refcounts/missing_decref tests/cpychecker/refcounts/object_leak make: *** [test-suite] Error 1
--Denys
On Wed, 2011-07-27 at 10:32 +0200, Denys Duchier wrote:
Hi David, here is the new transcript after updating:
Thanks! Notes follow inline below:
tests/plugin/diagnostics: FAIL -tests/plugin/diagnostics/input.c: In function 'main': +tests/plugin/diagnostics/input.c: In function ‘main’:
It looks like it's emitting unicode quote characters: U+2018 LEFT SINGLE QUOTATION MARK and: U+2019 RIGHT SINGLE QUOTATION MARK whereas the test is expecting the plain ASCII: U+0027 APOSTROPHE
I tried to change this expectation in f42aa1507acbfc5b0274ff2b65875d5510899fcb http://git.fedorahosted.org/git/?p=gcc-python-plugin.git;a=commit;h=f42aa150...
where I started setting LANG=C when running the tests.
The message is emitted in 4.6.0 by gcc/langhooks.c: pp_printf (context->printer, _("In function %qs"), identifier_to_locale (lang_hooks.decl_printable_name (fndecl, 2)));
"%qs" means a quoted string in gcc/prettyprint.c, and it seems to use: extern const char *open_quote; extern const char *close_quote; from gcc/intl.h, set up in gcc/intl.c
Rereading locale(1), it seems LANG is merely used for defaults, and LC_ALL overrides everything; I was able to reproduce the failure by running:
$ LC_ALL=en_US.UTF-8 make
so I now think I should be setting LC_ALL=C instead of LANG=C when trying to compare against an expected output.
Fix committed as 4079ec5a6b6ef2e012c0f14a07e4bc0b8c5530b1 ; with that, all tests run to completion for me, for the above invocation of "make".
tests/plugin/options: FAIL
- option.is_enabled: False
- option.is_enabled: True
This is the minor failure we saw earlier in this discussion. I've tried to fix this in b08a84c493eb9ca569652aa208a3572e5a8fe02d
tests/cpychecker/PyArg_ParseTuple/keywords: FAIL tests/cpychecker/PyArg_ParseTuple/incorrect_codes_S_and_U: FAIL tests/cpychecker/PyArg_ParseTuple/incorrect_code_z_hash: FAIL tests/cpychecker/refcounts/incorrect_py_none: FAIL tests/cpychecker/refcounts/use_after_dealloc: FAIL tests/cpychecker/refcounts/too_many_increfs: FAIL tests/cpychecker/refcounts/not_setting_exception: FAIL tests/cpychecker/refcounts/returning_dead_object: FAIL tests/cpychecker/refcounts/missing_decref: FAIL tests/cpychecker/refcounts/object_leak: FAIL
These remaining failures appear to all be the same locale issue as above, so (I hope) are now fixed.
If you pull the latest version from git, how are things looking?
Dave
David Malcolm dmalcolm@redhat.com writes:
If you pull the latest version from git, how are things looking?
After also fixing testcpychecker.py to use config.py instead of wiring in python and python config, I get:
... Ran 65 tests in 45.284s
OK (skipped=3)
so, this looks good :-) Cheers, --Denys
On Wed, 2011-07-27 at 22:33 +0200, Denys Duchier wrote:
David Malcolm dmalcolm@redhat.com writes:
If you pull the latest version from git, how are things looking?
After also fixing testcpychecker.py to use config.py instead of wiring in python and python config, I get:
... Ran 65 tests in 45.284s OK (skipped=3)
so, this looks good :-)
Excellent - thanks for checking this!
I'm working on fixing the config issue.
Dave
On Thu, 2011-07-28 at 13:04 -0400, David Malcolm wrote:
On Wed, 2011-07-27 at 22:33 +0200, Denys Duchier wrote:
David Malcolm dmalcolm@redhat.com writes:
If you pull the latest version from git, how are things looking?
After also fixing testcpychecker.py to use config.py instead of wiring in python and python config, I get:
[...snip...]
I'm working on fixing the config issue.
Fixed (I hope) in 629182bacb7c2fa35accfbd005b4d2153c36fa7b
Dave
gcc-python-plugin@lists.fedorahosted.org