Bug 250169

Summary: lang/sbcl: sbcl-2.0.9 fails to build
Product: Ports & Packages Reporter: goverm
Component: Individual Port(s)Assignee: Kirill Ponomarev <krion>
Status: Closed FIXED    
Severity: Affects Only Me CC: mikael
Priority: --- Flags: bugzilla: maintainer-feedback? (krion)
Version: Latest   
Hardware: amd64   
OS: Any   

Description goverm 2020-10-06 22:01:35 UTC
Hello,

I have port sbcl-2.0.8 installed and running and attempted upgrade of the port via portmaster and it is failing with the error shown below.

I also tried first removing sbcl-2.0.8 via "portmaster -e" and then attempted to install the 2.0.9 port and receive the same error.

Steps to reproduce:
# cd /usr/ports/lang/sbcl
# make config
# make install clean

Or:
# portmaster lang/sbcl


Running on Freebsd 12.1-RELEASE-p10.

Here is the pertinent portion of the output of the build displaying the error, thank you:


[building initial core file in "output/cold-sbcl_core": 
writing 0 bytes [0 pages] from #<SB-FASL::GSPACE @#x20000000 :READ-ONLY>
writing 32768 bytes [1 page] from #<SB-FASL::GSPACE @#x20100000 :STATIC>
writing 1736704 bytes [53 pages] from #<SB-FASL::GSPACE @#x20200000 :IMMOBILE-FIXEDOBJ>
writing 13697024 bytes [418 pages] from #<SB-FASL::GSPACE @#x21A00000 :IMMOBILE-VARYOBJ>
writing 22380544 bytes [683 pages] from #<SB-FASL::GSPACE @#x1000000000 :DYNAMIC>
movable dynamic space: 683 boxed pages, 0 code pages
/INITIAL-FUN=#X226ADCFB
done]
//testing for consistency of first and second GENESIS passes
//header files match between first and second GENESIS -- good
      194.65 real       186.80 user         5.62 sys
//entering make-target-2.sh
//doing warm init - compilation phase
This is SBCL 2.0.9, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
Initial page table:
Gen  Boxed   Code    Raw  LgBox LgCode  LgRaw  Pin       Alloc     Waste        Trig      WP GCs Mem-age
 6     683      0      0      0      0      0    0    22348256     32288     2000000     683   0  0.0000
           Total bytes allocated    =      22348256
           Dynamic-space-size bytes =    1073741824
COLD-INIT... fatal error encountered in SBCL pid 35755 pthread 0x80070b000:
Unhandled SIGILL at 0x21a00e9d.

Welcome to LDB, a low-level debugger for the Lisp runtime environment.
ldb>
Comment 1 Kirill Ponomarev freebsd_committer 2020-10-07 06:55:00 UTC
Weird, it builds fine in 12.1 here:
https://krion.cc/data/amd64-r121-default/2020-10-07_08h37m26s/logs/sbcl-2.0.9,1.log
Comment 2 Mikael Urankar freebsd_committer 2020-10-07 10:19:05 UTC
(In reply to goverm from comment #0)
Unhandled SIGILL at 0x21a00e9d.

what is the faulty instruction?
Comment 3 goverm 2020-10-07 12:17:19 UTC
(In reply to Mikael Urankar from comment #2)
How can I determine the faulty instruction to provide that information? I have just undertaken learning Lisp,  so am yet unfamiliar with the debugger as well.
Comment 4 goverm 2020-10-07 14:36:58 UTC
I have been researching info on the Lisp debugger to get myself more familiar, I ran a 'backtrace' and below is the output from that, does this help shed any light?

I appreciate any assistance and insight, thank you again!

output from debugger backtrace:

//entering make-target-2.sh
//doing warm init - compilation phase
This is SBCL 2.0.9, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
Initial page table:
Gen  Boxed   Code    Raw  LgBox LgCode  LgRaw  Pin       Alloc     Waste        Trig      WP GCs Mem-age
 6     683      0      0      0      0      0    0    22348256     32288     2000000     683   0  0.0000
           Total bytes allocated    =      22348256
           Dynamic-space-size bytes =    1073741824
COLD-INIT... fatal error encountered in SBCL pid 22973 pthread 0x80070b000:
Unhandled SIGILL at 0x21a00e9d.

Welcome to LDB, a low-level debugger for the Lisp runtime environment.
ldb> backtrace
Backtrace:
   0: , pc = 0x21a00e9d, fp = 0x800fffad8
   1: SB-IMPL::%MAKE-HASH-TABLE, pc = 0x22520d40, fp = 0x800fffb70
   2: MAKE-HASH-TABLE, pc = 0x22520319, fp = 0x800fffc40
   3: (FLET SB-THREAD::WITH-RECURSIVE-LOCK-THUNK :IN SB-KERNEL::REGISTER-LAYOUT), pc = 0x21d9bb2b, fp = 0x800fffc90
   4: (FLET "WITHOUT-INTERRUPTS-BODY-11" :IN SB-THREAD::CALL-WITH-RECURSIVE-LOCK), pc = 0x21bcf9a4, fp = 0x800fffd50
   5: SB-THREAD::CALL-WITH-RECURSIVE-LOCK, pc = 0x21bcf7e6, fp = 0x800fffdf0
   6: SB-KERNEL::REGISTER-LAYOUT, pc = 0x21d9b94e, fp = 0x800fffe88
   7: SB-KERNEL::!CLASSES-COLD-INIT, pc = 0x21da1788, fp = 0x800ffff08
   8: SB-KERNEL::!COLD-INIT, pc = 0x226ae008, fp = 0x800ffffc8
ldb>
Comment 5 Mikael Urankar freebsd_committer 2020-10-08 08:19:36 UTC
(In reply to goverm from comment #3)
You can use gdb:
gdb path_to_cold-sbcl_core output/cold-sbcl_core
x/i 0x21a00e9d
Comment 6 goverm 2020-10-08 14:21:03 UTC
(In reply to Mikael Urankar from comment #5)

Thank you Mikael.

I installed gdb. I then change directory to where "cold-sbcl_core" is located and attempt to run gdb against that file:

# cd /usr/ports/lang/sbcl/work/sbcl-2.0.9/output
# gdb core-sbcl_core

I receive the following output from gdb: 

# gdb cold-sbcl_core
GNU gdb (GDB) 9.2 [GDB v9.2 for FreeBSD]
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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 "x86_64-portbld-freebsd12.1".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
"/usr/ports/lang/sbcl/work/sbcl-2.0.9/output/cold-sbcl_core": not in executable format: file format not recognized
(gdb)

The file is within the directory I am running gdb from, to verify:
# pwd
/usr/ports/lang/sbcl/work/sbcl-2.0.9/output
# ls -l cold-sbcl_core
-rw-r--r--  1 root  wheel  37886640 Oct  7 10:14 cold-sbcl_core

Have I missed something?
Comment 7 Mikael Urankar freebsd_committer 2020-10-08 14:27:40 UTC
(In reply to goverm from comment #6)
is cold-sbcl_core a valid core file? I don't know much about sbcl.
Comment 8 goverm 2020-10-08 15:38:37 UTC
(In reply to Mikael Urankar from comment #7)

I don't know myself.

Perhaps not, based on the following, as from withing gdb I tried this as well:

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) core cold-sbcl_core
"/usr/ports/lang/sbcl/work/sbcl-2.0.9/output/cold-sbcl_core" is not a core dump: file format not recognized
(gdb)


Wish I was more versed in SBCL to be able to troubleshoot more effectively, would love to know what it is about my environment that is causing this, Since it appears that no one else is currently having a similar experience, I realize this would be difficult to isolate.

2.0.8 seems to run fine, so I can just stay with that version for now. Perhaps something will come to light in time?

If there are no other suggestions, thank you Mikael and Kirill for the feedback and your time, I appreciate it.
Comment 9 goverm 2020-10-16 14:13:05 UTC
I can confirm that with the latest revision, sbcl-2.0.9_1 builds successfully on my 12.1-RELEASE-p10 system.

Thank you Kirill for your time and efforts, it is much appreciated!