Ticket #446 (closed defect: fixed)

Opened 6 years ago

Last modified 5 years ago

large array allocations in IDE cause hemlock to lock up

Reported by: raffael cavallaro Owned by: gb
Priority: major Milestone:
Component: Runtime (threads, GC) Version:
Keywords: array hemlock Cc:

Description (last modified by gb) (diff)

IDE 64-bit Intel version 1.3-RC1-r11804M

this simple function:

(defun atest (exponent)
  (declare (optimize (speed 0) (safety 3) (debug 3)))
 
(time (let* ((size (expt 10 exponent))
               (x (make-array size :element-type 'fixnum)))
          (loop for i fixnum below size do
            (setf (aref x i) i)) (aref x (- size 10)))))

when called with an arg of 7 (i.e., create an array of (expt 10 7) fixnums, causes hemlock and the IDE to lock up with the error below in AltConsole?.

BTW, this causes no problems at all in the command line dx8664cl.

*** Error in event process: value #<BOGUS object @ #x300041A48ACD> is not of the expected type STRUCTURE.

 (442590) : 0 (FUNCALL #'#<(:INTERNAL GUI::|-[HemlockTextstorageTextView updateSelection:length:affinity:]|)> #<TYPE-ERROR #x3000419FFE6D>) 149
  (#:G25336)
   #:G25336: #<TYPE-ERROR #x3000419FFE6D>

  #:COMPILER-VAR: (NIL)
  #:G25333: #<A Foreign Pointer [stack-allocated] #x7FFF5FBFF8B0>

 (4425B8) : 1 (SIGNAL #<TYPE-ERROR #x3000419FFE6D>) 981
  (CONDITION &REST CCL::ARGS)
   CONDITION: #<TYPE-ERROR #x3000419FFE6D>
   CCL::ARGS: NIL

  CCL::%HANDLERS%: ((ERROR) (CONDITION #) (ERROR))
  CCL::TAG: #<TYPE-ERROR #x3000419FFE6D>
  CCL::HANDLERS: CCL::*BACKTRACE-CONTEXTS*
  CCL::FN: #<COMPILED-LEXICAL-CLOSURE (:INTERNAL GUI::|-[HemlockTextstorageTextView updateSelection:length:affinity:]|) #x49374F>

 (442610) : 2 (%ERROR #<TYPE-ERROR #x3000419FFE6D> NIL 558318) 117
  (CONDITION CCL::ARGS CCL::ERROR-POINTER)
   CONDITION: #<TYPE-ERROR #x3000419FFE6D>
   CCL::ARGS: NIL
   CCL::ERROR-POINTER: 558318



 (442638) : 3 (FUNCALL #'#<(:INTERNAL CCL::%XERR-DISP)>) 4365
  NIL

  CCL::FRAME-PTR: 558318
  CCL::FN: #<Compiled-function HEMLOCK-INTERFACE:NEXT-CHARACTER #x30004143C21F>
  CCL::OP0: 205
  CCL::OP1: 222
  CCL::OP2: 54
  CCL::SKIP: -1
  CCL::TYPENAME: STRUCTURE
  CCL::XP: #<A Foreign Pointer #x7FFF5FBFF5C0>
  CCL::XCF: #<A Foreign Pointer #x442770>

 (442690) : 4 (FUNCALL-WITH-ERROR-REENTRY-DETECTION #<COMPILED-LEXICAL-CLOSURE (:INTERNAL CCL::%XERR-DISP) #x49369F>) 181
  (CCL::THUNK)
   CCL::THUNK: #<COMPILED-LEXICAL-CLOSURE (:INTERNAL CCL::%XERR-DISP) #x49369F>

  COUNT: 0
  CCL::*ERROR-REENTRY-COUNT*: 0

 (4426D0) : 5 (FUNCALL #'#<CCL::%XERR-DISP> 17591849975218) 493
  (#:G128953)
   #:G128953: 17591849975218

  #:G128963: #<A Foreign Pointer [stack-allocated] #x7FFF5FBFED90>
  CCL::XP: #<A Foreign Pointer #x7FFF5FBFF5C0>
  CCL::XCF: #<A Foreign Pointer #x442770>
  #:G128964: #<COMPILED-LEXICAL-CLOSURE (:INTERNAL CCL::%XERR-DISP) #x49369F>

 (442708) : 6 (%PASCAL-FUNCTIONS% 2 17591849975218) 397
  (CCL::INDEX CCL::ARGS-PTR-FIXNUM)
   CCL::INDEX: 2
   CCL::ARGS-PTR-FIXNUM: 17591849975218

  CCL::LISP-FUNCTION: #<Compiled-function CCL::%XERR-DISP (Non-Global)  #x3000405CE2AF>
  WITHOUT-INTERRUPTS: NIL
  CCL::*CALLBACK-TRACE-P*: NIL

*(442770) : 8 (NEXT-CHARACTER #<error printing object>) 784
  (HEMLOCK-INTERFACE:MARK)
   HEMLOCK-INTERFACE:MARK: #<error printing object>

  HI::CHARPOS: 102
  HI:LINE: #<BOGUS object @ #x300041A48ACD>

 (4427E0) : 9 (FUNCALL #'#<#<STANDARD-METHOD GUI::UPDATE-PAREN-HIGHLIGHT (GUI::HEMLOCK-TEXTSTORAGE-TEXT-VIEW)>> #<BOGUS object @ #x300041A48ACD>) 397
  (GUI::SELF)
   GUI::SELF: #<BOGUS object @ #x300041A48ACD>

  GUI::BUFFER: HI::CURRENT-LEFT-OPEN-POS
  HI::*CURRENT-BUFFER*: #<Hemlock Buffer "Listener">
  GUI::POINT: 102

 (442828) : 10 (FUNCALL #'#<GUI::|-[HemlockTextstorageTextView updateSelection:length:affinity:]|> 17591849975574) 933
  (#:G25332)
   #:G25332: 17591849975574

  #:G25348: #<A Foreign Pointer [stack-allocated] #x7FFF5FBFF8B0>
  #:G25333: #<A Foreign Pointer [stack-allocated] #x7FFF5FBFF8B0>
  #:COMPILER-VAR: (NIL)
  #:G25338: #<COMPILED-LEXICAL-CLOSURE (:INTERNAL GUI::|-[HemlockTextstorageTextView updateSelection:length:affinity:]|) #x49374F>
  #:G25349: (CONDITION #<COMPILED-LEXICAL-CLOSURE # #x49374F>)
  CCL::%HANDLERS%: ((CONDITION #) (CONDITION #) (ERROR))
  GUI::SELF: #<HEMLOCK-TEXT-VIEW <HemlockTextView: 0x1376b350>
    Frame = {{0.00, 0.00}, {570.00, 304.00}}, Bounds = {{0.00, 0.00}, {570.00, 304.00}}
    Horizontally resizable: NO, Vertically resizable: YES
    MinSize = {570.00, 224.00}, MaxSize = {10000000.00, 10000000.00}
 (#x1376B350)>
  GUI::_CMD: #<A Foreign Pointer #x1A3270>
  GUI::POS: 790
  LENGTH: 0
  GUI::AFFINITY: 1

 (4428A8) : 11 (%PASCAL-FUNCTIONS% 77 17591849975574) 397
  (CCL::INDEX CCL::ARGS-PTR-FIXNUM)
   CCL::INDEX: 77
   CCL::ARGS-PTR-FIXNUM: 17591849975574

  CCL::LISP-FUNCTION: #<Compiled-function GUI::|-[HemlockTextstorageTextView updateSelection:length:affinity:]| (Non-Global)  #x30004165317F>
  WITHOUT-INTERRUPTS: NIL
  CCL::*CALLBACK-TRACE-P*: NIL

 (442968) : 13 (FUNCALL #'#<Anonymous Function #x300041653EAF> #<HEMLOCK-TEXT-VIEW <HemlockTextView: 0x1376b350>
    Frame = {{0.00, 0.00}, {570.00, 304.00}}, Bounds = {{0.00, 0.00}, {570.00, 304.00}}
    Horizontally resizable: NO, Vertically resizable: YES
    MinSize = {570.00, 224.00}, MaxSize = {10000000.00, 10000000.00}
 (#x1376B350)> #S(CCL::OBJC-SELECTOR :NAME "updateSelection:length:affinity:" :%SEL #<A Foreign Pointer #x1A3270>) 790 0 1) 421
  (#:G28915 #:G28916 CCL::ARG0 CCL::ARG1 CCL::ARG2)
   #:G28915: #<HEMLOCK-TEXT-VIEW <HemlockTextView: 0x1376b350>
    Frame = {{0.00, 0.00}, {570.00, 304.00}}, Bounds = {{0.00, 0.00}, {570.00, 304.00}}
    Horizontally resizable: NO, Vertically resizable: YES
    MinSize = {570.00, 224.00}, MaxSize = {10000000.00, 10000000.00}
 (#x1376B350)>
   #:G28916: #S(CCL::OBJC-SELECTOR :NAME "updateSelection:length:affinity:" :%SEL #<A Foreign Pointer #x1A3270>)
   CCL::ARG0: 790
   CCL::ARG1: 0
   CCL::ARG2: 1



 (4429A0) : 14 (FUNCALL #'#<(:INTERNAL CCL::SEND-UNAMBIGUOUS-MESSAGE (SHARED-INITIALIZE :AFTER (CCL::OBJC-DISPATCH-FUNCTION T)))> #<HEMLOCK-TEXT-VIEW <HemlockTextView: 0x1376b350>
    Frame = {{0.00, 0.00}, {570.00, 304.00}}, Bounds = {{0.00, 0.00}, {570.00, 304.00}}
    Horizontally resizable: NO, Vertically resizable: YES
    MinSize = {570.00, 224.00}, MaxSize = {10000000.00, 10000000.00}
 (#x1376B350)> 790 0 1) 501
  (CCL::RECEIVER &REST CCL::ARGS)
   CCL::RECEIVER: #<HEMLOCK-TEXT-VIEW <HemlockTextView: 0x1376b350>
    Frame = {{0.00, 0.00}, {570.00, 304.00}}, Bounds = {{0.00, 0.00}, {570.00, 304.00}}
    Horizontally resizable: NO, Vertically resizable: YES
    MinSize = {570.00, 224.00}, MaxSize = {10000000.00, 10000000.00}
 (#x1376B350)>
   CCL::ARGS: (790 0 1)

  CCL::SELECTOR: #S(CCL::OBJC-SELECTOR :NAME "updateSelection:length:affinity:" :%SEL #<A Foreign Pointer #x1A3270>)
  FUNCTION: #<Anonymous Function #x300041653EAF>

 (4429E0) : 15 (FOR-EACH-TEXTVIEW-USING-STORAGE #<HEMLOCK-TEXT-STORAGE HemlockTextStorage : string <HemlockBufferString for #<Hemlock Buffer "Listener">> (#x1375F770)> #<COMPILED-LEXICAL-CLOSURE (:INTERNAL #) #x3000419C1EAF>) 429
  (GUI::TEXTSTORAGE GUI::F)
   GUI::TEXTSTORAGE: #<HEMLOCK-TEXT-STORAGE HemlockTextStorage : string <HemlockBufferString for #<Hemlock Buffer "Listener">> (#x1375F770)>
   GUI::F: #<COMPILED-LEXICAL-CLOSURE (:INTERNAL #) #x3000419C1EAF>

  GUI::LAYOUTS: #<NS-MUTABLE-ARRAY (
    <NSLayoutManager: 0x1376a120>
    1 containers, text backing has 790 characters
    selected character range {790, 0} affinity: upstream granularity: character
    marked character range {790, 0}
    Currently holding 790 glyphs.
    Glyph tree contents:  790 characters, 790 glyphs, 3 nodes, 192 node bytes, 704 storage bytes, 896 total bytes, 1.13 bytes per character, 1.13 bytes per glyph
    Layout tree contents:  790 characters, 790 glyphs, 688 laid glyphs, 18 laid line fragments, 3 nodes, 192 node bytes, 3104 storage bytes, 3296 total bytes, 4.17 bytes per character, 4.17 bytes per glyph, 38.22 laid glyphs per laid line fragment, 183.11 bytes per laid line fragment

) (#x1375F810)>
  #:G24748: 1
  GUI::I: 0
  GUI::LAYOUT: #<NS-LAYOUT-MANAGER <NSLayoutManager: 0x1376a120>
    1 containers, text backing has 790 characters
    selected character range {790, 0} affinity: upstream granularity: character
    marked character range {790, 0}
    Currently holding 790 glyphs.
    Glyph tree contents:  790 characters, 790 glyphs, 3 nodes, 192 node bytes, 704 storage bytes, 896 total bytes, 1.13 bytes per character, 1.13 bytes per glyph
    Layout tree contents:  790 characters, 790 glyphs, 688 laid glyphs, 18 laid line fragments, 3 nodes, 192 node bytes, 3104 storage bytes, 3296 total bytes, 4.17 bytes per character, 4.17 bytes per glyph, 38.22 laid glyphs per laid line fragment, 183.11 bytes per laid line fragment
 (#x1376A120)>
  GUI::CONTAINERS: #<NS-MUTABLE-ARRAY (
    <NSTextContainer: 0x1376a880>
) (#x137685B0)>
  #:G24750: 1
  GUI::J: 0
  GUI::CONTAINER: #<NS-TEXT-CONTAINER <NSTextContainer: 0x1376a880> (#x1376A880)>
  GUI::TV: #<HEMLOCK-TEXT-VIEW <HemlockTextView: 0x1376b350>
    Frame = {{0.00, 0.00}, {570.00, 304.00}}, Bounds = {{0.00, 0.00}, {570.00, 304.00}}
    Horizontally resizable: NO, Vertically resizable: YES
    MinSize = {570.00, 224.00}, MaxSize = {10000000.00, 10000000.00}
 (#x1376B350)>

 (442A50) : 16 (INVOKE-MODIFYING-BUFFER-STORAGE #<Hemlock Buffer "Listener"> #<COMPILED-LEXICAL-CLOSURE (:INTERNAL #) #x3000419C1F1F>) 277
  (GUI::BUFFER GUI::THUNK)
   GUI::BUFFER: #<Hemlock Buffer "Listener">
   GUI::THUNK: #<COMPILED-LEXICAL-CLOSURE (:INTERNAL #) #x3000419C1F1F>

  GUI::OLD: NIL

 (442A98) : 17 (FUNCALL #'#<#<STANDARD-METHOD HI::HANDLE-HEMLOCK-EVENT (HI:HEMLOCK-VIEW T)>> #<HI:HEMLOCK-VIEW #x30004196756D> #<COMPILED-LEXICAL-CLOSURE (:INTERNAL GUI::APPEND-OUTPUT) #x3000419C1FAF>) 925
  (HI::VIEW HI::KEY)
   HI::VIEW: #<HI:HEMLOCK-VIEW #x30004196756D>
   HI::KEY: #<COMPILED-LEXICAL-CLOSURE (:INTERNAL GUI::APPEND-OUTPUT) #x3000419C1FAF>

  #:ABORT-BREAK: #<RESTART ABORT-BREAK #x493ADD>
  #:ABORT: #<RESTART ABORT #x493A8D>
  #:G11576: (#<RESTART ABORT #x493A8D> #<RESTART ABORT-BREAK #x493ADD>)
  CCL::%RESTARTS%: ((#<# # #x493A8D> #<# # #x493ADD>))
  HI::*CURRENT-VIEW*: #<HI:HEMLOCK-VIEW #x30004196756D>
  HI::*CURRENT-BUFFER*: #<Hemlock Buffer "Listener">
  HI::*NEXT-VIEW-START*: NIL
  HI::TEXT-BUFFER: #<Hemlock Buffer "Listener">
  MOD: (69 688 . 688)

 (442B50) : 18 (%CALL-NEXT-METHOD (NIL #<STANDARD-METHOD HI::HANDLE-HEMLOCK-EVENT #> . 558482)) 1069
  (CCL::MAGIC &REST CCL::ARGS)
   CCL::MAGIC: (NIL #<STANDARD-METHOD HI::HANDLE-HEMLOCK-EVENT #> . 558482)
   CCL::ARGS: NIL

  CCL::NEXT-METHODS: (#<STANDARD-METHOD HI::HANDLE-HEMLOCK-EVENT #>)
  CCL::ARGS: 558482
  CDR: NIL
  METHOD-FUNCTION: #<METHOD-FUNCTION HI::HANDLE-HEMLOCK-EVENT (HI:HEMLOCK-VIEW T)>

 (442BD0) : 19 (FUNCALL #'#<#<STANDARD-METHOD HI::HANDLE-HEMLOCK-EVENT :AROUND (HI:HEMLOCK-VIEW T)>> #<HI:HEMLOCK-VIEW #x30004196756D> #<COMPILED-LEXICAL-CLOSURE (:INTERNAL GUI::APPEND-OUTPUT) #x3000419C1FAF>) 173
  (GUI::VIEW GUI::EVENT)
   GUI::VIEW: #<HI:HEMLOCK-VIEW #x30004196756D>
   GUI::EVENT: #<COMPILED-LEXICAL-CLOSURE (:INTERNAL GUI::APPEND-OUTPUT) #x3000419C1FAF>

  #:NEXT-METHOD-CONTEXT: (NIL #<STANDARD-METHOD HI::HANDLE-HEMLOCK-EVENT #> . 558482)
  #:G24986: #<NS-AUTORELEASE-POOL <NSAutoreleasePool: 0x11a120> (#x11A120)>






*** Error in event process: value #<BOGUS object @ #x300041A3F89D> is not of the expected type SIMPLE-VECTOR.

 (442B20) : 0 (FUNCALL #'#<(:INTERNAL GUI::|-[NSApplication invokeLispFunction:]|)> #<TYPE-ERROR #x300041A10A8D>) 149
  (#:G5385)
   #:G5385: #<TYPE-ERROR #x300041A10A8D>

  #:COMPILER-VAR: (NIL)
  #:G5382: #<A Foreign Pointer [stack-allocated] #x7FFF5FBFEBA0>

 (442B48) : 1 (SIGNAL #<TYPE-ERROR #x300041A10A8D>) 981
  (CONDITION &REST CCL::ARGS)
   CONDITION: #<TYPE-ERROR #x300041A10A8D>
   CCL::ARGS: NIL

  CCL::%HANDLERS%: ((ERROR) (ERROR))
  CCL::TAG: #<TYPE-ERROR #x300041A10A8D>
  CCL::HANDLERS: CCL::*BACKTRACE-CONTEXTS*
  CCL::FN: #<COMPILED-LEXICAL-CLOSURE (:INTERNAL GUI::|-[NSApplication invokeLispFunction:]|) #x493DBF>

 (442BA0) : 2 (%ERROR #<TYPE-ERROR #x300041A10A8D> NIL 558496) 117
  (CONDITION CCL::ARGS CCL::ERROR-POINTER)
   CONDITION: #<TYPE-ERROR #x300041A10A8D>
   CCL::ARGS: NIL
   CCL::ERROR-POINTER: 558496



 (442BC8) : 3 (FUNCALL #'#<(:INTERNAL CCL::%XERR-DISP)>) 4365
  NIL

  CCL::FRAME-PTR: 558496
  CCL::FN: #<Compiled-function CCL::ID-MAP-FREE-OBJECT #x300040491A0F>
  CCL::OP0: 205
  CCL::OP1: 215
  CCL::OP2: 182
  CCL::SKIP: -1
  CCL::TYPENAME: SIMPLE-VECTOR
  CCL::XP: #<A Foreign Pointer #x7FFF5FBFE8B0>
  CCL::XCF: #<A Foreign Pointer #x442D00>

 (442C20) : 4 (FUNCALL-WITH-ERROR-REENTRY-DETECTION #<COMPILED-LEXICAL-CLOSURE (:INTERNAL CCL::%XERR-DISP) #x493C5F>) 181
  (CCL::THUNK)
   CCL::THUNK: #<COMPILED-LEXICAL-CLOSURE (:INTERNAL CCL::%XERR-DISP) #x493C5F>

  COUNT: 0
  CCL::*ERROR-REENTRY-COUNT*: 0

 (442C60) : 5 (FUNCALL #'#<CCL::%XERR-DISP> 17591849974800) 493
  (#:G128953)
   #:G128953: 17591849974800

  #:G128963: #<A Foreign Pointer [stack-allocated] #x7FFF5FBFE080>
  CCL::XP: #<A Foreign Pointer #x7FFF5FBFE8B0>
  CCL::XCF: #<A Foreign Pointer #x442D00>
  #:G128964: #<COMPILED-LEXICAL-CLOSURE (:INTERNAL CCL::%XERR-DISP) #x493C5F>

 (442C98) : 6 (%PASCAL-FUNCTIONS% 2 17591849974800) 397
  (CCL::INDEX CCL::ARGS-PTR-FIXNUM)
   CCL::INDEX: 2
   CCL::ARGS-PTR-FIXNUM: 17591849974800

  CCL::LISP-FUNCTION: #<Compiled-function CCL::%XERR-DISP (Non-Global)  #x3000405CE2AF>
  WITHOUT-INTERRUPTS: NIL
  CCL::*CALLBACK-TRACE-P*: NIL

*(442D00) : 8 (ID-MAP-FREE-OBJECT #S(CCL::ID-MAP :VECTOR #<BOGUS object @ #x300041A3F89D> :FREE 2 ...) 1) 321
  (CCL::ID-MAP CCL::ID)
   CCL::ID-MAP: #S(CCL::ID-MAP :VECTOR #<BOGUS object @ #x300041A3F89D> :FREE 2 ...)
   CCL::ID: 1

  #:G124031: #<LOCK-ACQUISITION [status = T] #x493D3D>
  #:G124032: #<RECURSIVE-LOCK [ptr @ #x103000] #x3000412D48BD>
  VECTOR: #<BOGUS object @ #x300041A3F89D>

 (442DA8) : 9 (FUNCALL #'#<#<STANDARD-METHOD GUI::INVOKE-LISP-FUNCTION (NS:NS-APPLICATION T)>> #<LISP-APPLICATION <LispApplication: 0x1bec70> (#x1BEC70)> #<NS-NUMBER 1 (#x1A8370)>) 133
  (GUI::SELF GUI::ID)
   GUI::SELF: #<LISP-APPLICATION <LispApplication: 0x1bec70> (#x1BEC70)>
   GUI::ID: #<NS-NUMBER 1 (#x1A8370)>



 (442DD8) : 10 (FUNCALL #'#<GUI::|-[NSApplication invokeLispFunction:]|> 17591849975156) 869
  (#:G5381)
   #:G5381: 17591849975156

  #:G5397: #<A Foreign Pointer [stack-allocated] #x7FFF5FBFEBA0>
  #:G5382: #<A Foreign Pointer [stack-allocated] #x7FFF5FBFEBA0>
  #:COMPILER-VAR: (NIL)
  #:G5387: #<COMPILED-LEXICAL-CLOSURE (:INTERNAL GUI::|-[NSApplication invokeLispFunction:]|) #x493DBF>
  #:G5398: (CONDITION #<COMPILED-LEXICAL-CLOSURE # #x493DBF>)
  CCL::%HANDLERS%: ((CONDITION #) (ERROR))
  GUI::SELF: #<LISP-APPLICATION <LispApplication: 0x1bec70> (#x1BEC70)>
  GUI::_CMD: #<A Foreign Pointer #x1A0AB0>
  GUI::ID: #<NS-NUMBER 1 (#x1A8370)>

 (442E48) : 11 (%PASCAL-FUNCTIONS% 13 17591849975156) 397
  (CCL::INDEX CCL::ARGS-PTR-FIXNUM)
   CCL::INDEX: 13
   CCL::ARGS-PTR-FIXNUM: 17591849975156

  CCL::LISP-FUNCTION: #<Compiled-function GUI::|-[NSApplication invokeLispFunction:]| (Non-Global)  #x3000412D3E6F>
  WITHOUT-INTERRUPTS: NIL
  CCL::*CALLBACK-TRACE-P*: NIL

 (442F08) : 13 (FUNCALL #'#<Anonymous Function #x3000412008BF> #<LISP-APPLICATION <LispApplication: 0x1bec70> (#x1BEC70)> #S(CCL::OBJC-SELECTOR :NAME "run" :%SEL #<A Foreign Pointer #x7FFF83218D68>)) 205
  (#:G3072 #:G3073)
   #:G3072: #<LISP-APPLICATION <LispApplication: 0x1bec70> (#x1BEC70)>
   #:G3073: #S(CCL::OBJC-SELECTOR :NAME "run" :%SEL #<A Foreign Pointer #x7FFF83218D68>)



 (442F28) : 14 (FUNCALL #'#<(:INTERNAL CCL::SEND-UNAMBIGUOUS-MESSAGE (SHARED-INITIALIZE :AFTER (CCL::OBJC-DISPATCH-FUNCTION T)))> #<LISP-APPLICATION <LispApplication: 0x1bec70> (#x1BEC70)>) 501
  (CCL::RECEIVER &REST CCL::ARGS)
   CCL::RECEIVER: #<LISP-APPLICATION <LispApplication: 0x1bec70> (#x1BEC70)>
   CCL::ARGS: NIL

  CCL::SELECTOR: #S(CCL::OBJC-SELECTOR :NAME "run" :%SEL #<A Foreign Pointer #x7FFF83218D68>)
  FUNCTION: #<Anonymous Function #x3000412008BF>

 (442F68) : 15 (EVENT-LOOP NIL) 413
  (&OPTIONAL GUI::END-TEST)
   GUI::END-TEST: NIL

  GUI::APP: #<LISP-APPLICATION <LispApplication: 0x1bec70> (#x1BEC70)>
  *BREAK-ON-ERRORS*: NIL
  #:G7500: (ERROR)
  CCL::%HANDLERS%: ((ERROR))
  GUI::*EVENT-PROCESS-REPORTED-CONDITIONS*: (#<TYPE-ERROR #x300041A10A8D> #<TYPE-ERROR #x3000419FFE6D>)

Change History

comment:1 Changed 6 years ago by gb

  • Owner changed from gz to gb
  • Status changed from new to assigned
  • Component changed from IDE to Runtime (threads, GC)

comment:2 Changed 6 years ago by gb

  • Description modified (diff)

comment:3 Changed 6 years ago by gb

I've been able to reproduce this (less often and less reliably) in the command-line lisp; invoking the GC (with integrity-checking enabled) soon after the allocation complains about at least one missing EGC memoization, and that'll eventually lead to a bogus object being referenced or some other symptom.

comment:4 Changed 6 years ago by raffael cavallaro

Off and on in recent svn updates this problem has gone away in the IDE and reappeared.

It is currently (1.3-RC1-r11918M x8632 and x8664) not manifesting in the IDE in certain circumstances.

This also varies depending on whether I try this immediately on starting the IDE or after loading and running some other code (specifically code that tests multiple threads concurrently modifying a static hash table while holding a lock for that hash table). The array issue will manifest if it's the first thing I run, but won't manifest if I run the concurrent hash-table test code first.

I don't expect this will provide any specific insights, but on the off chance it might mean something to someone intimately familiar with the runtime I thought I'd mention it.

comment:5 Changed 6 years ago by gb

I think that I just fixed this in the trunk; if the fix doesn't break anything, I'll propagate it to 1.3.

There's a global bitvector that contains a bit for every pair of words in the lisp heap; among other things, it's used to track cases where an "old" object is destructively modified (via SETF) so that it references a recently-allocated object. On the assumption that most objects die young, the EGC tries to determine which young objects are referenced; it can generally do this without looking at the (potentially much larger) set of old objects, but does need to reliably know which old objects reference new ones, and destructive operations (SETF) have to reliably maintain the bitvector that identifies these old-to-young references.

When the lisp heap grows (acquires more memory from the OS), the bitvector may need to become larger. Unfortunately, the code that grows the bitvector has had the unintended size-effect of clearing the bitvector, causing information about these old-to-young references to be lost. The next time the EGC runs, it may decide that some young object is garbage because nothing seems to reference it (when in fact some old object does); the young object gets freed, and the old object points at something random; this can lead to unpredictable and bizarre crashes and errors.

Allocating a large (relative to the size of the heap) vector generally involves obtaining more memory from the OS and growing the auxiliary data structures (like this bitvector); if growing the bitvector has the unfortunate side-effect of zeroing it, then the next EGC will likely miss old-to-young references and cause some sort of crash.

In a lisp where the crash can occur, doing:

? (egc nil) ; turn off EGC
NIL
? (atest 7)

shouldn't cause a crash (if this theory explains things correctly.) With the EGC on (as it is by default), whether or not clearing the bitvector caused a crash immediately or did so later wasn't entirely predictable; it would likely cause some old object to refer to garbage, but whether or not that mattered depended on what the object(s) in question are and how real the garbage appeared to be.

comment:6 Changed 5 years ago by rme

  • Status changed from assigned to closed
  • Resolution set to fixed

This is fixed in the trunk in r11952, and in the 1.3 branch in r11955.

Note: See TracTickets for help on using tickets.