#31 CLIPS garbage collection may cause segmentation fault

Errors
closed
Annoyances (7)
6
2008-02-22
2006-10-11
No

Due to the particular behaviour of CLIPS while garbage
collecting items, there are some situations where
inspection of entities that have been garbage-collected
can cause an access violation. In fact, CLIPS does not
retain the memory associated to slots in facts that
meet the following conditions:

- the fact has been created using a template
- the fact has not yet been asserted

In PyCLIPS versions up to 1.0.4, CLIPS garbage
collection locking is disabled by default, and this may
cause segmentation faults (or other annoyances, such as
strange characters while retrieving strings) when using
functions that inquire such items.

Although this bug is unlikely to be triggered, it would
be desirable to have PyCLIPS answer with an exception
instead of an abnormal program termination.

Discussion

  • Francesco Garosi

    Logged In: YES
    user_id=328337

    Actually the version present in the SVN repository highly
    reduces the problem impact, by forcing CLIPS GC lock (for
    each environment separately) whenever there are still such
    facts around. GC is automatically re-enabled when either all
    facts have been asserted, or [Env]Clear() is invoked.

    However there is still one case that produces an access
    violation - although even more unlikely to happen:

    >>> import clips
    >>> clips.Reset()
    >>> t = clips.BuildTemplate("t", "(slot s0)")
    >>> f = t.BuildFact()
    >>> f.Slots['s0'] = clips.Symbol("SYM0")
    >>> clips.Clear()
    >>> print f.PPForm()
    ---> (SEGMENTATION FAULT)

    This is just an example, other inquiries may still produce
    the same result after a call to Clear().

     
  • Francesco Garosi

    Logged In: YES
    user_id=328337
    Originator: YES

    The recently implemented changes allow to report with an exception most of the times that CLIPS GC would compromise a Python object. Not all situations are prevented, however the new structure should work in most cases. The bug will still be considered open until a final solution has been found.

     
  • Francesco Garosi

    Logged In: YES
    user_id=328337
    Originator: YES

    The fix for bug 1886693 does also solve this bug. Will be uploaded to SVN ASAP.

     
  • Francesco Garosi

    Logged In: YES
    user_id=328337
    Originator: YES

    The fixes for this bug or request have been accepted and
    committed to current RCS tree: next release will include these
    fixes, possibly among other enhancements.

     
  • Francesco Garosi

    Logged In: YES
    user_id=328337
    Originator: YES

    svn297 implements changes that fix this bug and another one.

     
  • Francesco Garosi

    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks