You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by bu...@apache.org on 2015/01/26 16:33:15 UTC

[Bug 57501] New: abort_page does not stop page execution after a call to ::rivet::parse

https://issues.apache.org/bugzilla/show_bug.cgi?id=57501

            Bug ID: 57501
           Summary: abort_page does not stop page execution after a call
                    to ::rivet::parse
           Product: Rivet
           Version: unspecified
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Rivet Core Commands
          Assignee: rivet-dev@tcl.apache.org
          Reporter: james.sulak@flightaware.com
                CC: mxmanghi@apache.org

Version 2.2 on FreeBSD.

After calling ::rivet::parse, a call to abort_page does not stop the execution
of the page, if the included rvt calls abort_page.  If the included rvt does
*not* call abort_page, the call in the outer rvt functions as expected.

I'm unclear as to what the intended behavior is.  Is the intention that the rvt
executed by ::rivet::parse is independent, with an independent lifecycle, or is
it simply meant as a "function call" inside the outer rvt page?


Test case:

test_parse.rvt:

<?
parse test_parse2.rvt
abort_page

puts "Execution continued."
?>

test_parse2.rvt:

<?
puts "Parsed rvt."
abort_page
?>


As a secondary issue, note that in a rivet + Tcl 8.5 installation, this can be
worked around by placing a "return" call after the parse statement.  However,
with Tcl 8.6, this results in the following error:

"errorCode 'TCL UNEXPECTED_RESULT_CODE 0', errorInfo 'command returned bad
code: 0    while executing "namespace eval request { puts -nonewline "" ..."

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


[Bug 57501] abort_page does not stop page execution after a call to ::rivet::parse

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57501

--- Comment #1 from Massimo Manghi <mx...@apache.org> ---
Thank you for reporting this issue. I think you hit something more relevant
than a simple bug, the way mod_rivet does script parsing and execution has to
be reconsidered and ironed out

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


[Bug 57501] abort_page does not stop page execution after a call to ::rivet::parse

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57501

--- Comment #8 from james.sulak@flightaware.com ---
I apologize, we haven't had a chance to test yet, since we've been using the
version of Rivet in FreeBSD ports, and haven't had a chance to patch and build.

We are going to test the 2.2 branch tomorrow and will update this thread with
our results.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


[Bug 57501] abort_page does not stop page execution after a call to ::rivet::parse

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57501

Massimo Manghi <mx...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #32404|0                           |1
        is obsolete|                            |

--- Comment #6 from Massimo Manghi <mx...@apache.org> ---
Created attachment 32406
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=32406&action=edit
3rd patch for ::rivet::abort_page handling

it turned out to be easier then I thought at first, but I haven't tested it.
Please let me know

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


[Bug 57501] abort_page does not stop page execution after a call to ::rivet::parse

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57501

Massimo Manghi <mx...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #32403|0                           |1
        is obsolete|                            |

--- Comment #3 from Massimo Manghi <mx...@apache.org> ---
Created attachment 32404
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=32404&action=edit
fix for improper handling of error code returned by parse command

Not only the Tcl status didn't unwind the whole calls stack but
after_every_script was called inconditionately after *each* parse

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


[Bug 57501] abort_page does not stop page execution after a call to ::rivet::parse

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57501

--- Comment #2 from Massimo Manghi <mx...@apache.org> ---
Created attachment 32403
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=32403&action=edit
Tcl error status propagates to the caller when ::rivet::parse is called

Tcl return error propagates up to the toplevel script and script execution
finalized in Rivet_SendContent

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


[Bug 57501] abort_page does not stop page execution after a call to ::rivet::parse

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57501

--- Comment #7 from Massimo Manghi <mx...@apache.org> ---
the patch aimed at fixing bug #57501 was applied (a bit further elaborated to
move the charset handling into TclWeb_PrintHeaders) and committed to
branches/2.2

I'm going to allow a few more dayes after which if no further problems will
surface I will close the bug 

 -- Massimo

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


[Bug 57501] abort_page does not stop page execution after a call to ::rivet::parse

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57501

--- Comment #4 from james.sulak@flightaware.com ---
Thank you for the quick response.  We'll test and see how it works.

I had noticed that after_every_script was called after every parse - which is
in fact how I discovered the bug, since our after_every_script calls
abort_page.  That seemed wrong, which is why I asked about intended behavior.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


[Bug 57501] abort_page does not stop page execution after a call to ::rivet::parse

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57501

Massimo Manghi <mx...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unspecified                 |2.2.0

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


[Bug 57501] abort_page does not stop page execution after a call to ::rivet::parse

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57501

--- Comment #5 from Massimo Manghi <mx...@apache.org> ---
In case abort_page gets called from within after_every_script it won't trigger
the AbortScript. AfterEveryScript was executed after AbortScript before I made
this patch anyway. And now it works this way all the more so because it gets
executed really as very last script. So it must be changed again. Let me check
the documentation but I suspect we have been having a quite haphazard setup for
these procedures. If I understand you want to have AbortScript to be run
whenever ::rivet::abort_page is called (perhaps only ErrorScript shouldn't run
it) which makes sense but it's going to add here and there a few more 

if (rsc->after_every_script != NULL)

   Tcl_Exec....



please hold on a few more hours then...

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org