Re: Of hanging menuconfig [cause found]

Russell King (rmk@arm.linux.org.uk)
Sun, 25 Aug 2002 10:11:11 +0100


On Sat, Aug 24, 2002 at 09:21:44PM +0200, Richard Zidlicky wrote:
> look at dmesg and add an
> alias binfmt-xxxx off
> to /etc/modules.conf so similar problems get caught properly - unless
> you want to actually use an emulator for this architecture of course :)

I believe Dave was saying that the scripts try to run lxdialog, which
returns with an error code (to the program that called it.) This error
code is not checked by the caller, who just tries again. So the execve()
system call is already correctly failing.

The problem lies in activate_menu in scripts/Menuconfig; it contains a
loop that calls a small script which then calls lxdialog. It only tests
for a limited range of return codes:

0 1 2 3 4 5 6 139 255

The important thing here is the missing two codes (from bash's man page):

If a command is not found, the child process created to
execute it returns a status of 127. If a command is found
but is not executable, the return status is 126.

We currently handle neither; we just loop and try again.

> Looking at exec.c, why isn't the result of request_module() tested?

That doesn't really tell you anything; that tells you something successful
happened. It doesn't tell you that you now have (say) the a.out binary
format loaded; that's why we rescan the formats list afterwards.

Anyway, here's a patch that should solve the problem. Dave - thanks for
finding this odd behaviour.

--- orig/scripts/Menuconfig Tue Mar 5 19:56:45 2002
+++ linux/scripts/Menuconfig Sun Aug 25 10:08:44 2002
@@ -905,6 +905,26 @@
cleanup
exit 139
;;
+ 126|127)
+ stty sane
+ clear
+ cat << EOM
+
+There seems to be a problem with the lxdialog companion utility which is
+built prior to running Menuconfig. lxdialog could not be found, or could
+not be executed. This can be caused when lxdialog has been built for a
+different architecture.
+
+You should rebuild lxdialog. This can be done by moving to the
+/usr/src/linux/scripts/lxdialog directory and issuing the "make clean all"
+command.
+
+If the problem persists, you may email the maintainer <mec@shout.net> or
+post a message to <linux-kernel@vger.kernel.org> for additional assistance.
+
+EOM
+ cleanup
+ exit 1
esac
done
}

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/