bugMIT/GNU Scheme - Bugs: bug #65869, SIGSEGV in sf after (srfi 140) is...

 
 

bug #65869: SIGSEGV in sf after (srfi 140) is imported

Submitter:  Arthur A. Gleckler <aag>
Submitted:  Tue 11 Jun 2024 05:43:54 AM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  None Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Open
Keywords: 
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 20 Jun 2024 08:02:31 PM UTC, comment #9: 

This time, I made sure that the libraries, e.g. SRFI 180, were also interpreted.  There was no error at all; sf succeeded even after SRFI 180 had been imported.

Does this mean that this is the result of a compiler bug?


$ms/src/runtime> ../microcode/scheme --fasl make.bin
MIT/GNU Scheme running under GNU/Linux
Type `^C' (control-C) followed by `H' to obtain information about interrupts.


packag.bin loaded evaluated
runtime-unx.pkd loaded
gcdemn.bin loaded evaluated
gc.bin loaded evaluated
boot-seq.bin loaded evaluated
primitive-data.bin loaded evaluated
boot.bin loaded evaluated
generator.bin loaded evaluated
dispatch-low.bin loaded evaluated
types.bin loaded evaluated
dispatch-tag.bin loaded evaluated
queue.bin loaded evaluated
equals.bin loaded evaluated
vector.bin loaded evaluated
procedure.bin loaded evaluated
list.bin loaded evaluated
weak-pair.bin loaded evaluated
primitive-arithmetic.bin loaded evaluated
srfi-1.bin loaded evaluated
thread-low.bin loaded evaluated
msort.bin loaded evaluated
string.bin loaded evaluated
bytevector-low.bin loaded evaluated
symbol.bin loaded evaluated
random.bin loaded evaluated
poplat.bin loaded evaluated
prop1d.bin loaded evaluated
record.bin loaded evaluated
initialize: (runtime gc-daemons) [initialize-package!]
initialize: (runtime garbage-collector) [initialize-package!]
initialize: (runtime tagged-dispatch) [initialize-cache-numbers!]
initialize: (runtime types) [initialize-package!]
initialize: (runtime procedure) [initialize-package!]
initialize: (runtime boot-definitions) [initialize-package!]
initialize: (runtime population)
initialize: (runtime 1d-property)
initialize: (runtime record)
bundle.bin loaded evaluated
syntax-low.bin loaded evaluated
thread.bin loaded evaluated
wind.bin loaded evaluated
events.bin loaded evaluated
gcfinal.bin loaded evaluated
initialize: (runtime state-space)
initialize: (runtime thread) [initialize-low!]
initialize: (runtime gc-finalizer)
initialize: (package) [finalize-package-record-type!]
initialize: (runtime random-number) [finalize-random-state-type!]
version.bin loaded evaluated
bitstr.bin loaded evaluated
blowfish.bin loaded evaluated
boole.bin loaded evaluated
floenv.bin loaded evaluated
integer-bits.bin loaded evaluated
division.bin loaded evaluated
keyword.bin loaded evaluated
global.bin loaded evaluated
qsort.bin loaded evaluated
sha3.bin loaded evaluated
thread-queue.bin loaded evaluated
sfile.bin loaded evaluated
microcode-data.bin loaded evaluated
os-primitives.bin loaded evaluated
unxprm.bin loaded evaluated
legacy-string.bin loaded evaluated
bytevector.bin loaded evaluated
prop2d.bin loaded evaluated
advice.bin loaded evaluated
apply.bin loaded evaluated
char.bin loaded evaluated
ucd-table-alpha.bin loaded evaluated
ucd-table-canonical-cm.bin loaded evaluated
ucd-table-canonical-cm-second.bin loaded evaluated
ucd-table-canonical-dm.bin loaded evaluated
ucd-table-cased.bin loaded evaluated
ucd-table-ccc.bin loaded evaluated
ucd-table-cf.bin loaded evaluated
ucd-table-comp_ex.bin loaded evaluated
ucd-table-cwcf.bin loaded evaluated
ucd-table-cwl.bin loaded evaluated
ucd-table-cwt.bin loaded evaluated
ucd-table-cwu.bin loaded evaluated
ucd-table-gc.bin loaded evaluated
ucd-table-gc=cc.bin loaded evaluated
ucd-table-gc=cf.bin loaded evaluated
ucd-table-gc=cn.bin loaded evaluated
ucd-table-gc=co.bin loaded evaluated
ucd-table-gc=cs.bin loaded evaluated
ucd-table-gc=ll.bin loaded evaluated
ucd-table-gc=lm.bin loaded evaluated
ucd-table-gc=lo.bin loaded evaluated
ucd-table-gc=lt.bin loaded evaluated
ucd-table-gc=lu.bin loaded evaluated
ucd-table-gc=mc.bin loaded evaluated
ucd-table-gc=me.bin loaded evaluated
ucd-table-gc=mn.bin loaded evaluated
ucd-table-gc=nd.bin loaded evaluated
ucd-table-gc=nl.bin loaded evaluated
ucd-table-gc=no.bin loaded evaluated
ucd-table-gc=pc.bin loaded evaluated
ucd-table-gc=pd.bin loaded evaluated
ucd-table-gc=pe.bin loaded evaluated
ucd-table-gc=pf.bin loaded evaluated
ucd-table-gc=pi.bin loaded evaluated
ucd-table-gc=po.bin loaded evaluated
ucd-table-gc=ps.bin loaded evaluated
ucd-table-gc=sc.bin loaded evaluated
ucd-table-gc=sk.bin loaded evaluated
ucd-table-gc=sm.bin loaded evaluated
ucd-table-gc=so.bin loaded evaluated
ucd-table-gc=zl.bin loaded evaluated
ucd-table-gc=zp.bin loaded evaluated
ucd-table-gc=zs.bin loaded evaluated
ucd-table-gcb+ep.bin loaded evaluated
ucd-table-lc.bin loaded evaluated
ucd-table-lower.bin loaded evaluated
ucd-table-nfc_qc.bin loaded evaluated
ucd-table-nfd_qc.bin loaded evaluated
ucd-table-nt.bin loaded evaluated
ucd-table-nt=de.bin loaded evaluated
ucd-table-nt=di.bin loaded evaluated
ucd-table-nt=nu.bin loaded evaluated
ucd-table-nv.bin loaded evaluated
ucd-table-scf.bin loaded evaluated
ucd-table-slc.bin loaded evaluated
ucd-table-stc.bin loaded evaluated
ucd-table-suc.bin loaded evaluated
ucd-table-tc.bin loaded evaluated
ucd-table-uc.bin loaded evaluated
ucd-table-upper.bin loaded evaluated
ucd-table-wb+ep.bin loaded evaluated
ucd-table-wspace.bin loaded evaluated
ucd-glue.bin loaded evaluated
ucd-segmentation.bin loaded evaluated
ucd-grapheme.bin loaded evaluated
ucd-word.bin loaded evaluated
char-set.bin loaded evaluated
infstr.bin loaded evaluated
infutl.bin loaded evaluated
console-io.bin loaded evaluated
contin.bin loaded evaluated
continuation-parser.bin loaded evaluated
continuation-tree.bin loaded evaluated
control-point.bin loaded evaluated
debugger.bin loaded evaluated
datime.bin loaded evaluated
dbgcmd.bin loaded evaluated
dbgutl.bin loaded evaluated
unxdir.bin loaded evaluated
emacs.bin loaded evaluated
predicate.bin loaded evaluated
compound-predicate.bin loaded evaluated
predicate-tagging.bin loaded evaluated
predicate-dispatch.bin loaded evaluated
environment.bin loaded evaluated
where.bin loaded evaluated
error.bin loaded evaluated
xeval.bin loaded evaluated
file-io.bin loaded evaluated
transcript.bin loaded evaluated
gcnote.bin loaded evaluated
gcstat.bin loaded evaluated
generic-io.bin loaded evaluated
hash.bin loaded evaluated
hash-table.bin loaded evaluated
memoizer.bin loaded evaluated
histry.bin loaded evaluated
binary-port.bin loaded evaluated
textual-port.bin loaded evaluated
input-port.bin loaded evaluated
output-port.bin loaded evaluated
interrupt.bin loaded evaluated
lambda.bin loaded evaluated
lambdx.bin loaded evaluated
lambda-list.bin loaded evaluated
load.bin loaded evaluated
command-line.bin loaded evaluated
microcode-errors.bin loaded evaluated
microcode-tables.bin loaded evaluated
arith.bin loaded evaluated
dragon4.bin loaded evaluated
numpar.bin loaded evaluated
option.bin loaded evaluated
reader.bin loaded evaluated
file-attributes.bin loaded evaluated
pathname.bin loaded evaluated
unix-pathname.bin loaded evaluated
pp.bin loaded evaluated
primitive-io.bin loaded evaluated
ffi.bin loaded evaluated
prgcop.bin loaded evaluated
reference-trap.bin loaded evaluated
rep.bin loaded evaluated
rep-ui.bin loaded evaluated
savres.bin loaded evaluated
scode.bin loaded evaluated
sdata.bin loaded evaluated
scan.bin loaded evaluated
codwlk.bin loaded evaluated
socket.bin loaded evaluated
graphics.bin loaded evaluated
x11graph.bin loaded evaluated
dynamic.bin loaded evaluated
stream.bin loaded evaluated
string-io.bin loaded evaluated
syntax.bin loaded evaluated
syntax-items.bin loaded evaluated
syntax-environment.bin loaded evaluated
syntax-check.bin loaded evaluated
syntax-parser.bin loaded evaluated
syntax-constructor.bin loaded evaluated
syntax-rename.bin loaded evaluated
syntax-output.bin loaded evaluated
declaration.bin loaded evaluated
mit-syntax.bin loaded evaluated
mit-macros.bin loaded evaluated
syntax-rules.bin loaded evaluated
defstr.bin loaded evaluated
sysmac.bin loaded evaluated
system.bin loaded evaluated
sysclk.bin loaded evaluated
printer.bin loaded evaluated
unsyn.bin loaded evaluated
wrkdir.bin loaded evaluated
usrint.bin loaded evaluated
thread-barrier.bin loaded evaluated
condvar.bin loaded evaluated
rbtree.bin loaded evaluated
wttree.bin loaded evaluated
apropos.bin loaded evaluated
dispatch-cache.bin loaded evaluated
type-dispatch.bin loaded evaluated
crypto.bin loaded evaluated
regsexp.bin loaded evaluated
srfi-115.bin loaded evaluated
regexp-rules.bin loaded evaluated
regexp-nfa.bin loaded evaluated
regexp-recursive.bin loaded evaluated
parser-buffer.bin loaded evaluated
url.bin loaded evaluated
rfc2822-headers.bin loaded evaluated
http-syntax.bin loaded evaluated
http-io.bin loaded evaluated
http-client.bin loaded evaluated
html-form-codec.bin loaded evaluated
structure-parser.bin loaded evaluated
swank.bin loaded evaluated
stack-sample.bin loaded evaluated
world-report.bin loaded evaluated
library-database.bin loaded evaluated
library-parser.bin loaded evaluated
library-standard.bin loaded evaluated
library-ixports.bin loaded evaluated
library-ixports-r7rs.bin loaded evaluated
library-ixports-mit.bin loaded evaluated
library-scode.bin loaded evaluated
library-loader.bin loaded evaluated
digraph.bin loaded evaluated
ieee754.bin loaded evaluated
simple-matcher.bin loaded evaluated
trie.bin loaded evaluated
cgen-base.bin loaded evaluated
cgen-optimize.bin loaded evaluated
cgen-cse.bin loaded evaluated
cgen-output.bin loaded evaluated
comparator.bin loaded evaluated
feature.bin loaded evaluated
amap.bin loaded evaluated
amap-impl.bin loaded evaluated
amap-hash-table.bin loaded evaluated
amap-trie.bin loaded evaluated
amap-alist.bin loaded evaluated
initialize: (runtime string)
initialize: (runtime floating-point-environment)
initialize: (runtime character)
initialize: (runtime ucd-tables)
initialize: (runtime ucd-glue)
initialize: (runtime character-set)
initialize: (runtime file-attributes)
initialize: (runtime html-form-codec)
initialize: (runtime debugger)
initialize: (runtime environment-inspector)
initialize: (runtime microcode-tables)
initialize: (runtime miscellaneous-global)
initialize: (runtime history)
initialize: (runtime continuation-parser)
initialize: (runtime interrupt-handler)
initialize: (runtime number)
initialize: (runtime bytevector)
initialize: (runtime syntax parser)
initialize: (runtime number-parser)
initialize: (runtime version)
initialize: (runtime pathname unix)
initialize: (runtime stream)
initialize: (runtime hash-table)
initialize: (runtime simple-file-ops)
initialize: (runtime os-primitives)
initialize: (runtime predicate)
initialize: (runtime compound-predicate)
initialize: (runtime predicate-tagging)
initialize: (runtime comparator)
initialize: (runtime equality)
initialize: (runtime continuation-tree)
initialize: (runtime memoizer)
initialize: (runtime syntax items)
initialize: (runtime syntax mit)
initialize: (runtime library parser)
initialize: (runtime library import/export mit)
initialize: (runtime library loader)
initialize: (runtime amap impl)
initialize: (runtime rb-tree)
initialize: (runtime amap hash-table)
initialize: (runtime amap alist)
initialize: (runtime hash)
initialize: (runtime dynamic)
initialize: (runtime syntax low)
initialize: (runtime advice)
initialize: (runtime ucd-segmentation)
initialize: (runtime ucd-segmentation grapheme)
initialize: (runtime ucd-segmentation word)
initialize: (runtime compiler-info)
initialize: (runtime directory)
initialize: (runtime error-handler)
initialize: (runtime load)
initialize: (runtime microcode-errors)
initialize: (runtime thread)
initialize: (runtime gc-notification)
initialize: (runtime ffi)
initialize: (runtime stack-sampler)
initialize: (runtime reader)
initialize: (runtime scode-data)
initialize: (runtime rep)
initialize: (runtime rep ui)
initialize: (runtime syntax top-level)
initialize: (runtime rfc2822-headers)
initialize: (runtime port)
initialize: (runtime generic-i/o-port)
initialize: (runtime console-i/o-port)
initialize: (runtime emacs-interface)
initialize: (runtime gc-statistics)
initialize: (runtime file-i/o-port)
initialize: (runtime socket)
initialize: (runtime string-i/o-port)
initialize: (runtime output-port)
initialize: (runtime user-interface)
initialize: (runtime swank)
initialize: (runtime command-line)
initialize: (runtime options)
initialize: (runtime save/restore)
initialize: (runtime syntax rename)
initialize: (runtime structure-parser)
initialize: (runtime uri)
initialize: (runtime http-syntax)
initialize: (runtime library standard)
initialize: (runtime regexp regsexp)
initialize: (runtime regexp srfi-115)
initialize: (runtime scode-walker)
initialize: (runtime extended-scode-eval)
initialize: (runtime program-copier)
initialize: (runtime unsyntaxer)
initialize: (runtime feature)
initialize: (runtime working-directory)
initialize: (runtime pathname)
initialize: (runtime wt-tree)
initialize: (runtime pretty-printer)
initialize: (runtime printer)
initialize: (runtime cgen)
initialize: (runtime cgen optimizer)
initialize: (runtime cgen output)
initialize: (runtime amap trie)
initialize: (runtime library standard) [finish-host-library-db!]
initialize: (runtime microcode-errors) [initialize-error-hooks!]
purifying...done
;Cold load finished
;package: (user)

1 ]=> (find-scheme-libraries! "$ms/src/libraries")

;Loading "/home/arthur/repo-clones/mit-scheme/src/libraries/html-parser.binld"... done
;Registering library (mit html-parser) from "html-parser.binld"... done
;Loading "/home/arthur/repo-clones/mit-scheme/src/libraries/srfi-14.binld"... done
;Registering library (srfi 14) from "srfi-14.binld"... done
;Loading "/home/arthur/repo-clones/mit-scheme/src/libraries/srfi-180.binld"... done
;Registering library (srfi 180) from "srfi-180.binld"... done
;Loading "/home/arthur/repo-clones/mit-scheme/src/libraries/srfi-140.binld"... done
;Registering library (srfi 140) from "srfi-140.binld"... done
;Registering library (srfi 140 base) from "srfi-140.binld"... done
;Registering library (srfi 140 char) from "srfi-140.binld"... done
;Registering library (srfi 140 istrings) from "srfi-140.binld"... done
;Loading "/home/arthur/repo-clones/mit-scheme/src/libraries/inline-testing.binld"... done
;Registering library (mit inline-testing) from "inline-testing.binld"... done
;Loading "/home/arthur/repo-clones/mit-scheme/src/libraries/srfi-133.binld"... done
;Registering library (srfi 133) from "srfi-133.binld"... done
;Unspecified return value

1 ]=> ,(import (srfi 180))

;Loading "/home/arthur/repo-clones/mit-scheme/src/libraries/srfi-14.binld"... done
;Loading "/home/arthur/repo-clones/mit-scheme/src/libraries/srfi-180.binld"... done
;Unspecified return value

1 ]=> (cd "$ms/src/sf/")

;Value: #[pathname 1 "/home/arthur/repo-clones/mit-scheme/src/sf/"]

1 ]=> (load "make.scm")

;Loading "make.scm"...
;  Loading "sf-unx.pkd"... done
;  Loading "pthmap.bin"... done
;  Loading "object.bin"... done
;  Loading "emodel.bin"... done
;  Loading "gconst.bin"... done
;  Loading "usicon.bin"... done
;  Loading "tables.bin"... done
;  Loading "toplev.bin"... done
;  Loading "xform.bin"... done
;  Loading "subst.bin"... done
;  Loading "cgen.bin"... done
;  Loading "usiexp.bin"... done
;  Loading "reduct.bin"... done
;  Loading "pardec.bin"... done
;  Loading "copy.bin"... done
;  Loading "analyze.bin"... done
;  Loading "chtype.bin"... done
;  Loading "butils.bin"... done
;... done
;Unspecified return value

1 ]=> (cd "$t/mit-scheme-sigsegv/")

;Value: #[pathname 2 "/home/arthur/tmp/mit-scheme-sigsegv/"]

1 ]=> (find-scheme-libraries! ".")

;Registering library (bar) from "/home/arthur/tmp/mit-scheme-sigsegv/./bar.sld"... done
;Registering library (foo) from "/home/arthur/tmp/mit-scheme-sigsegv/./foo.sld"... done
;Unspecified return value

1 ]=> (disk-save "/tmp/interpreted-imported.bin")

;Unspecified return value

1 ]=> (sf "foo.sld")

;Generating SCode for file: "foo.sld" => "foo.binld"... done
;Unspecified return value

1 ]=>


Arthur A. Gleckler <aag>
Group Member
Thu 20 Jun 2024 01:25:34 PM UTC, comment #8: 

I built Scheme and sf interpreted, then tried again.  Unfortunately, I'm still only triggering the bug well after the corruption is caused:

1 ]=> (sf "foo.sld")

;Generating SCode for file: "foo.sld" => "foo.binld"...scheme: intern.c:74: replace_symbol_bucket_type: Assertion `INTERNED_SYMBOL_P (symbol)' failed.
Aborted (core dumped)

I'll try to switch the SRFI's implementation to interpreted.

Arthur A. Gleckler <aag>
Group Member
Wed 19 Jun 2024 04:43:40 AM UTC, comment #7: 

The stack trace shows the #[false #...] value causing a problem, but I haven't been able to track down where that malformed value is created.

Arthur A. Gleckler <aag>
Group Member
Wed 19 Jun 2024 03:59:16 AM UTC, comment #6: 

I worked around bug #65891 and got a debugging build of MIT Scheme, then ran GDB.  Here's a C stack trace at the point the problem occurs:


(gdb) backtrace
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=128698331196480) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=128698331196480) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=128698331196480, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x0000750cea242476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x0000750cea2287f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x0000750cea22871b in __assert_fail_base (fmt=0x750cea3dd130 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
    assertion=0x5c6fb7d02cb9 "INTERNED_SYMBOL_P (symbol)", file=0x5c6fb7d02cb0 "intern.c", line=74,
    function=<optimized out>) at ./assert/assert.c:92
#6  0x0000750cea239e96 in __GI___assert_fail (assertion=0x5c6fb7d02cb9 "INTERNED_SYMBOL_P (symbol)",
    file=0x5c6fb7d02cb0 "intern.c", line=74,
    function=0x5c6fb7d02d60 <__PRETTY_FUNCTION__.0> "replace_symbol_bucket_type") at ./assert/assert.c:101
#7  0x00005c6fb7caeaf6 in replace_symbol_bucket_type (symbol=950267066696, type=1) at intern.c:74
#8  0x00005c6fb7caec73 in strengthen_symbol (symbol=950267066696) at intern.c:109
#9  0x00005c6fb7cba6f2 in add_cache_reference (environment=0, symbol=950267066696, block=17582052945283614800,
    offset=847, kind=OPERATOR_CACHE) at lookup.c:925
#10 0x00005c6fb7cba335 in compiler_cache_global_operator (name=950267066696, block=17582052945283614800, offset=847)
    at lookup.c:792
#11 0x00005c6fb7cf8e5b in link_section (s=0x7ffccbeeda10) at cmpint.c:1002
#12 0x00005c6fb7cf8c03 in link_remaining_sections (s=0x7ffccbeeda10) at cmpint.c:900
#13 0x00005c6fb7cf8a8a in comutil_link (DSU_result=0x7ffccbeeda70, return_addr_raw=29198485,
    block_addr_raw=29198416, constant_addr_raw=29204440, n_sections_raw=3) at cmpint.c:861
#14 0x00005c6fb7cf1fe1 in scheme_to_interface_reentry ()
#15 0x00007ffccbeeda80 in ?? ()
#16 0x00005c6fb7cd8c04 in end_subproblem () at utils.c:870
#17 0x00005c6fb7cf7ccd in enter_compiled_expression () at cmpint.c:456
#18 0x00005c6fb7cb077a in eval_compiled_entry (exp=11529215046097668204, env=5188146770765537680) at interp.c:342
#19 0x00005c6fb7cb0c26 in eval (exp=11529215046097668204, env=5188146770765537680, variant=VARIANT_TRAP)
    at interp.c:451
#20 0x00005c6fb7cb2740 in Interpret () at interp.c:1150
#21 0x00005c6fb7c96087 in Do_Enter_Interpreter () at boot.c:199
#22 0x00005c6fb7c960b2 in Enter_Interpreter () at boot.c:207
#23 0x00005c6fb7c96073 in start_scheme () at boot.c:193
#24 0x00005c6fb7c95cf7 in main (argc=3, argv=0x7ffccbeede28) at boot.c:119


Arthur A. Gleckler <aag>
Group Member
Sat 15 Jun 2024 04:58:34 AM UTC, comment #5: 

In the (eval-result environment) automatic property, the contents value is eq? between the (import (foo)) run and the (sf "foo.sld") run.  So running scode-eval on the same code is modifying the environment differently (corrupting it in one case) depending on whether the import has been done first.

Arthur A. Gleckler <aag>
Group Member
Sat 15 Jun 2024 12:40:14 AM UTC, comment #4: 

When running sf on SRFI 180, the corruption happens to the SRFI 14 environment inside the automatic property (eval-result environment).  After scode-eval is applied, two new variables are bound: char-set, which makes sense since it's defined in the begin clause; and #[false #x1c55cb0b948], which is the corruption, i.e. it's not a symbol.

I've hit a wall because I don't know how to see the code in the automatic property's variable contents.  That code appears to be what caused the problem.

Strangely, the bug doesn't happen when running sf on the sources for SRFI 14 directly — only when SRFI 180 imports it.

Arthur A. Gleckler <aag>
Group Member
Fri 14 Jun 2024 06:16:26 AM UTC, comment #3: 

I've discovered that the environment produced by make-environment-from-imports for SRFI 180 is valid at the moment that that procedure returns, but is somehow corrupted later.  Specifically, environment-bound-names later shows that an additional 25 entries have been added, all false values like #[false #x1b46e98].  I haven't been able to track down where this is happening.

Arthur A. Gleckler <aag>
Group Member
Fri 14 Jun 2024 12:37:16 AM UTC, comment #2: 

It happens with SRFIs 133 and 180, too, as well as (mit inline-testing).  But not 1, 14, or 115.

Arthur A. Gleckler <aag>
Group Member
Tue 11 Jun 2024 05:46:57 AM UTC, comment #1: 

Note that it is crucial that both libraries import SRFI 140.  If either or both imports SRFI 1, for example, the problem doesn't occur.

Arthur A. Gleckler <aag>
Group Member
Tue 11 Jun 2024 05:43:54 AM UTC, original submission:  

I'm tracking down a bug that causes a SIGSEGV when sf is run.  Below are the simplest steps I've been able to find that reproduce the problem.

Two files are involved:

foo.sld
-------

(define-library (foo)
  (import (srfi 140)))



bar.sld
-------

(define-library (bar)
  (import (srfi 140)))


Given those files, the following sequence works fine starting with a fresh Scheme 13.0.50:


1 ]=> (find-scheme-libraries! ".")

;Registering library (bar) from "/home/arthur/tmp/mit-scheme-sigsegv/./bar.sld"... done
;Registering library (foo) from "/home/arthur/tmp/mit-scheme-sigsegv/./foo.sld"... done
;Unspecified return value

1 ]=> (sf "bar.sld")

;Generating SCode for file: "bar.sld" => "bar.binld"...
;  Loading "/usr/local/lib/mit-scheme-x86-64-13.0.50/libraries/srfi-140.comld"... done
;... done
;Unspecified return value

1 ]=>


However, importing foo.sld before running sf causes a SIGSEGV:


1 ]=> (find-scheme-libraries! ".")

;Registering library (bar) from "/home/arthur/tmp/mit-scheme-sigsegv/./bar.sld"... done
;Registering library (foo) from "/home/arthur/tmp/mit-scheme-sigsegv/./foo.sld"... done
;Unspecified return value

1 ]=> ,(import (foo))

;Loading "/usr/local/lib/mit-scheme-x86-64-13.0.50/libraries/srfi-140.comld"... done
;Unspecified return value

1 ]=> (sf "bar.sld")

;Generating SCode for file: "bar.sld" => "bar.binld"...
;Hardware trap SIGSEGV: "address not mapped to object"
;To continue, call RESTART with an option number:
; (RESTART 2) => Skip processing file /home/arthur/tmp/mit-scheme-sigsegv/bar.sld
; (RESTART 1) => Return to read-eval-print level 1.

2 error> ,(import (mit runtime-internal))

;Unspecified return value

2 error> (generator-for-each write-line
                        (control-point->raw-frame-generator
                         (continuation/control-point
                          (condition/continuation
                           (nearest-repl/condition)))))
#(0 17 #(#[return-address 12 restore-interrupt-mask] 65535))
#(2 17 #(#[return-address 13 restore-history] #[hunk3-a 14] 0 #f))
#(6 17 #(#[return-address 15 hardware-trap] 11 "SIGSEGV" (1 . "address not mapped to object") #f 0 95599466821789 #!unspecific #[non-marked-vector 16]))
#(15 17 #(#[return-address 17 end-of-computation] #f))
;Unspecified return value

2 error>


I'm not sure where to go from here.  Suggestions welcome!

Thanks.

Arthur A. Gleckler <aag>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by aag (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-5884.
    Corresponding source code