Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2157

Detect bit alignment issues when using "sync/atomic" to access struct fields

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Unknown Unknown
    • None
    • None
    • None
    • None

    Description

      Find a way to detect runtime errors like

      panic: unaligned 64-bit atomic operation [recovered]
      

      during a CI run. Those errors can happen when you run the mongo-go-driver on certain 32-bit architectures (e.g. some 32-bit ARM platforms). Some static analysis tools, like `go vet`, may provide a checker for 64-bit alignment atomically-accessed struct fields.

      See PR #723 for the original context of this improvement.

      See this article for more information on memory alignment in Go.

      Attachments

        Activity

          People

            Unassigned Unassigned
            matt.dale@mongodb.com Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: