JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for LCG-ROLLOUT Archives


LCG-ROLLOUT Archives

LCG-ROLLOUT Archives


LCG-ROLLOUT@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

LCG-ROLLOUT Home

LCG-ROLLOUT Home

LCG-ROLLOUT  April 2007

LCG-ROLLOUT April 2007

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: crashing network server -- SOLVED

From:

Ronald Starink <[log in to unmask]>

Reply-To:

LHC Computer Grid - Rollout <[log in to unmask]>

Date:

Thu, 26 Apr 2007 16:19:55 +0200

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (130 lines)

Maarten Litmaath wrote:
> Ronald Starink wrote:
> 
>> Program received signal SIGSEGV, Segmentation fault.
>> [Switching to Thread 48278448 (LWP 17004)]
>> 0x00e3cc85 in readdir64_r@@GLIBC_2.2 () from /lib/tls/libc.so.6
>> (gdb) where
>> #0  0x00e3cc85 in readdir64_r@@GLIBC_2.2 () from /lib/tls/libc.so.6
>> #1  0x00174dd8 in gridmapdir_newlease (
>>     encodedglobusidp=0xb74ec330
>> "%2fo%3ddutchgrid%2fo%3dusers%2fo%3dnikhef%2fcn%3dronald%20starink",
>>     usernameprefix=0xb74eccf0 "dteam") at gridmap.c:257
> 
> The strange thing is that gridmapdir_newlease() is called, which should
> only happen when there is no entry for the DN yet, whereas your gridmapdir
> already has one for you...  Investigating how this can happen....

Well, a simple misconfiguration can do a lot, particularly in
combination with (a) bug(s) in the VDT library and a bug in an init script.

-- Long description starts here --

1) The Configuration
We had 2 RBs using the same shared gridmapdir for over a year, without
problems. Last week, we installed a new RB, using that same gridmapdir,
and the problem started. On the newly installed RB, the uid and gid for
edguser turned out to differ from those on the old RBs.

The difference in the IDs is the result of switching configuration tools
(we now use Yaim, which does not have a well-defined ID for edguser).
Since the gridmapdir is only readable and writable for the owner and the
group (i.e. edguser), only the two old RBs or (XOR) the new RB could
access the gridmapdir.


2) The Bug in VDT
The VDT libraries contain a gridmap patch that performs opendir() and
readdir() on the gridmapdir. Unfortunately, the gridmap patch does not
use the result of opendir() and blindly performs readdir(), assuming the
open went fine. WRONG. Because of the two different gids for edguser,
one opendir() would fail for the old RBs or for the new RB, leading to a
segmentation violation in readdir() and crashing the networkserver.

So unlike earlier thoughts, the problem was not due to using a
non-reentrant variant of readdir(). That is another bug, though.


3) The Bug in the Init Script
On the RB, there is a cron job (/etc/cron.d/edg-wl-check-daemons) that
runs every 5 minutes to check that all the daemons are still running, using
	/etc/rc.d/init.d/edg-wl-* status
If a daemon is not running, it is restarted by the cron job.

The init script for the networkserver always performs a function
init_variables(), which also happens to set the properties of the
gridmapdir:
  chgrp ${EDG_WL_USER} ${GRIDMAPDIR}
  chmod g+w ${GRIDMAPDIR}

Why? Is there yet another process that touches the ownership of the
gridmapdir?? The gridmapdir should be set up just once, and not at every
invocation of an init script.



So, what happened was that every 5 minutes the cron job on the RBs
retrieved the status of the networkserver daemon, which triggers a
change of the gid of the gridmapdir. Depending on which RB the cron job
runs last, determines the gid of the gridmapdir for the next 5 minutes.
When a RB gets a new connection from a UI (job submission or output
sandbox retrieval), it reads the gridmapdir. That fails miserably when
that particular RB cannot read the gridmapdir and causes a segfault in
the networkserver.

Since the exact moment of executing the cron job is somewhat random,
each of the three RBs suffered from this problem.

I reproduced this with 2 other RBs in a test cluster, each with a
different gid for edguser, and both RBs sharing the same gridmapdir.
Even when no jobs were submitted to the RBs, the gid of the gridmapdir
changed every 5 minutes:

Thu Apr 26 13:14:12 CEST 2007
drwxrwx--x    2 root     edguser    139264 Apr 23 17:24
/share/gridmapdir_itb
[...]
Thu Apr 26 13:15:01 CEST 2007
drwxrwx--x    2 root     edguser    139264 Apr 23 17:24
/share/gridmapdir_itb
Thu Apr 26 13:15:02 CEST 2007
drwxrwx--x    2 root     995        139264 Apr 23 17:24
/share/gridmapdir_itb
Thu Apr 26 13:15:03 CEST 2007
drwxrwx--x    2 root     995        139264 Apr 23 17:24
/share/gridmapdir_itb
[...]
Thu Apr 26 13:20:01 CEST 2007
drwxrwx--x    2 root     995        139264 Apr 23 17:24
/share/gridmapdir_itb
Thu Apr 26 13:20:03 CEST 2007
drwxrwx--x    2 root     edguser    139264 Apr 23 17:24
/share/gridmapdir_itb
Thu Apr 26 13:20:04 CEST 2007
drwxrwx--x    2 root     edguser    139264 Apr 23 17:24
/share/gridmapdir_itb
[...]
Thu Apr 26 13:25:01 CEST 2007
drwxrwx--x    2 root     edguser    139264 Apr 23 17:24
/share/gridmapdir_itb
Thu Apr 26 13:25:02 CEST 2007
drwxrwx--x    2 root     995        139264 Apr 23 17:24
/share/gridmapdir_itb
Thu Apr 26 13:25:03 CEST 2007
drwxrwx--x    2 root     995        139264 Apr 23 17:24
/share/gridmapdir_itb


To conclude:
- Our problem disappeared after adjusting the uid and gid of edguser on
the new RB
- Maarten has submitted a bug on VDT and created a patch
- I'll submit a bug on the edg-wl-ns init script


Thanks to all who tried to help resolve this problem, in particular to
Maarten and Janjust.

Cheers,
Ronald

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

March 2020
February 2020
January 2020
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
March 2019
February 2019
January 2019
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
February 2018
January 2018
November 2017
October 2017
September 2017
July 2017
June 2017
May 2017
March 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
2006
2005
2004
2003


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager