Hi Nada,
Apologies for not being able to reply earlier as well. I’m glad to hear
you’re interested in continuing this project! There is still a lot of work
to be done — my work from last summer is in a very prototype stage. As
David mentioned, familiarizing myself with the analyzer took some time,
On Thu, Sep 7, 2023 at 1:28 PM David Malcolm wrote:
> On Mon, 2023-09-04 at 22:13 -0400, Eric Feng wrote:
>
> > Hi Dave,
>
> Hi Eric, thanks for the patch.
>
> >
> > Recently I've been working on symbolic value support for the reference
> > count checker. I've attached a patch for it below; let m
Hi Dave,
Recently I've been working on symbolic value support for the reference
count checker. I've attached a patch for it below; let me know it looks
OK for trunk. Thanks!
Best,
Eric
---
This patch enhances the reference count checker in the CPython plugin by
adding support for symbolic value
eng
> > >
> > > From: Eric Feng via Gcc
> >
> > > gcc/testsuite/ChangeLog:
> > > PR analyzer/107646
> > > * gcc.dg/plugin/analyzer_cpython_plugin.c: Implements
> > > reference count
> > > * checking for PyObjects.
On Thu, Aug 31, 2023 at 4:19 PM David Malcolm wrote:
>
> On Thu, 2023-08-31 at 15:09 -0400, Eric Feng wrote:
> > On Thu, Aug 31, 2023 at 1:01 PM David Malcolm
> > wrote:
> > >
> > > On Wed, 2023-08-30 at 18:15 -0400, Eric Feng wrote:
>
> [...]
>
> > > >
> > > > Thanks; pushed to trunk with nits f
On Thu, Aug 31, 2023 at 1:01 PM David Malcolm wrote:
>
> On Wed, 2023-08-30 at 18:15 -0400, Eric Feng wrote:
> > On Tue, Aug 29, 2023 at 5:14 PM David Malcolm
> > wrote:
> > >
> > > On Tue, 2023-08-29 at 13:28 -0400, Eric Feng wrote:
> > > > Additionally, by using the old model and the pointer pe
On Tue, Aug 29, 2023 at 5:14 PM David Malcolm wrote:
>
> On Tue, 2023-08-29 at 13:28 -0400, Eric Feng wrote:
> > Additionally, by using the old model and the pointer per your
> > suggestion,
> > we are able to find the representative tree and emit a more accurate
> > diagnostic!
> >
> > rc3.c:23:1
Additionally, by using the old model and the pointer per your suggestion,
we are able to find the representative tree and emit a more accurate diagnostic!
rc3.c:23:10: warning: expected ‘item’ to have reference count: ‘1’ but
ob_refcnt field is: ‘2’
23 | return list;
| ^~~~
On Tue, Aug 29, 2023 at 12:32 AM Eric Feng wrote:
>
> Hi Dave,
>
> Thanks for the feedback. I've addressed the changes you mentioned in
> addition to adding more test cases. I've also taken this chance to
> split the test files according to known function subclasses, as you previously
> suggested.
Hi Dave,
Thanks for the feedback. I've addressed the changes you mentioned in
addition to adding more test cases. I've also taken this chance to
split the test files according to known function subclasses, as you previously
suggested. Since there were also some changes to the core analyzer, I've
Hi Dave,
Please find an updated WIP patch on reference count checking below. Some
parts aren't properly formatted yet; I apologize for that.
Since the last WIP patch, the major updates include:
- Updated certain areas of the core analyzer to support custom stmt_finder.
- A significant revamp of t
On Wed, Aug 23, 2023 at 7:16 PM David Malcolm wrote:
>
> On Wed, 2023-08-23 at 17:15 -0400, Eric Feng wrote:
> > On Mon, Aug 21, 2023 at 11:04 AM David Malcolm
> > wrote:
> > >
> > > On Mon, 2023-08-21 at 10:05 -0400, Eric Feng wrote:
> > > > Hi Dave,
> > > >
> > > > Just wanted to give you and e
On Mon, Aug 21, 2023 at 11:04 AM David Malcolm wrote:
>
> On Mon, 2023-08-21 at 10:05 -0400, Eric Feng wrote:
> > Hi Dave,
> >
> > Just wanted to give you and everyone else a short update on how
> > reference count checking is going — we can now observe the refcnt
> > diagnostic being emitted:
> >
:
>
> Hi Dave,
>
> Thanks for the feedback!
>
>
> On Wed, Aug 16, 2023 at 5:29 PM David Malcolm wrote:
> >
> > On Wed, 2023-08-16 at 15:17 -0400, Eric Feng via Gcc wrote:
> > > Hi everyone,
> >
> > [fixing typo in my email address]
>
Hi Dave,
Thanks for the feedback!
On Wed, Aug 16, 2023 at 5:29 PM David Malcolm wrote:
>
> On Wed, 2023-08-16 at 15:17 -0400, Eric Feng via Gcc wrote:
> > Hi everyone,
>
> [fixing typo in my email address]
>
> Hi Eric, thanks for the update, and the WIP patch.
>
>
Hi everyone,
After pushing the code that supports various known function classes last week,
I've turned my attention back to the core reference count checking
functionality. This functionality used to reside in region_model, which
wasn't ideal. To address this, I've introduced a hook to register
I've noticed there were still some strange indentations in the last
patch ... however, I think I've finally figured out a sane formatting
solution for me (fingers crossed). I will address them in the
follow-up patch at the same time as adding more test coverage.
---
In case, anyone else using VSC
Thanks for the feedback! I've incorporated the changes (aside from
expanding test coverage, which I plan on releasing in a follow-up),
rebased, and performed a bootstrap and regtest on
aarch64-unknown-linux-gnu. Since you mentioned that it is good for trunk
with nits fixed and no problems after reb
Thank you for your help in getting dg-require-python-h working! I can
confirm that the FAILs are related to differences between the --cflags
affecting the gimple seen by the analyzer. For this reason, I have
changed it to --includes for now. To be sure, I tested on Python 3.8 as
well and it works a
Unfortunately, there doesn’t seem to be any ERRORs in the .log nor any of the
debug print statements which I’ve scattered within proc dg-require-python-h
when run. I’ve attached the WIP below; thank you! Please note that in this
version of the patch, I’ve removed the other (non Python) test case
On Fri, Aug 4, 2023 at 6:46 PM David Malcolm wrote:
>
> On Fri, 2023-08-04 at 18:42 -0400, David Malcolm wrote:
> > On Fri, 2023-08-04 at 16:48 -0400, Eric Feng wrote:
> > > On Fri, Aug 4, 2023 at 11:39 AM David Malcolm
> > > wrote:
> > > >
> > > > On Fri, 2023-08-04 at 11:02 -0400, Eric Feng wro
On Fri, Aug 4, 2023 at 11:39 AM David Malcolm wrote:
>
> On Fri, 2023-08-04 at 11:02 -0400, Eric Feng wrote:
> > Hi Dave,
> >
> > Tests related to our plugin which depend on Python-specific
> > definitions have been run by including /* { dg-options "-fanalyzer
> > -I/usr/include/python3.9" } */. T
Hi Dave,
Tests related to our plugin which depend on Python-specific
definitions have been run by including /* { dg-options "-fanalyzer
-I/usr/include/python3.9" } */. This is undoubtedly not ideal; is it
best to approach this problem by adapting a subset of relevant
definitions like in gil.h?
Be
>
> My guess is that you were trying to do it from the PLUGIN_ANALYZER_INIT
> hook rather than from the plugin_init function, but it's hard to be
> sure without seeing the code.
>
Thanks Dave, you are entirely right — I made the mistake of trying to
do it from PLUGIN_ANALYZER_INIT hook and not fro
[...]
> As noted in our chat earlier, I don't think we can easily make these
> work. Looking at CPython's implementation: PyList_Type's initializer
> here:
> https://github.com/python/cpython/blob/main/Objects/listobject.c#L3101
> initializes tp_flags with the flags, but:
> (a) we don't see that c
Hi Dave,
Thanks for the comments!
[...]
> Do you have any DejaGnu tests for this functionality? For example,
> given PyList_New
> https://docs.python.org/3/c-api/list.html#c.PyList_New
> there could be a test like:
>
> /* { dg-require-effective-target python_h } */
>
> #define PY_SSIZE_T_CLEAN
Hi all,
I would like to update everyone on the progress of the static analyzer
plugin for CPython extension module code. Since the last update, I
have implemented known function subclasses for PyList_New and
PyList_Append. The existing known function subclasses have also been
enhanced to provide m
Hi Steven,
Thanks for reaching out. The project is still in very early stages. So
far we have taught the analyzer the basic behavior for
PyLong_FromLong, PyList_New, and Py_DECREF via known function
subclassing. Additionally, Py_INCREF is supported out of the box.
Reference count checking function
Hi Dave,
> If that's the code, does it work if you get rid of the "if (0)"
> conditional, or change it to "if (1)"? As written, that guard is
> false, so that call to "inform" will never be executed.
Woops! Somehow I missed that but yes, it works now. Thanks!
> Are you invoking gcc from an ins
Hi everyone,
I am one of the GSoC participants this year — in particular, I am
working on a static analyzer plugin for CPython extension module code.
I'm encountering a few challenges and would appreciate any guidance on
the following issues:
1) Issue with "inform" diagnostics in the plugin:
I am
, Apr 3, 2023 at 11:29 AM Martin Jambor wrote:
>
> Hello,
>
> On Mon, Apr 03 2023, Eric Feng via Gcc wrote:
> > Hi Steven,
> >
> > I’m happy to collaborate on this project together — it would be great
> > to have your experience with CPython internals on the te
Hi Steven,
I’m happy to collaborate on this project together — it would be great
to have your experience with CPython internals on the team.
> And by the way, I can get to work long before the start-coding time point of
> GSoC timeline.
I can be involved in some capacity before the start-codin
Thanks for bringing this to my attention Dave! I’m happy to
collaborate on this project with Steven. I will reply in more detail
in the other thread.
Best,
Eric
On Sun, Apr 2, 2023 at 7:28 PM David Malcolm wrote:
>
> On Sat, 2023-04-01 at 19:49 -0400, Eric Feng wrote:
> > > For the task above,
PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS)
>
> these declarations require non-NULL args, and thus perhaps we could add
> some new macros making the above decls look like:
>
> PyAPI_FUNC(Py_ssize_t) PyList_Size(PyObject *)
> PyAPI_NonNullArg(1);
>
>
ou clarify by giving an example of what
the new attributes you had in mind might look like and how they would
help (for example with respect to reference counting semantics)?
Incidentally, I forgot to mention in my previous email but I believe
the 350-hour option is the one that is more appropriate fo
Hi GCC community,
For GSoC, I am extremely interested in working on the selected project
idea with respect to extending the static analysis pass. In
particular, porting gcc-python-plugin's cpychecker to a plugin for GCC
-fanalyzer as described in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107646
36 matches
Mail list logo