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 Massimo Manghi <ma...@unipr.it> on 2014/07/19 23:52:57 UTC

Re: experiments with rivet and a threaded mpm(mpm_worker)

The problem seems to be 8.6 specific whereas the module works with Tcl 
8.5 without the mutex protecting the call to Tcl_EvalObjEx. Thus it 
looks like 8.6 doesn't like to work with threads when the environment 
embedding Tcl is multithreaded.

I get segfaults with random backtraces stemming from Tcl_EvalObjEx 
which suggests threads are spoiling unprotected data all around in 
several Tcl functions. NRE functions always appear in the bt output, but 
this is the engine for Tcl 8.6 so it's natural to find them.

  If anyone with a closer understanding of the Tcl core (Harald?, 
Arnulf?) has suggestions I would appreciate if they could express an 
opinion, I think I'm going to bring up the issue anyway on TCLCORE, just 
wanted to be prepared at the best to explain what's going on


  -- Massimo

On 19-07-2014 0:22, Massimo Manghi wrote:

> The only problem remaining with this very simple module is with the
> execution of a script by calling Tcl_EvalObjEx which must be 
> protected
> by a mutex. If I remove the mutex (and I want to because scripts run 
> in
> independent interpreters and should be able to run without
> serialization) the server responds with an HTTP 104 code (connection
> reset by peer) after a random number of requests (<100). I don't
> understand why and I will try to figure it out in the next future
>
>  -- Massimo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
> For additional commands, e-mail: rivet-dev-help@tcl.apache.org


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


Re: experiments with rivet and a threaded mpm(mpm_worker)

Posted by Massimo Manghi <ma...@unipr.it>.
I'm working on a new version of this test module that implements a 
one-thread-one-interpreter model as George Petasis pointed out. It seems 
to work but there a few problems still to be solved. I hope I can commit 
next week a version that should be able to parse / execute scripts 
without initialization handling, just as a testbed for doing a tests and 
prove the robustness of the model. This turned out to be a critical task 
as the previous module started tp crash when the server parameters were 
set to values that emulated extreme resource depletion.

  -- Massimo

On 19-07-2014 22:52, Massimo Manghi wrote:
> The problem seems to be 8.6 specific whereas the module works with
> Tcl 8.5 without the mutex protecting the call to Tcl_EvalObjEx. Thus
> it looks like 8.6 doesn't like to work with threads when the
> environment embedding Tcl is multithreaded.
>
> I get segfaults with random backtraces stemming from Tcl_EvalObjEx
> which suggests threads are spoiling unprotected data all around in
> several Tcl functions. NRE functions always appear in the bt output,
> but this is the engine for Tcl 8.6 so it's natural to find them.
>
>  If anyone with a closer understanding of the Tcl core (Harald?,
> Arnulf?) has suggestions I would appreciate if they could express an
> opinion, I think I'm going to bring up the issue anyway on TCLCORE,
> just wanted to be prepared at the best to explain what's going on
>
>
>  -- Massimo
>


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


Re: experiments with rivet and a threaded mpm (mpm_worker)

Posted by Massimo Manghi <mx...@apache.org>.
Thanks you  anyway Arnulf.  I'm going to write a message for the TCT.
Asking question like this is always hard because it's difficult to avoid
the danger of being too verbose in order to be complete

Massimo
Il 20/Lug/2014 09:26 "Arnulf Wiedemann" <ar...@wiedemann-pri.de> ha
scritto:

> Am 19.07.2014 23:52, schrieb Massimo Manghi:
>
>> The problem seems to be 8.6 specific whereas the module works with Tcl
>> 8.5 without the mutex protecting the call to Tcl_EvalObjEx. Thus it
>> looks like 8.6 doesn't like to work with threads when the environment
>> embedding Tcl is multithreaded.
>>
>> I get segfaults with random backtraces stemming from Tcl_EvalObjEx which
>> suggests threads are spoiling unprotected data all around in several Tcl
>> functions. NRE functions always appear in the bt output, but this is the
>> engine for Tcl 8.6 so it's natural to find them.
>>
>>   If anyone with a closer understanding of the Tcl core (Harald?,
>> Arnulf?) has suggestions I would appreciate if they could express an
>> opinion, I think I'm going to bring up the issue anyway on TCLCORE, just
>> wanted to be prepared at the best to explain what's going on
>>
>>
>>   -- Massimo
>>
>> On 19-07-2014 0:22, Massimo Manghi wrote:
>>
>>  The only problem remaining with this very simple module is with the
>>> execution of a script by calling Tcl_EvalObjEx which must be protected
>>> by a mutex. If I remove the mutex (and I want to because scripts run in
>>> independent interpreters and should be able to run without
>>> serialization) the server responds with an HTTP 104 code (connection
>>> reset by peer) after a random number of requests (<100). I don't
>>> understand why and I will try to figure it out in the next future
>>>
>>>  -- Massimo
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
>>> For additional commands, e-mail: rivet-dev-help@tcl.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
>> For additional commands, e-mail: rivet-dev-help@tcl.apache.org
>>
>>  Sorry I have no experience with that, as I have never worked with
> Threads (Tcl and otherwise).
>
> Arnulf
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
> For additional commands, e-mail: rivet-dev-help@tcl.apache.org
>
>

Re: experiments with rivet and a threaded mpm (mpm_worker)

Posted by Arnulf Wiedemann <ar...@wiedemann-pri.de>.
Am 19.07.2014 23:52, schrieb Massimo Manghi:
> The problem seems to be 8.6 specific whereas the module works with Tcl
> 8.5 without the mutex protecting the call to Tcl_EvalObjEx. Thus it
> looks like 8.6 doesn't like to work with threads when the environment
> embedding Tcl is multithreaded.
>
> I get segfaults with random backtraces stemming from Tcl_EvalObjEx which
> suggests threads are spoiling unprotected data all around in several Tcl
> functions. NRE functions always appear in the bt output, but this is the
> engine for Tcl 8.6 so it's natural to find them.
>
>   If anyone with a closer understanding of the Tcl core (Harald?,
> Arnulf?) has suggestions I would appreciate if they could express an
> opinion, I think I'm going to bring up the issue anyway on TCLCORE, just
> wanted to be prepared at the best to explain what's going on
>
>
>   -- Massimo
>
> On 19-07-2014 0:22, Massimo Manghi wrote:
>
>> The only problem remaining with this very simple module is with the
>> execution of a script by calling Tcl_EvalObjEx which must be protected
>> by a mutex. If I remove the mutex (and I want to because scripts run in
>> independent interpreters and should be able to run without
>> serialization) the server responds with an HTTP 104 code (connection
>> reset by peer) after a random number of requests (<100). I don't
>> understand why and I will try to figure it out in the next future
>>
>>  -- Massimo
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
>> For additional commands, e-mail: rivet-dev-help@tcl.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
> For additional commands, e-mail: rivet-dev-help@tcl.apache.org
>
Sorry I have no experience with that, as I have never worked with 
Threads (Tcl and otherwise).

Arnulf

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