Loading ...
Sorry, an error occurred while loading the content.

Re: [Cheetahtemplate-discuss] Cheetah causing Python to segfault

Expand Messages
  • Tavis Rudd
    Hi Warren, from your description it sounds like the problem might be related to the import mechanisms Webware uses to load a servlet, though I m not sure why
    Message 1 of 7 , Jul 17, 2002
    • 0 Attachment
      Hi Warren,
      from your description it sounds like the problem might be related to the
      import mechanisms Webware uses to load a servlet, though I'm not sure why at
      this stage. I have a few questions:

      1- have all of your .tmpl templates been converted to .py modules? I assume
      yes.
      2- Do all of your direcories have an __init__.py file in them?
      3- Does Python leave a core file befind?

      Tavis

      On July 17, 2002 02:00 pm, Warren Smith wrote:
      > I have been evaluating Webware and Cheetah for possible use in a number
      > of upcoming applications. For the most part, I like what I see.
      >
      > As part of my evaluation, I have been developing a proof-of-concept
      > application and have run into a situation in which it seems that Cheetahis
      > causing Python to segfault.
      >
      > My platform looks like this:
      >
      > OS: FreeBSD 4.6-RELEASE-p2
      > Web Server: Apache 1.3.26 with mod_webkit
      > Python: 2.2.1
      > Webware: 0.7
      > Cheetah: 0.9.13
      >
      > I built the application in the manner recommended by the docs, using the
      > inheritance model. In doing so, my inheritance tree became moderately
      > deep as I tried to extract common behavior into base classes, anticipating
      > being able to share these between several applications.
      > My inheritance tree looks like this:
      >
      > SkeletonPage # Included with Cheetah
      > BaseLogic.py # My global base class
      > BaseTemplate # My global base template
      > SidebarTemplate # My global "Sidebar" template
      > AppBaseLogic # My app's base class
      > AppBaseTemplate # My app's base template
      > Page1Logic
      > Page1
      > Page4Logic
      > Page4
      > Page2Logic
      > Page2
      > Page3
      > etc...
      >
      > Everthing worked fine untill I began work on Page4. I found that if I
      > requested Page4 (or even Page4Logic) right after restarting WebKit, Python
      > would segfault. This was surprising given that I had experienced
      > absolutelyno stability problems with Python or WebKit up to this point.
      >
      > After much experimentation I found that one of the things that the crashes
      > seemed to have in common was the inheritance level of the servlet
      > requested.
      > Wanting to know if this was a problem produced by my code or by the
      > Webware and Cheetah code, I changed all of my modules, from BaseLogic
      > down, to:
      > from MODULE_NAME import BASE_CLASS_NAME
      > class SUB_CLASS_NAME(BASE_CLASS_NAME):
      > pass
      >
      > Still, any request for Page4Logic or below after restarting WebKit would
      > cause Python to segfault.
      > Wanting to know if the problem was with Webware or Cheetah, I changed
      > BaseLogic to inherit from WebKit.Page and the segfaults stopped.
      > From this I suspect that there may be a bug in the Cheetah code somewhere,
      > or that Cheetah is exposing a bug in Webware or Python 2.2.1 somehow.
      > Since it only happens right after WebKit has been restarted, I suspectit
      > might be code that only executes on import.
      >
      > It seems I can work around this by requesting a higher level page before
      > Page4. However, since I will not be able to control the sequence of real
      > requests, I cannot seriously consider using Cheetah for a real application
      > until I resolve this issue.
      > Thanks in advance for any help that anyone can give me.



      -------------------------------------------------------
      This sf.net email is sponsored by:ThinkGeek
      Welcome to geek heaven.
      http://thinkgeek.com/sf
      _______________________________________________
      Cheetahtemplate-discuss mailing list
      Cheetahtemplate-discuss@...
      https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
    • Warren Smith
      ... Yes. ... I have an __init__.py in the directory that my context is pointing to. There are no __init__.py files in my app s lib directory or in my global
      Message 2 of 7 , Jul 18, 2002
      • 0 Attachment
        Tavis Rudd said:
        > Hi Warren,
        > from your description it sounds like the problem might be related to
        > the import mechanisms Webware uses to load a servlet, though I'm not
        > sure why at this stage. I have a few questions:
        >
        > 1- have all of your .tmpl templates been converted to .py modules? I
        > assume yes.

        Yes.

        > 2- Do all of your direcories have an __init__.py file in them?

        I have an __init__.py in the directory that my context is pointing to.
        There are no __init__.py files in my app's "lib" directory or in my global
        "lib" directory.

        > 3- Does Python leave a core file befind?

        Yes it does.

        >
        > Tavis
        >
        > On July 17, 2002 02:00 pm, Warren Smith wrote:
        >> I have been evaluating Webware and Cheetah for possible use in a
        >> number of upcoming applications. For the most part, I like what I
        >> see.
        >>
        >> As part of my evaluation, I have been developing a proof-of-concept
        >> application and have run into a situation in which it seems that
        >> Cheetahis causing Python to segfault.
        >>
        >> My platform looks like this:
        >>
        >> OS: FreeBSD 4.6-RELEASE-p2
        >> Web Server: Apache 1.3.26 with mod_webkit
        >> Python: 2.2.1
        >> Webware: 0.7
        >> Cheetah: 0.9.13
        >>
        >> I built the application in the manner recommended by the docs, using
        >> the inheritance model. In doing so, my inheritance tree became
        >> moderately deep as I tried to extract common behavior into base
        >> classes, anticipating being able to share these between several
        >> applications.
        >> My inheritance tree looks like this:
        >>
        >> SkeletonPage # Included with Cheetah
        >> BaseLogic.py # My global base class
        >> BaseTemplate # My global base template
        >> SidebarTemplate # My global "Sidebar" template
        >> AppBaseLogic # My app's base class
        >> AppBaseTemplate # My app's base template
        >> Page1Logic
        >> Page1
        >> Page4Logic
        >> Page4
        >> Page2Logic
        >> Page2
        >> Page3
        >> etc...
        >>
        >> Everthing worked fine untill I began work on Page4. I found that if I
        >> requested Page4 (or even Page4Logic) right after restarting WebKit,
        >> Python would segfault. This was surprising given that I had
        >> experienced absolutelyno stability problems with Python or WebKit up
        >> to this point.
        >>
        >> After much experimentation I found that one of the things that the
        >> crashes seemed to have in common was the inheritance level of the
        >> servlet requested.
        >> Wanting to know if this was a problem produced by my code or by the
        >> Webware and Cheetah code, I changed all of my modules, from BaseLogic
        >> down, to:
        >> from MODULE_NAME import BASE_CLASS_NAME
        >> class SUB_CLASS_NAME(BASE_CLASS_NAME):
        >> pass
        >>
        >> Still, any request for Page4Logic or below after restarting WebKit
        >> would cause Python to segfault.
        >> Wanting to know if the problem was with Webware or Cheetah, I changed
        >> BaseLogic to inherit from WebKit.Page and the segfaults stopped. From
        >> this I suspect that there may be a bug in the Cheetah code somewhere,
        >> or that Cheetah is exposing a bug in Webware or Python 2.2.1 somehow.
        >> Since it only happens right after WebKit has been restarted, I
        >> suspectit might be code that only executes on import.
        >>
        >> It seems I can work around this by requesting a higher level page
        >> before Page4. However, since I will not be able to control the
        >> sequence of real requests, I cannot seriously consider using Cheetah
        >> for a real application until I resolve this issue.
        >> Thanks in advance for any help that anyone can give me.
        >
        >
        >
        > -------------------------------------------------------
        > This sf.net email is sponsored by:ThinkGeek
        > Welcome to geek heaven.
        > http://thinkgeek.com/sf
        > _______________________________________________
        > Cheetahtemplate-discuss mailing list
        > Cheetahtemplate-discuss@...
        > https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss


        --
        Warren Smith
        warren@...




        -------------------------------------------------------
        This sf.net email is sponsored by:ThinkGeek
        Welcome to geek heaven.
        http://thinkgeek.com/sf
        _______________________________________________
        Cheetahtemplate-discuss mailing list
        Cheetahtemplate-discuss@...
        https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
      • Warren Smith
        Here s some additional info. With BaseLogic inheriting from SkeletonPage, If I change all of my templates to #from MODULE_NAME import BASE_CLASS_NAME #extends
        Message 3 of 7 , Jul 18, 2002
        • 0 Attachment
          Here's some additional info.

          With BaseLogic inheriting from SkeletonPage, If I change all of my
          templates to

          #from MODULE_NAME import BASE_CLASS_NAME
          #extends BASE_CLASS_NAME

          I get the segfault at Page4, but only after a restart.

          If I change BaseLogic to inherit form WebKit.Page, I get exceptions from
          the generated .py files since they expect to subclass Template.

          If I strip the generated .py files down to

          from MODULE_NAME import BASE_CLASS_NAME
          class SUB_CLASS_NAME(BASE_CLASS_NAME):
          pass

          then the exceptions go away and I don't get segfaults anywhere.

          If I change BaseLogic back to inheriting from SkeletonPage, but leave the
          generated .py files in their stripped down state, I get segfaults on
          EVERY page after a restart.

          When I had been in this state previously, I hadn't checked any other
          page but Page4, so I didn't realize that EVERY page was causing segfaults.

          I suppose that since I am doing nothing more than sub-classing several
          levels deep from SkeletonPage at this point, it may not have been intended
          to be used this way.
          Warren Smith said:
          > Tavis Rudd said:
          >> Hi Warren,
          >> from your description it sounds like the problem might be related to
          >> the import mechanisms Webware uses to load a servlet, though I'm not
          >> sure why at this stage. I have a few questions:
          >>
          >> 1- have all of your .tmpl templates been converted to .py modules? I
          >> assume yes.
          >
          > Yes.
          >
          >> 2- Do all of your direcories have an __init__.py file in them?
          >
          > I have an __init__.py in the directory that my context is pointing to.
          > There are no __init__.py files in my app's "lib" directory or in my
          > global "lib" directory.
          >
          >> 3- Does Python leave a core file befind?
          >
          > Yes it does.
          >
          >>
          >> Tavis
          >>
          >> On July 17, 2002 02:00 pm, Warren Smith wrote:
          >>> I have been evaluating Webware and Cheetah for possible use in a
          >>> number of upcoming applications. For the most part, I like what I
          >>> see.
          >>>
          >>> As part of my evaluation, I have been developing a proof-of-concept
          >>> application and have run into a situation in which it seems that
          >>> Cheetahis causing Python to segfault.
          >>>
          >>> My platform looks like this:
          >>>
          >>> OS: FreeBSD 4.6-RELEASE-p2
          >>> Web Server: Apache 1.3.26 with mod_webkit
          >>> Python: 2.2.1
          >>> Webware: 0.7
          >>> Cheetah: 0.9.13
          >>>
          >>> I built the application in the manner recommended by the docs, using
          >>> the inheritance model. In doing so, my inheritance tree became
          >>> moderately deep as I tried to extract common behavior into base
          >>> classes, anticipating being able to share these between several
          >>> applications.
          >>> My inheritance tree looks like this:
          >>>
          >>> SkeletonPage # Included with Cheetah
          >>> BaseLogic.py # My global base class
          >>> BaseTemplate # My global base template
          >>> SidebarTemplate # My global "Sidebar" template
          >>> AppBaseLogic # My app's base class
          >>> AppBaseTemplate # My app's base template
          >>> Page1Logic
          >>> Page1
          >>> Page4Logic
          >>> Page4
          >>> Page2Logic
          >>> Page2
          >>> Page3
          >>> etc...
          >>>
          >>> Everthing worked fine untill I began work on Page4. I found that if
          >>> I requested Page4 (or even Page4Logic) right after restarting WebKit,
          >>> Python would segfault. This was surprising given that I had
          >>> experienced absolutelyno stability problems with Python or WebKit up
          >>> to this point.
          >>>
          >>> After much experimentation I found that one of the things that the
          >>> crashes seemed to have in common was the inheritance level of the
          >>> servlet requested.
          >>> Wanting to know if this was a problem produced by my code or by the
          >>> Webware and Cheetah code, I changed all of my modules, from BaseLogic
          >>> down, to:
          >>> from MODULE_NAME import BASE_CLASS_NAME
          >>> class SUB_CLASS_NAME(BASE_CLASS_NAME):
          >>> pass
          >>>
          >>> Still, any request for Page4Logic or below after restarting WebKit
          >>> would cause Python to segfault.
          >>> Wanting to know if the problem was with Webware or Cheetah, I changed
          >>> BaseLogic to inherit from WebKit.Page and the segfaults stopped. From
          >>> this I suspect that there may be a bug in the Cheetah code somewhere,
          >>> or that Cheetah is exposing a bug in Webware or Python 2.2.1 somehow.
          >>> Since it only happens right after WebKit has been restarted, I
          >>> suspectit might be code that only executes on import.
          >>>
          >>> It seems I can work around this by requesting a higher level page
          >>> before Page4. However, since I will not be able to control the
          >>> sequence of real requests, I cannot seriously consider using Cheetah
          >>> for a real application until I resolve this issue.
          >>> Thanks in advance for any help that anyone can give me.
          >>
          >>
          >>
          >> -------------------------------------------------------
          >> This sf.net email is sponsored by:ThinkGeek
          >> Welcome to geek heaven.
          >> http://thinkgeek.com/sf
          >> _______________________________________________
          >> Cheetahtemplate-discuss mailing list
          >> Cheetahtemplate-discuss@...
          >> https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
          >
          >
          > --
          > Warren Smith
          > warren@...
          >
          >
          >
          >
          > -------------------------------------------------------
          > This sf.net email is sponsored by:ThinkGeek
          > Welcome to geek heaven.
          > http://thinkgeek.com/sf
          > _______________________________________________
          > Cheetahtemplate-discuss mailing list
          > Cheetahtemplate-discuss@...
          > https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss


          --
          Warren Smith
          warren@...




          -------------------------------------------------------
          This sf.net email is sponsored by:ThinkGeek
          Welcome to geek heaven.
          http://thinkgeek.com/sf
          _______________________________________________
          Cheetahtemplate-discuss mailing list
          Cheetahtemplate-discuss@...
          https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
        • Tavis Rudd
          Would you mind sending me a tarballed copy of your files? ... This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf
          Message 4 of 7 , Jul 18, 2002
          • 0 Attachment
            Would you mind sending me a tarballed copy of your files?

            On July 18, 2002 09:15 am, Warren Smith wrote:
            > Here's some additional info.
            >
            > With BaseLogic inheriting from SkeletonPage, If I change all of my
            > templates to
            >
            > #from MODULE_NAME import BASE_CLASS_NAME
            > #extends BASE_CLASS_NAME
            >
            > I get the segfault at Page4, but only after a restart.
            >
            > If I change BaseLogic to inherit form WebKit.Page, I get exceptions from
            > the generated .py files since they expect to subclass Template.
            >
            > If I strip the generated .py files down to
            >
            > from MODULE_NAME import BASE_CLASS_NAME
            > class SUB_CLASS_NAME(BASE_CLASS_NAME):
            > pass
            >
            > then the exceptions go away and I don't get segfaults anywhere.
            >
            > If I change BaseLogic back to inheriting from SkeletonPage, but leave the
            > generated .py files in their stripped down state, I get segfaults on
            > EVERY page after a restart.
            >
            > When I had been in this state previously, I hadn't checked any other
            > page but Page4, so I didn't realize that EVERY page was causing segfaults.
            >
            > I suppose that since I am doing nothing more than sub-classing several
            > levels deep from SkeletonPage at this point, it may not have been intended
            > to be used this way.
            >
            > Warren Smith said:
            > > Tavis Rudd said:
            > >> Hi Warren,
            > >> from your description it sounds like the problem might be related to
            > >> the import mechanisms Webware uses to load a servlet, though I'm not
            > >> sure why at this stage. I have a few questions:
            > >>
            > >> 1- have all of your .tmpl templates been converted to .py modules? I
            > >> assume yes.
            > >
            > > Yes.
            > >
            > >> 2- Do all of your direcories have an __init__.py file in them?
            > >
            > > I have an __init__.py in the directory that my context is pointing to.
            > > There are no __init__.py files in my app's "lib" directory or in my
            > > global "lib" directory.
            > >
            > >> 3- Does Python leave a core file befind?
            > >
            > > Yes it does.
            > >
            > >> Tavis
            > >>
            > >> On July 17, 2002 02:00 pm, Warren Smith wrote:
            > >>> I have been evaluating Webware and Cheetah for possible use in a
            > >>> number of upcoming applications. For the most part, I like what I
            > >>> see.
            > >>>
            > >>> As part of my evaluation, I have been developing a proof-of-concept
            > >>> application and have run into a situation in which it seems that
            > >>> Cheetahis causing Python to segfault.
            > >>>
            > >>> My platform looks like this:
            > >>>
            > >>> OS: FreeBSD 4.6-RELEASE-p2
            > >>> Web Server: Apache 1.3.26 with mod_webkit
            > >>> Python: 2.2.1
            > >>> Webware: 0.7
            > >>> Cheetah: 0.9.13
            > >>>
            > >>> I built the application in the manner recommended by the docs, using
            > >>> the inheritance model. In doing so, my inheritance tree became
            > >>> moderately deep as I tried to extract common behavior into base
            > >>> classes, anticipating being able to share these between several
            > >>> applications.
            > >>> My inheritance tree looks like this:
            > >>>
            > >>> SkeletonPage # Included with Cheetah
            > >>> BaseLogic.py # My global base class
            > >>> BaseTemplate # My global base template
            > >>> SidebarTemplate # My global "Sidebar" template
            > >>> AppBaseLogic # My app's base class
            > >>> AppBaseTemplate # My app's base template
            > >>> Page1Logic
            > >>> Page1
            > >>> Page4Logic
            > >>> Page4
            > >>> Page2Logic
            > >>> Page2
            > >>> Page3
            > >>> etc...
            > >>>
            > >>> Everthing worked fine untill I began work on Page4. I found that if
            > >>> I requested Page4 (or even Page4Logic) right after restarting WebKit,
            > >>> Python would segfault. This was surprising given that I had
            > >>> experienced absolutelyno stability problems with Python or WebKit up
            > >>> to this point.
            > >>>
            > >>> After much experimentation I found that one of the things that the
            > >>> crashes seemed to have in common was the inheritance level of the
            > >>> servlet requested.
            > >>> Wanting to know if this was a problem produced by my code or by the
            > >>> Webware and Cheetah code, I changed all of my modules, from BaseLogic
            > >>> down, to:
            > >>> from MODULE_NAME import BASE_CLASS_NAME
            > >>> class SUB_CLASS_NAME(BASE_CLASS_NAME):
            > >>> pass
            > >>>
            > >>> Still, any request for Page4Logic or below after restarting WebKit
            > >>> would cause Python to segfault.
            > >>> Wanting to know if the problem was with Webware or Cheetah, I changed
            > >>> BaseLogic to inherit from WebKit.Page and the segfaults stopped. From
            > >>> this I suspect that there may be a bug in the Cheetah code somewhere,
            > >>> or that Cheetah is exposing a bug in Webware or Python 2.2.1 somehow.
            > >>> Since it only happens right after WebKit has been restarted, I
            > >>> suspectit might be code that only executes on import.
            > >>>
            > >>> It seems I can work around this by requesting a higher level page
            > >>> before Page4. However, since I will not be able to control the
            > >>> sequence of real requests, I cannot seriously consider using Cheetah
            > >>> for a real application until I resolve this issue.
            > >>> Thanks in advance for any help that anyone can give me.
            > >>
            > >> -------------------------------------------------------
            > >> This sf.net email is sponsored by:ThinkGeek
            > >> Welcome to geek heaven.
            > >> http://thinkgeek.com/sf
            > >> _______________________________________________
            > >> Cheetahtemplate-discuss mailing list
            > >> Cheetahtemplate-discuss@...
            > >> https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
            > >
            > > --
            > > Warren Smith
            > > warren@...
            > >
            > >
            > >
            > >
            > > -------------------------------------------------------
            > > This sf.net email is sponsored by:ThinkGeek
            > > Welcome to geek heaven.
            > > http://thinkgeek.com/sf
            > > _______________________________________________
            > > Cheetahtemplate-discuss mailing list
            > > Cheetahtemplate-discuss@...
            > > https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss



            -------------------------------------------------------
            This sf.net email is sponsored by:ThinkGeek
            Welcome to geek heaven.
            http://thinkgeek.com/sf
            _______________________________________________
            Cheetahtemplate-discuss mailing list
            Cheetahtemplate-discuss@...
            https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
          • Tavis Rudd
            ... Can you send me a copy of the core file (not cc d to the list)? ... This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven.
            Message 5 of 7 , Jul 18, 2002
            • 0 Attachment
              On July 18, 2002 07:42 am, Warren Smith wrote:
              > > 3- Does Python leave a core file befind?
              >
              > Yes it does.

              Can you send me a copy of the core file (not cc'd to the list)?



              -------------------------------------------------------
              This sf.net email is sponsored by:ThinkGeek
              Welcome to geek heaven.
              http://thinkgeek.com/sf
              _______________________________________________
              Cheetahtemplate-discuss mailing list
              Cheetahtemplate-discuss@...
              https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
            • Tavis Rudd
              Warren, what s the URI that you are trying to access via mod_webkit? The backtrace from the core file indicates that Python s Marshall module was doing
              Message 6 of 7 , Jul 18, 2002
              • 0 Attachment
                Warren,
                what's the URI that you are trying to access via mod_webkit? The backtrace
                from the core file indicates that Python's Marshall module was doing
                something right before the crash and marshall is used to decode the URIs,
                etc. that come in from mod_webkit. There might be something wrong with that
                code. Is it possible for you to test this with another WebKit adaptor?
                Tavis




                -------------------------------------------------------
                This sf.net email is sponsored by:ThinkGeek
                Welcome to geek heaven.
                http://thinkgeek.com/sf
                _______________________________________________
                Cheetahtemplate-discuss mailing list
                Cheetahtemplate-discuss@...
                https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
              Your message has been successfully submitted and would be delivered to recipients shortly.