From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Cyprien Nicolas Newsgroups: gmane.lisp.guile.bugs Subject: bug#11845: guile-1.8.8 segfaults at build-time with gcc-4.6.3 and -O3 Date: Mon, 02 Jul 2012 20:36:39 +0200 Message-ID: <4FF1EA37.8080909@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1341254256 31755 80.91.229.3 (2 Jul 2012 18:37:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 2 Jul 2012 18:37:36 +0000 (UTC) To: 11845@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon Jul 02 20:37:34 2012 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SllV7-0001k7-NB for guile-bugs@m.gmane.org; Mon, 02 Jul 2012 20:37:33 +0200 Original-Received: from localhost ([::1]:55126 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SllV6-00088c-Nd for guile-bugs@m.gmane.org; Mon, 02 Jul 2012 14:37:32 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SllV2-000885-Vj for bug-guile@gnu.org; Mon, 02 Jul 2012 14:37:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SllV0-00044M-F7 for bug-guile@gnu.org; Mon, 02 Jul 2012 14:37:28 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33609) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SllV0-00044H-8q for bug-guile@gnu.org; Mon, 02 Jul 2012 14:37:26 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SllZS-0004tc-Cc for bug-guile@gnu.org; Mon, 02 Jul 2012 14:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Cyprien Nicolas Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 02 Jul 2012 18:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11845 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.134125449618691 (code B ref -1); Mon, 02 Jul 2012 18:42:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Jul 2012 18:41:36 +0000 Original-Received: from localhost ([127.0.0.1]:43154 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SllZ1-0004rP-Fi for submit@debbugs.gnu.org; Mon, 02 Jul 2012 14:41:36 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54481) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SllYx-0004rH-Dv for submit@debbugs.gnu.org; Mon, 02 Jul 2012 14:41:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SllUS-0003pu-2D for submit@debbugs.gnu.org; Mon, 02 Jul 2012 14:36:54 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:36364) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SllUR-0003po-Sd for submit@debbugs.gnu.org; Mon, 02 Jul 2012 14:36:51 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SllUP-00082S-8i for bug-guile@gnu.org; Mon, 02 Jul 2012 14:36:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SllUL-0003nH-NS for bug-guile@gnu.org; Mon, 02 Jul 2012 14:36:48 -0400 Original-Received: from mail-bk0-f41.google.com ([209.85.214.41]:61542) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SllUL-0003mb-9e for bug-guile@gnu.org; Mon, 02 Jul 2012 14:36:45 -0400 Original-Received: by bkcjc3 with SMTP id jc3so2837139bkc.0 for ; Mon, 02 Jul 2012 11:36:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :x-enigmail-version:content-type:content-transfer-encoding; bh=BCFnnSD0eWvTSdeE3syfgvqIyt1koVS2x+iT3OfGHGg=; b=Q1gLqYM5jiAFmQGseBP6kG72tiiJLMRwRKQlkb/gGq5BJZQRD/9ZNojJZ5/KR0pIDA 7cNbM4PyWNSGQYPkJ8/oQg3L68WpcLw18DgoXkC9pkGb/DyMlwxyfWll9miP2tdEcZDM ot2PdU1KVDAHYzs1FsNw2wS+P9HRqcFQ2oymsy7lH+R7apRAl/NohxzqmHrJs4Hs4L5g 06Q/MVNSGubiEWhlBLeZqOT/zEHP6G980xpbNto6dfpFLTBI46qa0zOa9zMCRaly6XAb HdhBkhXXnkgWLvRMBDRLk8Nweky5rwdXM4WiCDQ3IJfBwHtN+cNiDLYtxPVu5QIIC6zI s4vA== Original-Received: by 10.204.129.89 with SMTP id n25mr8325517bks.83.1341254202821; Mon, 02 Jul 2012 11:36:42 -0700 (PDT) Original-Received: from [192.168.1.5] (reverse-241.fdn.fr. [80.67.176.241]) by mx.google.com with ESMTPS id o4sm14563543bkv.15.2012.07.02.11.36.41 (version=SSLv3 cipher=OTHER); Mon, 02 Jul 2012 11:36:42 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120622 Firefox/13.0.1 SeaMonkey/2.10.1 X-Enigmail-Version: 1.4.2 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:6373 Archived-At: Hello guilers, Origin: https://bugs.gentoo.org/show_bug.cgi?id=424475 - CONFIGURATION - ----------------- # emerge --info --ignore-default-opts Portage 2.2.0_alpha113 (default/linux/x86/10.0/desktop, gcc-4.6.3, glibc-2.15-r2, 3.2.1-gentoo-r2 x86_64) ================================================================= System uname: Linux-3.2.1-gentoo-r2-x86_64-Intel-R-_Xeon-R-_CPU_5120_@_1.86GHz-with-gentoo-2.1 app-shells/bash: 4.2_p29 dev-util/pkgconfig: 0.26 sys-apps/baselayout: 2.1-r1 sys-apps/openrc: 0.10.3 sys-apps/sandbox: 2.5 sys-devel/autoconf: 2.13, 2.69 sys-devel/automake: 1.11.5, 1.12.1 sys-devel/binutils: 2.22-r1 sys-devel/gcc: 4.5.3-r2, 4.6.3, 4.7.1 sys-devel/gcc-config: 1.7.3 sys-devel/libtool: 2.4.2 sys-devel/make: 3.82-r3 sys-kernel/linux-headers: 3.4 (virtual/os-headers) sys-libs/glibc: 2.15-r2 CFLAGS="-O2 -march=i686 -pipe -finline-functions -ggdb" - BUILD FAILURE - ----------------- (...) cat alist.doc arbiters.doc async.doc backtrace.doc boolean.doc chars.doc continuations.doc debug.doc deprecation.doc deprecated.doc discouraged.doc dynl.doc dynwind.doc environments.doc eq.doc error.doc eval.doc evalext.doc extensions.doc feature.doc fluids.doc fports.doc futures.doc gc.doc goops.doc gsubr.doc gc-mark.doc gc-segment.doc gc-malloc.doc gc-card.doc guardians.doc hash.doc hashtab.doc hooks.doc i18n.doc init.doc ioext.doc keywords.doc lang.doc list.doc load.doc macros.doc mallocs.doc modules.doc numbers.doc objects.doc objprop.doc options.doc pairs.doc ports.doc print.doc procprop.doc procs.doc properties.doc random.doc rdelim.doc read.doc root.doc rw.doc scmsigs.doc script.doc simpos.doc smob.doc sort.doc srcprop.doc stackchk.doc stacks.doc stime.doc strings.doc srfi-4.doc srfi-13.doc srfi-14.doc strorder.doc strports.doc struct.doc symbols.doc threads.doc throw.doc values.doc variable.doc vectors.doc version.doc vports.doc weaks.doc ramap.doc unif.doc dynl.doc filesys.doc posix.doc regex-posix.doc | GUILE="/var/tmp/portage/dev-scheme/guile-1.8.8-r1/work/guile-1.8.8/pre-inst-guile" ../scripts/snarf-check-and-output-texi > guile-procedures.texi || { rm guile-procedures.texi; false; } /bin/sh: line 1: 8755 Broken pipe cat alist.doc arbiters.doc async.doc backtrace.doc boolean.doc chars.doc continuations.doc debug.doc deprecation.doc deprecated.doc discouraged.doc dynl.doc dynwind.doc environments.doc eq.doc error.doc eval.doc evalext.doc extensions.doc feature.doc fluids.doc fports.doc futures.doc gc.doc goops.doc gsubr.doc gc-mark.doc gc-segment.doc gc-malloc.doc gc-card.doc guardians.doc hash.doc hashtab.doc hooks.doc i18n.doc init.doc ioext.doc keywords.doc lang.doc list.doc load.doc macros.doc mallocs.doc modules.doc numbers.doc objects.doc objprop.doc options.doc pairs.doc ports.doc print.doc procprop.doc procs.doc properties.doc random.doc rdelim.doc read.doc root.doc rw.doc scmsigs.doc script.doc simpos.doc smob.doc sort.doc srcprop.doc stackchk.doc stacks.doc stime.doc strings.doc srfi-4.doc srfi-13.doc srfi-14.doc strorder.doc strports.doc struct.doc symbols.doc threads.doc throw.doc values.doc variable.doc vectors.doc version.doc vports.doc weaks.doc ramap.doc unif.doc dynl.doc filesys.doc posix.doc regex-posix.doc 8756 Segmentation fault (core dumped) | GUILE="/var/tmp/portage/dev-scheme/guile-1.8.8-r1/work/guile-1.8.8/pre-inst-guile" ../scripts/snarf-check-and-output-texi > guile-procedures.texi make[3]: *** [guile-procedures.texi] Error 1 make[3]: Leaving directory `/var/tmp/portage/dev-scheme/guile-1.8.8-r1/work/guile-1.8.8/libguile' make[2]: *** [all] Error 2 make[2]: Leaving directory `/var/tmp/portage/dev-scheme/guile-1.8.8-r1/work/guile-1.8.8/libguile' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/dev-scheme/guile-1.8.8-r1/work/guile-1.8.8' make: *** [all] Error 2 - PATHS - --------- # pwd /var/tmp/portage/dev-scheme/guile-1.8.8-r2/work/guile-1.8.8/libguile # ldd .libs/guile linux-gate.so.1 (0xffffe000) libguile.so.17 => /var/tmp/portage/dev-scheme/guile-1.8.8-r2/work/guile-1.8.8/libguile/.libs/libguile.so.17 (0xf76c9000) libpthread.so.0 => /lib/libpthread.so.0 (0xf7696000) libc.so.6 => /lib/libc.so.6 (0xf7511000) libgmp.so.10 => /usr/lib/libgmp.so.10 (0xf74b2000) libcrypt.so.1 => /lib/libcrypt.so.1 (0xf7480000) libm.so.6 => /lib/libm.so.6 (0xf745a000) libltdl.so.7 => /usr/lib/libltdl.so.7 (0xf7451000) libdl.so.2 => /lib/libdl.so.2 (0xf744d000) /lib/ld-linux.so.2 (0xf77c4000) - GDB SESSION - --------------- # gdb .libs/guile core GNU gdb (Gentoo 7.4.1 p1) 7.4.1 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu". For bug reporting instructions, please see: ... Reading symbols from /var/tmp/portage/dev-scheme/guile-1.8.8-r2/work/guile-1.8.8/libguile/.libs/guile...done. [New LWP 14880] warning: Could not load shared library symbols for linux-gate.so.1. Do you need "set solib-search-path" or "set sysroot"? [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/libthread_db.so.1". Core was generated by `/var/tmp/portage/dev-scheme/guile-1.8.8-r2/work/guile-1.8.8/libguile/.libs/guil'. Program terminated with signal 11, Segmentation fault. #0 0xf76b4154 in scm_mark_locations (x=0xff908cac, n=4294967132) at gc-mark.c:435 435 SCM obj = * (SCM *) &x[m]; (gdb) bt #0 0xf76b4154 in scm_mark_locations (x=0xff908cac, n=4294967132) at gc-mark.c:435 #1 0xf770eb22 in scm_threads_mark_stacks () at threads.c:1408 #2 0xf76b4076 in scm_mark_all () at gc-mark.c:82 #3 0xf76b38de in scm_i_gc (what=0xf772ae69 "cells") at gc.c:596 #4 0xf76b3a78 in scm_gc_for_newcell (freelist=0xf7760720, free_cells=0x952e080) at gc.c:507 #5 0xf76efb32 in scm_double_cell (cdr=0, ccr=0, cbr=0, car=) at ../libguile/inline.h:201 #6 make_stringbuf (len=10) at strings.c:116 #7 scm_i_c_make_symbol (name=0xf773276a "string-pad", len=10, flags=0, hash=1161852829, props=0xf73b85e8) at strings.c:433 #8 0xf770d362 in scm_i_c_mem2symbol (len=, name=0xf773276a "string-pad") at symbols.c:150 #9 scm_from_locale_symbol (sym=0xf773276a "string-pad") at symbols.c:388 #10 0xf76df3fa in scm_c_make_subr (name=0xf773276a "string-pad", type=85, fcn=0xf7702740 ) at procs.c:69 #11 0xf76c08f2 in create_gsubr (define=1, name=, req=2, opt=3, rst=0, fcn=0xf7702740 ) at gsubr.c:81 #12 0xf7703f5f in scm_init_srfi_13 () at ../libguile/srfi-13.x:20 #13 0xf76c509a in scm_i_init_guile (base=0xff908cac) at init.c:514 #14 0xf770e7fe in scm_i_init_thread_for_guile (parent=0x0, base=0xff908cac) at threads.c:590 #15 scm_i_with_guile_and_parent (func=0xf76c4d60 , data=0xff908d00, parent=0x0) at threads.c:732 #16 0xf770e8fd in scm_with_guile (func=0xf76c4d60 , data=0xff908d00) at threads.c:721 #17 0xf76c4ea5 in scm_boot_guile (argc=5, argv=0xff908de4, main_func=0x8048550 , closure=0x0) at init.c:350 #18 0x0804846b in main (argc=5, argv=0xff908de4) at guile.c:63 (gdb) up #1 0xf770eb22 in scm_threads_mark_stacks () at threads.c:1408 1408 scm_mark_locations (t->base, t->top - t->base); (gdb) print (t->top - t->base) $1 = -164 (gdb) l 1403 assert (t->top); 1404 1405 scm_gc_mark (t->handle); 1406 1407 #if SCM_STACK_GROWS_UP 1408 scm_mark_locations (t->base, t->top - t->base); 1409 #else 1410 scm_mark_locations (t->top, t->base - t->top); 1411 #endif 1412 scm_mark_locations ((void *) &t->regs, - COMMENTS - ------------ The GDB session show clearly that something is going wrong when scm_mark_locations is called. Passing a negative value (interpreted as an unsigned int) makes scm_mark_locations scanning almost the whole memory, thus resulting in a segmentation fault. The upper frame shows that the #if choice was wrong, leaving the possibility of the SCM_STACK_GROWS_UP define to be wrong, here 1 instead of 0 on standard x86 boxes. That define value is computed using the find_stack_direction function defined in configure.in: int find_stack_direction () { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction (); } else return (&dummy > addr) ? 1 : -1; } int main () { return find_stack_direction () < 0; } This small program gives different results on the same machine with different gcc versions and CFLAGS combinations: # gcc-4.5.3 find_stack_direction.c && ./a.out ; echo $? 1 # gcc-4.5.3 -O3 find_stack_direction.c && ./a.out ; echo $? 1 # gcc-4.6.3 find_stack_direction.c && ./a.out ; echo $? 1 # gcc-4.6.3 -O3 find_stack_direction.c && ./a.out ; echo $? 0 # gcc-4.7.1 find_stack_direction.c && ./a.out ; echo $? 1 # gcc-4.7.1 -O3 find_stack_direction.c && ./a.out ; echo $? 1 So we can find out the incriminating CFLAGS: # gcc-4.6.3 -O3 -fno-inline-functions find_stack_direction.c && ./a.out ; echo $? 1 I'm not a GCC expert, so I cannot go further. My C programming skills aren't enough to know if this procedure is correct or not :-) guile-2.0.5 use a different find_stack_direction() procedure, that gives the same result with gcc-4.6.3 with and without -O3: # gcc-4.6.3 find_stack_direction2.c && ./a.out ; echo $? 1 # gcc-4.6.3 -O3 find_stack_direction2.c && ./a.out ; echo $? 1 I'll test with a vanilla gcc-4.6.3 (i.e. not patched by Gentoo) and keep you informed if I cannot reproduce that issue with the vanilla. Regards -- ,Cyprien