From: John Stone (johns_at_ks.uiuc.edu)
Date: Tue Jan 11 2005 - 11:09:17 CST

Hey,

On Tue, Jan 11, 2005 at 05:42:25PM +0100, Bogdan Costescu wrote:
> On Mon, 10 Jan 2005, John Stone wrote:
[....]
> has to be present before accessing the errno variable. I think that
> this is actually part of some official standard (POSIX ?) and the
> older code could have been considered "buggy".
[... errno stuff...]

VMD is safe from the type of errno stuff you mention because errno has
been a macro on most other systems for years, and all of our code that
uses errno correctly includes errno.h, so we ought to be in good shape there.
I think I fixed this a number of years back because errno has been implemented
as a macro on several other systems for some time already.

> Other changes that cought my eye are related to how exceptions are
> caught and where signals are delivered, but I don't do much
> development with threads so I just registered them without paying too
> much attention.

Yeah, signal handling with threads is a nightmare for portable applications.
My solution thus far has been to avoid using signals for anything within
multithreaded code :-)

> > I suppose that one potential cause for problems would be if they
> > implemented some of the old pthreads stuff with macros in header
> > files rather than using real entrypoints, that'd certainly break
> > things when changing to a new implementation.
>
> I think that this was indeed the case with errno.

Yeah, that's the sort of thing that I'd been thinking of.
If the old pthreads library just referenced the global errno
rather than creating the thread-specific errno macro, that by itself
is bad enough to require an app to be recompiled, even if the app was
correctly written and had included errno.h like a good citizen.

> > In any case, I don't have the means nor the time to test against
> > more than one or two linux distributions locally, so I'll have to
> > rely on feedback from others in going any further with this proposed
> > change.
>
> Given that this is mentioned for the first time for VMD, I suggest
> leaving things as they are (= not adding LD_ASSUME_KERNEL to the
> startup script) and maybe putting a notice about it somewhere. Only
> if the problem becomes more widely seen modify the script.

Yeah, if the problem starts cropping up a lot I'll probably just have
a modified startup script to email to affected people, or post in an
FAQ or something.

Thanks for the additional info, now I see what's going on with their
implementation.

  John

>
> --
> Bogdan Costescu
>
> IWR - Interdisziplinaeres Zentrum fuer Wissenschaftliches Rechnen
> Universitaet Heidelberg, INF 368, D-69120 Heidelberg, GERMANY
> Telephone: +49 6221 54 8869, Telefax: +49 6221 54 8868
> E-mail: Bogdan.Costescu_at_IWR.Uni-Heidelberg.De

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349              
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078