Tommi,

If you consider the problem carefully you will find that namespaces do 
not resolve this serious issue. It can at best only reduce the 
probability of the problem appearing but will not eliminate them, since 
you cannot expect to everyone to always use different namespaces in 
their libs that are NORMALLY kept local to the shared lib.

And then there's the other serious problem we've had with the threading 
  (namespaces will definitely not solve that one no matter how carefully 
the namespace is chosen). We've had serious problems writing to files 
from threads with RTLD_GLOBAL set. With RTLD_LOCAL it works perfectly.

Of course the true problem is with the fact RTLD_GLOBAL allows a very 
dangerous programming environment to exist. I'm not certain if this is a 
problem with C++ or the ELF system however either way you should switch 
to RTLD_LOCAL or at the very least make it a default config setting. 
Many people experiencing the unwanted shared routines will crash in very 
ugly and unpredictable ways and they may blame tntnet without 
understanding the root cause. Also, discovering the problem will likely 
only happen after a tntnet application becomes relatively advanced which 
is often a difficult time to debug a memory related problem such as 
this. We had to created simplified test applications to route out the 
problem, I don't know if others will have the same patience.

Again, tntnet is very stable with RTLD_GLOBAL having been replaced with 
RTLD_LOCAL. Without it, we could not use tntnet in multiple application 
scenarios which would be unfortunate because tntnet is a wonderful model 
and deserves wide spread usage.

Paul

On 01/09/08 12:01 PM, [EMAIL PROTECTED] wrote:
> Send Tntnet-general mailing list submissions to
>       [email protected]
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>       https://lists.sourceforge.net/lists/listinfo/tntnet-general
> or, via email, send a message with subject or body 'help' to
>       [EMAIL PROTECTED]
> 
> You can reach the person managing the list at
>       [EMAIL PROTECTED]
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Tntnet-general digest..."
> 
> 
> Today's Topics:
> 
>    1. Re: RTLD_GLOBAL issues (Tommi M?kitalo)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Sun, 31 Aug 2008 21:36:31 +0200
> From: Tommi M?kitalo <[EMAIL PROTECTED]>
> Subject: Re: [Tntnet-general] RTLD_GLOBAL issues
> To: [email protected]
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain;  charset="iso-8859-1"
> 
> Hi Paul,
> 
> thank you for your analysis. I see the problem. Usually I put my code into 
> namespaces to prevent these problems but I should not expect the users of 
> tntnet to do so.
> 
> The main reason, why I once changed thie RTLD-flag is, that I had problems 
> catching exceptions. But there might be already a solution for this.
> 
> If exception classes are all inline (header only), each link unit 
> instantiates 
> its own type and one link unit do not recognize the exception of another link 
> unit. The solution is not to inline all of the exception class.
> 
> I'm not sure, if there are other problems. I need to do some testing with 
> RTLD_LOCAL. But I prefer not to create a configuration option. Maybe there 
> are indeed better solutions for the problems I had with RTLD_LOCAL.
> 
> Tommi
> 
> 
> 
> ------------------------------
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> 
> ------------------------------
> 
> _______________________________________________
> Tntnet-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/tntnet-general
> 
> 
> End of Tntnet-general Digest, Vol 27, Issue 1
> *********************************************
> 

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to