# Portmaster stalls updates or certain ports (mc, webmin)?



## ShelLuser (May 22, 2013)

Hi gang,

I'm trying to get my fingers behind a specific weird issue before I write up an official bug or problem report, so I hope that some of you could verify and confirm my findings and conclusions so far.

I'm a fan of ports-mgmt/portmaster and use this to make sure that the ports I upgrade are kept in check (the beauty of this script is that it will also check for port dependencies and tries to change or recreate them if needed). The upgrading of the ports collection itself is done using portsnap (`# portsnap fetch update`). 

However, yesterday I noticed that during the upgrade of Midnight Commander (mc-4.8.1.7 being upgraded to mc-4.8.8) the process stalls, after almost 12 hours this is what I get to see:


```
CC     subshell.lo
  CC     background.lo
  CCLD   libinternal.la
copying selected object files to avoid basename conflicts...
  CC     main.o
  CCLD   mc
Making all in doc
Making all in hints
Making all in l10n
Making all in man
Making all in es
MAN_FILE=; MAN_DATE=$(LC_ALL=es_ES.UTF-8 /usr/bin/perl -MPOSIX -e ' @fi=lstat("'${MAN_FILE}'");  print POSIX::strftime("%B de %Y", localtime($fi[9]));' 2>/dev/null);  sed -e "s/%DATE_OF_MAN_PAGE%/${MAN_DATE}/g"  -e "s/%DISTR_VERSION%/4.8.8/g"  -e "s{%prefix%{/usr/local{g"  -e "s{%sysconfdir%{/usr/local/etc{g"  -e "s{%libexecdir%{/usr/local/libexec{g"  > mc.1
```

When I check using top or ps to learn what is going on I notice that the process appears to be stuck in a Make loop:


```
$ ps ax | grep mc
 2591  1  I+       0:40.24 mc
36218  2  I+       0:00.06 /bin/sh /usr/local/sbin/portmaster misc/mc
37401  2  IN+      0:00.16 /usr/bin/make CONFIG_DONE_MC=1 /usr/ports/misc/mc/wo
48083  2  IN+      0:00.00 /bin/sh -ec (cd /usr/ports/misc/mc/work/mc-4.8.8; if
20413  3  S+       0:09.27 mc
74361  3  S+       0:00.01 /usr/local/bin/ksh -c ps ax | grep mc
74364  3  S+       0:00.00 grep mc
```
(full output, including irrelevant parts).

My assumption is that process 37401 started process 48083 which is currently stalling. When I kill the last process ID the build for mc-4.8.8 will fail and portmaster moves on.

So far, so good.

But here is where it starts to become strange for me: when I manually access misc/mc and then issue a `# make build` command the whole thing cleanly compiles, doesn't stall, and within no more than a minute I'm back on the console. I've had the same thing happening (a stall during the build process) when I was trying to upgrade sysutils/webmin.

I've checked the most obvious sources for possible problems, namely UPDATING and /etc/make.conf but both don't contain anything odd:


```
# added by use.perl 2013-04-18 13:38:56
PERL_VERSION=5.14.2
# Pre-define Apache's suexec root directory
SUEXEC_DOCROOT=/home
```
The first line was added automatically, the second line was added by me to make sure I never forget to override this option when compiling Apache.

Now, I know that portmaster does more than merely compile a single port. However, it sure appears as if the stall occurs while building Midnight Commander itself. What I fail to understand is that this doesn't happen when I use `# make build` manually.

Is my assumption right that if `# make build` runs cleanly then the upgrade should also be able to run clean?


----------



## ShelLuser (May 22, 2013)

*Quick update*

I figured I'd better write a new message than edit the original.

I overlooked a major aspect: when I used the previously mentioned `# make build` I did so _after_ portmaster had already run (and was interrupted).

So now I specifically issued a `# make clean` before the `# make build` and what do you know; the same stall occurs.

As such this is definitely a problem with the misc/mc build process (or my own inexperience) and has nothing to do with portmaster itself.


----------



## jozze (May 24, 2013)

Maybe you once upgraded a port, which required that you build some ports that require it. Also you said you interrupted portmaster before, so maybe it's good to get your package database in order first with `# pkgdb -fu` and then reinstall the port with all dependencies, `# portmaster -R misc/mc`. Still, it might not work, but it's worth giving it a try.


----------



## wblock@ (May 24, 2013)

pkgdb is actually a ports-mgmt/portupgrade utility.  It does not change the system package database, just the copy that portupgrade uses.

If you're just rebuilding a single port that nothing else depends on, using the make(1) commands directly instead of one of the port upgrade utilities can make it easier to see what is going on:

```
# cd /usr/ports/sysutils/mc
# make clean
# make install
```


----------



## jozze (May 25, 2013)

Aha, ok. I thought pkgdb was a more general utility.


----------

