Hi guys,

I spent some time today trying to figure out why the share lib works fine
under the tclsh but not within rivet.

I haven't found the pattern yet. But so far:

- If I have a vwait forever in the RivetChildInit script, my lib loads fine
and all the threads are spinning nicely and my TCL callbacks are called.

- But if I have a vwait forever in the RivetChildInit script, rivet is
stuck and does not serve any incoming http requests.

I tried to create a slave interpreter in the load, which passed it along
the library ..._init C hookup function but this did not help.

So this is not an easy one.

Thank you
Brice.



On Sun, Jun 10, 2018 at 11:25 PM, Brice Hamon <normandvik...@gmail.com>
wrote:

> Hi guys,
>
> Quick update: some progress.
>
> I upgraded TCL to the latest 8.6.8 and recompiled Rivet 3.0.1, as well as
> my shared library.
>
> 2 points:
>
> 1) Now the after {...} command works, only if I add a vwait forever in the
> RivetChildInit script. Else the after is never triggered.
>
> 2) In my shared library C++ code that I load in the RivetChildInit and
> which creates a ynet command, I am logging the address of
> the pointer of the c++ session object created with a [ynet new] command.
> When Apache starts, it spawns 5 children, and I see in the log of the c++
> code called from the [ynet new]  command.
> But here, strangely enough, the address of the session pointers are all
> identical. This trigger crashes later in my code of course.
> How is that possible? A system command new() can not return the same
> address on the same host.
> Am I missing something here?
>
> Thank you.
> Brice.
>
>
> On Sat, Jun 9, 2018 at 2:33 PM, Brice Hamon <normandvik...@gmail.com>
> wrote:
>
>> Hello Massimo.
>>
>> Ok thanks for the tip and I will try with a newer version of TCL.
>>
>> I am trying to load a shared library in the RiverchildInit which provides
>> access to a messaging platform.
>>
>> This shared library written in C++ using the TCL C api works perfectly
>> under a tclsh with a load command, but I am facing this first issue when
>> loaded in Apache/Rivet.
>>
>> I managed to get it loaded and all the C++ threads are working correctly.
>> Only the notification to TCL api callbacks were not triggered.
>>
>> I will report once I make the upgrade and recompile the TCL Api.
>>
>> Thank you,
>> Brice.
>>
>>
>> On Sat, Jun 9, 2018 at 10:03 AM, Massimo Manghi <massimo.man...@alice.it>
>> wrote:
>>
>>> This looks loke the old problem with the event notifier that for some
>>> versions of Tcl survive in the child process after a fork. I thought 8.6.1
>>> was one of the working versions but actually that's a border version for
>>> having this bug fixed. Since 5 years have passed I don't remember every
>>> detail, but my memory was that this requirement was correct. Anyway can you
>>> check if moving to a more recent version of Tcl changes the situation?
>>>
>>>  -- Massimo
>>>
>>> On 06/08/2018 08:24 PM, Brice Hamon wrote:
>>>
>>>> Hi guys,
>>>>
>>>> I was doing so testing with Rivet 3.0.1.
>>>>
>>>> I installed it on an opensuse 43.1 release
>>>> 4.1.38-50-default #1 SMP PREEMPT Sun Feb 19 14:35:48 UTC 2017 (6b4d8cb)
>>>> x86_64 x86_64 x86_64 GNU/Linux
>>>>
>>>> with no option when compiling rivet.
>>>>
>>>> I am using Apache2 Server version: Apache/2.4.16 (Linux/SUSE)
>>>>
>>>> Tcl 8.6.1
>>>>
>>>> All went well and I got tivet up and running.
>>>>
>>>> Now I have a question:
>>>>
>>>> Why in the RivetChildInit script each instances of apache starts, the
>>>> command after or vwait forever do not work ?
>>>>
>>>> The command after hungs, and vwait forever is not understood.
>>>>
>>>> Am I missing something?
>>>>
>>>> Thank you.
>>>> Brice.
>>>>
>>>>
>>>
>>
>

Reply via email to