GNU bug report logs - #26854
guile-2.2.2/libguile/.libs/guile crashes during build on PowerPC Macintoshes

Previous Next

Package: guile;

Reported by: Peter Dyballa <Peter_Dyballa <at> Freenet.DE>

Date: Tue, 9 May 2017 15:14:01 UTC

Severity: normal

To reply to this bug, email your comments to 26854 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#26854; Package guile. (Tue, 09 May 2017 15:14:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Peter Dyballa <Peter_Dyballa <at> Freenet.DE>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Tue, 09 May 2017 15:14:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Peter Dyballa <Peter_Dyballa <at> Freenet.DE>
To: bug-guile <at> gnu.org
Subject: guile-2.2.2/libguile/.libs/guile crashes during build on PowerPC
 Macintoshes
Date: Tue, 9 May 2017 17:11:03 +0200
Hello!

On Mac OS X versions 10.4.11 (Tiger) and 10.5.8 (Leopard) with PowerPC  
hardware this failure happens *every time*, i.e. it can be reproduced:

	./guile-snarf-docs -o regex-posix.doc regex-posix.c -- - 
DHAVE_CONFIG_H -DBUILDING_LIBGUILE=1 -I.. -I.. -I../lib -I../lib -I/ 
opt/local/lib/libffi-3.2.1/include -I/opt/local/var/macports/build/ 
_opt_local_var_macports_sources_lil 
.fr.rsync.macports.org_release_tarballs_ports_lang_guile/guile/work/ 
guile-2.2.2 -I/opt/local/include -pipe -Os -m32
	cat alist.doc array-handle.doc array-map.doc arrays.doc async.doc  
atomic.doc backtrace.doc boolean.doc bitvectors.doc bytevectors.doc  
chars.doc control.doc continuations.doc debug.doc deprecated.doc  
deprecation.doc dynl.doc dynwind.doc eq.doc error.doc eval.doc  
evalext.doc expand.doc extensions.doc fdes-finalizers.doc feature.doc  
filesys.doc fluids.doc foreign.doc fports.doc gc-malloc.doc gc.doc  
gettext.doc generalized-arrays.doc generalized-vectors.doc goops.doc  
gsubr.doc guardians.doc hash.doc hashtab.doc hooks.doc i18n.doc  
init.doc ioext.doc keywords.doc list.doc load.doc macros.doc  
mallocs.doc memoize.doc modules.doc numbers.doc objprop.doc  
options.doc pairs.doc ports.doc print.doc procprop.doc procs.doc  
promises.doc r6rs-ports.doc random.doc rdelim.doc read.doc rw.doc  
scmsigs.doc script.doc simpos.doc smob.doc sort.doc srcprop.doc  
srfi-1.doc srfi-4.doc srfi-13.doc srfi-14.doc srfi-60.doc stackchk.doc  
stacks.doc stime.doc strings.doc strorder.doc strports.doc struct.doc  
symbols.doc syntax.doc threads.doc throw.doc trees.doc unicode.doc  
uniform.doc values.doc variable.doc vectors.doc version.doc vports.doc  
weak-set.doc weak-table.doc weak-vector.doc dynl.doc posix.doc  
net_db.doc socket.doc regex-posix.doc | GUILE_AUTO_COMPILE=0 ../meta/ 
build-env guild snarf-check-and-output-texi          > guile- 
procedures.texi || { rm guile-procedures.texi; false; }
	cat: stdout: Broken pipe
	make[3]: *** [guile-procedures.texi] Error 1
	make[3]: Leaving directory `/opt/local/var/macports/build/ 
_opt_local_var_macports_sources_lil 
.fr.rsync.macports.org_release_tarballs_ports_lang_guile/guile/work/ 
guile-2.2.2/libguile'

The pipe breaks because the bootstrapped guile crashes. This can be  
shown manually, and this also tells gdb by reading the resulting core  
file.

https://trac.macports.org/ticket/54124 has a discussion on this bug  
plus much more information than this eMail. There another bug is  
described: configure only checks for Guile version 2.0 and 1.8.

Is there anything more I can do to retrieve more details of the  
failing guile?
--
Mit friedvollen Grüßen

  Pete

There are very few jobs that actually require a penis or vagina. All  
other jobs should be open to everybody.
				– Florynce Kennedy





Information forwarded to bug-guile <at> gnu.org:
bug#26854; Package guile. (Sat, 20 May 2017 21:43:02 GMT) Full text and rfc822 format available.

Message #8 received at 26854 <at> debbugs.gnu.org (full text, mbox):

From: Peter Dyballa <Peter_Dyballa <at> Freenet.DE>
To: 26854 <at> debbugs.gnu.org
Subject: Re: guile-2.2.2/libguile/.libs/guile crashes during build on PowerPC
 Macintoshes
Date: Sat, 20 May 2017 23:39:26 +0200
On PPC Mac OS X 10.4.11 the failure happens with both GCC 5 and GCC 6.

--
Greetings

  Pete

Basic, n.:
	A programming language. Related to certain social diseases in that those who have it will not admit it in polite company.





Information forwarded to bug-guile <at> gnu.org:
bug#26854; Package guile. (Thu, 12 Dec 2019 01:41:02 GMT) Full text and rfc822 format available.

Message #11 received at 26854 <at> debbugs.gnu.org (full text, mbox):

From: George Koehler <kernigh <at> gmail.com>
To: 26854 <at> debbugs.gnu.org
Cc: Matthew Hull <castersupmode <at> verizon.net>
Subject: guile 2.2.x has broken prebuilt/32-bit-big-endian
Date: Wed, 11 Dec 2019 18:34:15 -0500
Hello, GNU Guile community.

I believe that the files in guile-2.2.x/prebuilt/32-bit-big-endian are
broken.  This causes a reproducible crash when a 32-bit-big-endian
system tries to build guile 2.2.x from source code.  Because of this
crash, OpenBSD powerpc has no guile2 package.

Matthew Hull started a discussion on the OpenBSD ports list:
https://marc.info/?l=openbsd-ports&m=157550856819188&w=2

We have PowerPC Macintosh hardware running OpenBSD.  This seems to be
the same bug as #26854, which had PowerPC hardware running Mac OS X.

I worked around the problem in Guile 2.2.6 by moving away
prebuilt/32-bit-big-endian so the build doesn't use the prebuilt
files; but the "bootstrap" part of the build is slow.  I suspect that
a little-endian system wrote the prebuilt files, but
modules/system/vm/assembler.scm is missing a byte-swap.

The crash is in guile-2.2.6/libguile/vm-engine.c "call":

=lines 566 to 573
      if (SCM_LIKELY (SCM_PROGRAM_P (FP_REF (0))))
        ip = SCM_PROGRAM_CODE (FP_REF (0));
      else
        ip = (scm_t_uint32 *) vm_apply_non_program_code;

      APPLY_HOOK ();

      NEXT (0);
=end

`ip` gets a bad pointer to unmapped memory from SCM_PROGRAM_CODE, then
"NEXT (0);" tries to read ip[0] and crashes with SIGSEGV.

I found code that puts a bad pointer in the program object, in
vm-engine.c "make-closure":

=lines 1652 to 1654
      closure = scm_inline_words (thread, scm_tc7_program | (nfree << 16),
                                  nfree + 2);
      SCM_SET_CELL_WORD_1 (closure, ip + offset);
=end

I had modified the code to read *(ip + offset), so it crashed.  Then I
loaded the core dump in GDB.  `ip` was (scm_t_uint32 *) 0xcf1ea3b8 and
`offset` was -1005191168.  GDB can't access *0xcf1ea3b8 because it was
in an mmap(2) file, and the core dump didn't include this mapping.
In ktrace(1), the file was somewhere under prebuilt/32-bit-big-endian.

`offset` -1005191168 is 0xc4160000.  This looks like the wrong byte
order.  The correct value might be 0x000016c4 = 5828.  This would make
more sense, if ip + offset should be inside the file!

modules/system/vm/assembler.scm can byte-swap values when it emits
bytecode for a different-endian machine.  If a little-endian machine
wrote the prebuilt/32-bit-big-endian files, and assembler.scm forgot
to swap `offset`, then it would cause this bug.

I moved away the prebuilt/32-bit-big-endian files and started a new
build without these prebuilt files.  The build ran some slow
"bootstrap" commands on my 666 MHz cpu.  The first bootstrap command
took more than 100 minutes.  The second command took just over
4 hours.  The next commands continued overnight, and the whole build
might have taken almost 24 hours.  The build passes most tests:

SKIP: test-pthread-create-secondary
FAIL: test-stack-overflow
FAIL: test-out-of-memory                                                        ==================================
2 of 38 tests failed
(1 test was not run)

Because the bootstrap is so slow, I would like future versions of
Guile to include correct prebuilt/32-bit-big-endian files, but I don't
know how to make such files.

-- 
George Koehler <kernigh <at> gmail.com>




This bug report was last modified 4 years and 109 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.