title: ==44088==ERROR: AddressSanitizer: stack-buffer-overflow
body: <p>My project is swift-only (for the code I wrote, at least). At the start of the app, I download some json to show content. I deserialize this content with <code>swift 4 Coder protocol</code>. This has worked for some time, but just now I got an unexpected stack-buffer-overflow error:</p>
  
  <p><code>==44088==ERROR: AddressSanitizer: stack-buffer-overflow</code></p>
  
  <p>while deserializing one of the objects, in one of the background threads.</p>
  
  <p>Based on this, <strong>I have 2 questions</strong>:</p>
  
  <p>How can I ensure this doesn't happen again? </p>
  
  <p>Is there a way to reproduce it?</p>
  
  <p><em>More info:</em> </p>
  
  <p>I have this summary, but I'm not sure what to make of it:</p>
  
  <p><code>SUMMARY: AddressSanitizer: stack-buffer-overflow JsonClass.swift in _T06MyApp11JsonClassVACs7Decoder_p4from_tKcfC
  Shadow bytes around the buggy address:
    0x100026a904d0: 00 02 f2 f2 f2 f2 f2 f2 f2 f2 00 00 00 00 00 00
    0x100026a904e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x100026a904f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x100026a90500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x100026a90510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  =&gt;0x100026a90520: 00 00 00 00 00 00 00 00 00 00 00 00 00 00[f2]f2
    0x100026a90530: f2 f2 f2 f2 f2 f2 f2 f2 f2 f2 f2 f2 f2 f2 00 00
    0x100026a90540: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x100026a90550: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x100026a90560: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x100026a90570: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  Shadow byte legend (one shadow byte represents 8 application bytes):
    Addressable:           00
    Partially addressable: 01 02 03 04 05 06 07 
    Heap left redzone:       fa
    Freed heap region:       fd
    Stack left redzone:      f1
    Stack mid redzone:       f2
    Stack right redzone:     f3
    Stack after return:      f5
    Stack use after scope:   f8
    Global redzone:          f9
    Global init order:       f6
    Poisoned by user:        f7
    Container overflow:      fc
    Array cookie:            ac
    Intra object redzone:    bb
    ASan internal:           fe
    Left alloca redzone:     ca
    Right alloca redzone:    cb
  </code></p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>It reproduced every time (in the simulator). Then I cleaned the build and deleted the derived data folder and it didn't happen since. I'd still like to know if I need to worry for a bug in production...</p>