Subject: [LON-CAPA-dev] Occasional strangeness

From: "Matthew Brian Hall" <[email-masked]>
Date: Fri, 4 Oct 2002 14:44:16 -0400 (EDT)

Hello all.

Both Jeremey & Alex have had trouble starting their http daemons over the last
few days.  I saw the error on Alex's system - something about binding a
semaphore or memory management issues.  At any rate, if anyone sees anything
like this again we should track it down.

Of course, the exact error message would be a starting point :)

Matthew

--
------------------------------------------------------------------
Matthew Hall           LON-CAPA developer         [email-masked]
123 North Kedzie Hall                    Michigan State University
------------------------------------------------------------------

---

From: Martin Siegert <[email-masked]>
Date: Fri, 4 Oct 2002 11:55:25 -0700

Hello,

this sounds like running out of shared memory segments and/or 
semaphores. If a program crashes, it leaves behind the shared
memory segments and semaphores that it used.
The following two scripts will get rid of them:

===<delete_semaphores.pl>=====================================================
#!/usr/bin/perl
#
# delete_semaphores.pl: delete leftover semaphores from crashed MPI programs
#
$IPCRM="/usr/bin/ipcrm";
$IPCS="/usr/bin/ipcs";
@SEMAPHORES=`$IPCS -s`;

for ($i = 3; $i < $#SEMAPHORES; $i++) {
  @line = split(' ',$SEMAPHORES[$i]);
  $semid = $line[1];
# print "$semid\n";
  system("$IPCRM sem $semid");
}
==============================================================================

===<delete_shmemsegs.pl>======================================================
#!/usr/bin/perl
#
# delete_shmemsegs.pl: delete leftover shared memory segments from crashed
# MPI programs
#
$IPCRM="/usr/bin/ipcrm";
$IPCS="/usr/bin/ipcs";
@SHMEMSEGS=`$IPCS -m`;

for ($i = 3; $i < $#SHMEMSEGS; $i++) {
  @line = split(' ',$SHMEMSEGS[$i]);
  $shmid = $line[1];
# print "$shmid\n";
  system("$IPCRM shm $shmid");
}
==============================================================================

I hope this helps.

Cheers,
Martin

========================================================================
Martin Siegert
Academic Computing Services                        phone: (604) 291-4691
Simon Fraser University                            fax:   (604) 291-4242
Burnaby, British Columbia                          email: [email-masked]
Canada  V5A 1S6
========================================================================

On Fri, Oct 04, 2002 at 02:44:16PM -0400, Matthew Brian Hall wrote:
> _______________________________________________
> LON-CAPA-dev mailing list
> [email-masked]
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-dev

---

From: Jeremy Bowers <[email-masked]>
Date: Fri, 04 Oct 2002 16:34:49 -0400

> The following two scripts will get rid of them:

Thanks! Just so I get the error message into a searchable form, let me 
enter this for posterity's sake:

Ouch! ap_mm_create(1048576, "/var/run/httpd.mm.6883") failed
Error: MM: mm:core: failed to acquire semaphore (No space left on 
device): OS: Invalid argument

It can be fixed with Martin's posted scripts. (Note I just squished them 
into one script.)

---

From: Martin Siegert <[email-masked]>
Date: Fri, 4 Oct 2002 13:46:10 -0700

What response do you get when you run "ipcs" as root?

Martin

---

From: Alex Sakharuk <[email-masked]>
Date: Fri, 04 Oct 2002 16:43:57 -0400

Sorry, but I rebooted mashine before received your message.

                                                                        Alex