unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Sergei Trofimovich <slyfox@gentoo.org>
To: 38772@debbugs.gnu.org
Subject: bug#38772: guile-2.2.6 'prebuilt/32-bit-big-endian' prebuilt bytecode is invalid
Date: Sat, 28 Dec 2019 11:24:46 +0000	[thread overview]
Message-ID: <20191228112446.7c82796e@sf> (raw)

In https://bugs.gentoo.org/676468 Gentoo found out that
guile-2.26 release fails to build on 32-bit BE targets:
- powerpc-unknown-linux-gnu
- sparc-unknown-linux-gnu
- hppa-unknown-linux-gnu

The symptom is a SIGSEGV:
    https://bugs.gentoo.org/676468#c10

The workaround is to delete 'prebuilt/32-bit-big-endian'
to regenerate it locally.

After bytecode is rebuilt we can verify that original bytecode
does not look valid:

guile-2.2.3 $
  meta/build-env guile -c '((@ (system vm disassembler) disassemble-file) "prebuilt/32-bit-big-endian.broken/system/foreign.go")'
Disassembly of <unnamed function> at #x98:

Backtrace:
           9 (apply-smob/1 #<catch-closure ef391f00>)
In ice-9/boot-9.scm:
    705:2  8 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
In ice-9/eval.scm:
    619:8  7 (_ #(#(#<directory (guile-user) ef37c910>)))
In ice-9/command-line.scm:
   181:18  6 (_ #<input: string ef658f50>)
In unknown file:
           5 (eval ((@ (system vm disassembler) disassemble-file) #) #)
In system/vm/disassembler.scm:
    464:4  4 (disassemble-image _ _)
In system/vm/debug.scm:
   121:17  3 (for-each-elf-symbol _ #<procedure ef398be8 at system/v…>)
In system/vm/disassembler.scm:
    475:9  2 (_ _)
   338:16  1 (disassemble-buffer #<output: file /dev/console> # 38 # …)
   291:14  0 (compute-labels #vu8(127 69 76 70 1 2 1 255 0 0 0 0 0 …) …)

system/vm/disassembler.scm:291:14: In procedure compute-labels:
In procedure vector-ref: Value out of range: 3678

I see 2 problems here:
1. 32-bit BE bytecode seems to be invalid. How does it get generated? Via cross-compilation?
2. guile does not validate bytecode when executes it (at least by default) and just SIGSEGVs.

-- 

  Sergei





                 reply	other threads:[~2019-12-28 11:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191228112446.7c82796e@sf \
    --to=slyfox@gentoo.org \
    --cc=38772@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).