cvs commit: hints errors.txt
tushar at linuxfromscratch.org
tushar at linuxfromscratch.org
Tue Oct 28 21:57:16 PST 2003
tushar 03/10/28 22:57:16
Modified: . errors.txt
Updated Hint: errors
Revision Changes Path
1.5 +62 -13 hints/errors.txt
RCS file: /home/cvsroot/hints/errors.txt,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -u -r1.4 -r1.5
--- errors.txt 9 Oct 2003 01:16:08 -0000 1.4
+++ errors.txt 29 Oct 2003 05:57:16 -0000 1.5
@@ -1,6 +1,6 @@
AUTHOR: Alex Kloss <alex at 22-music.com>
LICENSE: GNU Free Documentation License Version 1.2
@@ -12,7 +12,7 @@
list), and possibly get around it is the goal of this hint.
-Common sense, LFS, patience.
+Common sense, LFS, patience. Programming skills (optional).
Almost every LFS adept has seen lines like:
@@ -33,7 +33,7 @@
something that stops you from compiling the package you are about to build.
To disable distracting warning messages, use "export CFLAGS="-w".
-Mostly, further informations about the errors are missing, which is a nuisance
+Mostly, further information about the errors are missing, which is a nuisance
for both the one who asks and the one who tries to answer, because of the
annoying dialogue that is often following. I have to admid that the LFS mailing
list and IRC never failed to solve my problems (and that in a rather cheerful
@@ -50,7 +50,7 @@
Question: When did it happen? What happened? Where did it happen?
, Compiling (gcc) ...
- , ... not found ---<
+ , ... not found ---<- Dependencies (depmod)
Compile-time Error < ` Linking (ld)
Error < Segfault
@@ -182,10 +182,23 @@
function that is missing is given; you can try to grep it in the library
+1.1.3 Module Dependency checking (depmod)
+Another error that only happens if the running kernel differs from the one the
+sources are compiled against (which could be the case when compiling in chrooted
+mode) is the "unresolved dependency in module"-error. To get around that bug,
+run depmod with the "-F /usr/src/linux/System.map"-option. And be sure that you
+are compiling the modules with the same compiler as you used when compiling the
1.2 Segmentation Fault
-This is most annoying. It means an application had an error that is so bad it
-rather dumps core and stop immediately.
+This is most annoying. It means an application tries to get something from a
+file/pipe/device/environment variable that is not set and has no fallback if
+there is nil but rather dumps core and stop immediately. If the following in-
+formation is not sufficing for you, you may want to have a look at the SIG11
+FAQ which can be found at http://www.bitwizard.nl/sig11 - but look at this
1.2.1 Segfault during compilation
@@ -201,14 +214,42 @@
will set up 128MB of swap space (or virtual memory). If it still fails,
-increase the amount of disk space used (count=256; count=512; count=XXX).
+increase the amount of disk space used (count=256; count=512; count=XXX). If
+you are done compiling or want to increase the size, remove the added swapspace
+losetup -d /dev/loop0
1.2.2 Segfault during execution
-If a program segfaults, there isn't much you can easily do to hunt the error
-down if you don't have some programming skills. Contact the developer and give
+If a program segfaults, there is not much you can easily do to hunt the error
+down unless you have some programming skills. Contact the developer and give
him a detailed view of your system; maybe in /var/log is something about the
+error? If you want to hunt the bug down yourself anyway, read the SIG11 FAQ and
+use strace which you will find at http://www.liacs.nl/~wichert/strace/ and is
+easily installed on the program; it may help you to find out what file/pipe/
+environment string/etc the program is expecting to be available. Then try to
+grep the sources of the program which is segfaulting after the file/pipe/etc
+which failed. Add a fallback routine. A nice example is the gsview-4.4-patch.
+gsview 4.4 tried to get the environment variable LANG, but had no fallback for
+the case it was not set. The malignant part of the source looked like:
+ strncpy(lang, getenv("LANG"), sizeof(lang)-1);
+Which would have copied a part of the LANG(uage) environment variable without
+the last character - if LANG was empty, it would have tried to copy -1 char-
+acters, which resulted in a segfault. The easy solution would have been to set
+LANG to something, but the better solution is to provide a fallback and change
+the code to:
+ strncpy(lang, (getenv("LANG") == 0) ? "C" : getenv("LANG"),sizeof(lang)-1);
+That is a bit obfuscated for the C-illiterate, but it means "if LANG is 0, then
+use 'C' instead of the LANG environment variable (which stands for standard),
+else use the LANG environment variable minus one char". Now it is your turn,
+if you still want to get that bug by yourself!
@@ -234,7 +275,9 @@
1.3.2 Program-only Hangup
If the program hangs up leaving the rest system intact, you can use the
-appropriate of the kill/killall/xkill command to get rid of it.
+appropriate of the kill/killall/xkill command to get rid of it. Program-only
+Hangups occurs on infinite loops, e.g. trying to read from a blocked pipe, in
+most cases the load will go up visibly.
1.4 Other errors
@@ -243,7 +286,8 @@
newer version or 2. if a cvs version, if available, has the same error. If
nothing else helps, ask in IRC or mail to the developers mailinglist or submit
a bug report. Remember to describe the error precisely and give enough
-information about the system you are trying to build the package on.
+information about the system you are trying to build the package on (logs,
+versions, strace output, dmesg output, debug messages and so on).
May the source be with you!
@@ -258,7 +302,12 @@
* Almost forgot to give Tushar some credits, little changes and additions.
* Small changes and corrections suggested by Bill Maltby
+ * Adding a link to the SIG11 FAQ, some more stuff about segfaults and have
+ a few words about the depmod problem with different kernels.
Thanks to teemu for reminding me on "-I" and "-l" as much as Tushar for the
warning about warnings and ringing the bell of the "-w" option, not to
-forget Bill for his corrections. :-)
+forget Bill for his corrections. Thanks to Gerard for inspiring me with his
+LFS section about errors! :-)
More information about the hints