View previous topic :: View next topic |
Author |
Message |
alex.blackbit Advocate
Joined: 26 Jul 2005 Posts: 2397
|
Posted: Tue Oct 13, 2009 8:58 am Post subject: how to identify a segfault in a long emerge ? |
|
|
during emerging of sys-devel/gcc-4.3.4 a segfault happens, every time. Code: | [157216.113030] conftest[7112]: segfault at 7fff1d667ff8 ip 00007f9de01be1dc sp 00007fff1d668000 error 6 in ld-2.10.1.so[7f9de01bd000+1d000]
|
i only see that this happened. how can i find out what exactly happened then ?
i.e. what configure test was executed then ?
i.e. which configure file, while line... |
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8708 Location: ~Brussels - Belgique
|
Posted: Tue Oct 13, 2009 9:02 am Post subject: |
|
|
Hello,
Take a look at the build logs in /var/tmp/portage/CATEGORY/PACKAGE/tmp/
What is your CFLAG ?
Is your memory OK ? _________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
alex.blackbit Advocate
Joined: 26 Jul 2005 Posts: 2397
|
Posted: Tue Oct 13, 2009 9:18 am Post subject: |
|
|
ok, i'll recompile it with FEATURES="keeptemp keepwork".
maybe i should have expressed before that emerge finishes successfully. no abort.
my memory is definitely okay. i emerge a lot of stuff every day, no problems.
CFLAGS="-O2 -pipe -march=nocona" |
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8708 Location: ~Brussels - Belgique
|
Posted: Tue Oct 13, 2009 9:22 am Post subject: |
|
|
Normally, you don't need those features.
If there were segfaults, the emerge would stop and keep all temporary files in /var/tmp/portage _________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
alex.blackbit Advocate
Joined: 26 Jul 2005 Posts: 2397
|
Posted: Tue Oct 13, 2009 4:53 pm Post subject: |
|
|
again, emerge does _not_ stop when this segfault happens.
i just found out that the error does _not_ happen every time. i had emerge runs without the segfault.
this time i found in the emerge output: Code: | /var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/libjava/configure.host: line 200: 14417 Segmentation fault ./conftest ./conftest |
the relevant code snippet is: Code: | # This case statement supports generic port properties and may refine
# the above per-CPU defaults. Note: If your OS implements
# MD_FALLBACK_FRAME_STATE_FOR, then you want to set can_unwind_signal
# here.
case "${host}" in
i[34567]86*-linux* | \
powerpc*-linux* | \
alpha*-linux* | \
s390*-linux* | \
sparc*-linux* | \
ia64-* | \
x86_64*-linux* | \
hppa*-linux* | \
m68k*-linux* | \
sh-linux* | sh[34]*-linux*)
can_unwind_signal=yes
libgcj_ld_symbolic='-Wl,-Bsymbolic'
if test x$slow_pthread_self = xyes \
&& test x$cross_compiling != xyes; then
cat > conftest.c <<EOF
#define _GNU_SOURCE 1
#include <pthread.h>
#include <stdlib.h>
#include <sys/resource.h>
#include <limits.h>
void *
tf (void *arg __attribute__ ((unused)))
{
pthread_attr_t a;
size_t s;
if (pthread_getattr_np (pthread_self (), &a)
|| pthread_attr_getstacksize (&a, &s)
|| s > 2 * PTHREAD_STACK_MIN)
exit (1);
exit (0);
}
int
main (int argc, char **argv)
{
pthread_t p;
void *ret;
struct rlimit r;
if (argc == 2)
{
r.rlim_cur = 2 * PTHREAD_STACK_MIN;
r.rlim_max = 2 * PTHREAD_STACK_MIN;
if (setrlimit (RLIMIT_STACK, &r))
exit (1);
execl (argv[1], argv[0], NULL);
exit (1);
}
if (pthread_create (&p, NULL, tf, NULL)
|| pthread_join (p, &ret))
exit (1);
exit (1);
}
EOF
$CC -o conftest conftest.c -lpthread > /dev/null 2>&1 && \
./conftest ./conftest && slow_pthread_self=
rm -f conftest conftest.c
fi
;; |
i compiled that by hand and got Code: | conftest.c: In function 'main':
conftest.c:31: warning: incompatible implicit declaration of built-in function 'execl' |
but no segfault. neither on execution.
i try to reproduce the segfault. |
|
Back to top |
|
|
alex.blackbit Advocate
Joined: 26 Jul 2005 Posts: 2397
|
Posted: Tue Oct 13, 2009 5:56 pm Post subject: |
|
|
the point is that those segfaults do not appear in the PORT_LOGDIR.
maybe there only stdout is logged and the message was sent to stderr or something. |
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8708 Location: ~Brussels - Belgique
|
Posted: Tue Oct 13, 2009 7:36 pm Post subject: |
|
|
Hello,
Please check if you have enough free space on /var/tmp (df -ah /var/tmp) _________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
alex.blackbit Advocate
Joined: 26 Jul 2005 Posts: 2397
|
Posted: Wed Oct 14, 2009 12:12 pm Post subject: |
|
|
yes, i have enough free space on /var/tmp. |
|
Back to top |
|
|
|