Opened 10 years ago

Closed 8 years ago

#113 closed defect (fixed)

DEFSTRUCT redefinition can crash ABCL on MAKE-STRUCT

Reported by: mseddon Owned by: Mark Evenson
Priority: critical Milestone: 1.1.0
Component: java Version:
Keywords: needs-test Cc:
Parent Tickets:

Description

CL-USER(1): (defstruct foo x y)
FOO
CL-USER(2): (defstruct foo x y z)
FOO
CL-USER(3): (make-foo :x 1 :y 2 :z 3)
ABCL Debug.assertTrue() assertion failed!
java.lang.Error: ABCL Debug.assertTrue() assertion failed!

at org.armedbear.lisp.Debug.assertTrue(Debug.java:46)
at org.armedbear.lisp.StructureObject?.writeToString(StructureObject?.java

:483)

Multiple DEFSTRUCTs do not change the underlying structure class, but seem to cause StructureObject? to assert if the new (almost ignored) definition had a different number of slots than the old.

For example, while the above example crashes out ABCL, the following example does not:

CL-USER(1): (defstruct foo a b c)
FOO
CL-USER(2): (defstruct foo x y z)
FOO
CL-USER(3): (make-foo :x 1 :y 2 :z 3)
#S(FOO :A 1 :B 2 :C 3)

Change History (10)

comment:1 Changed 10 years ago by mseddon

Summary: DEFSTRUCT redefinition can crash ABCL on MAKE-FOODEFSTRUCT redefinition can crash ABCL on MAKE-STRUCT

comment:2 Changed 9 years ago by Mark Evenson

Milestone: 0.27

comment:3 Changed 9 years ago by Mark Evenson

Milestone: 0.270.28
Priority: minorcritical

Still present:

ABCL Debug.assertTrue() assertion failed!
java.lang.Error: ABCL Debug.assertTrue() assertion failed!
	at org.armedbear.lisp.Debug.assertTrue(Debug.java:46)
	at org.armedbear.lisp.StructureObject.printObject(StructureObject.java:483)
	at org.armedbear.lisp.Primitives$pf__write_to_string.execute(Primitives.java:925)
	at org.armedbear.lisp.Symbol.execute(Symbol.java:785)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:649)
	at org.armedbear.lisp.print_object_10.execute(print-object.lisp:47)
	at org.armedbear.lisp.clos_294.execute(clos.lisp:1976)
	at org.armedbear.lisp.clos_272.execute(clos.lisp:1728)

comment:4 Changed 9 years ago by Mark Evenson

Keywords: needs_test added

Should be fixed; identify test.

comment:5 Changed 9 years ago by Mark Evenson

Milestone: 0.281.0.1

comment:6 Changed 9 years ago by Mark Evenson

Keywords: needs-test added; needs_test removed
Milestone: 1.0.11.1.0

comment:7 Changed 9 years ago by Mark Evenson

Milestone: 1.1.01.0.2

comment:8 Changed 9 years ago by Mark Evenson

Milestone: 1.0.21.1.0
Owner: changed from nobody to Mark Evenson
Status: newassigned

comment:9 Changed 8 years ago by ehuelsmann

Problem is that we have DEFSTRUCTs in our code; we can't just reject redefinition, because that'd negatively interact with our current bootstrapping procedure.

Analysis of other implementations:

  1. SBCL offers a restart Continue/recklessly-continue/Abort
  2. clisp just continues

The solution we want to see implemented is: detect differences in definition and offer a restart to continue (change it).

This doesn't affect our bootstrapping since we always define to the same definition.

comment:10 Changed 8 years ago by ehuelsmann

Resolution: fixed
Status: assignedclosed

(In [14128]) Fix #113 (redefinition of structures can crash ABCL) by failing

the redefinition if the two structure definitions are not equalp.

Note: See TracTickets for help on using tickets.