Uploaded image for project: 'Project Quay'
  1. Project Quay
  2. PROJQUAY-5842

Clair crashes during image scan

XMLWordPrintable

    • False
    • None
    • False
    • Quay Enterprise

      Clair version 4.6.1. We observe the following go stack during image scanning:

      ...
      {"level":"debug","version":"v0.0.1","scanner":"aws","state":"ScanLayers","layer":"sha256:8f4be489d1eec07c5da9986d18c5feed964729e9b7615d63ca0576b22d4e4c0b","manifest":"sha256:b60f78ec46e6a30379084c112049b2faad70bc766dc2c753df80b8201c73ec54","kind":"distribution","request_id":"e6e500899ef1bf62","name":"aws","component":"aws_dist_scanner","time":"2023-07-18T13:40:50Z","message":"start"}
      {"level":"debug","version":"1","manifest":"sha256:b60f78ec46e6a30379084c112049b2faad70bc766dc2c753df80b8201c73ec54","layer":"sha256:8f4be489d1eec07c5da9986d18c5feed964729e9b7615d63ca0576b22d4e4c0b","component":"gobin/Detector.Scan","state":"ScanLayers","scanner":"gobin","request_id":"e6e500899ef1bf62","kind":"package","time":"2023-07-18T13:40:50Z","message":"done"}
      {"level":"debug","request_id":"e6e500899ef1bf62","kind":"package","layer":"sha256:8f4be489d1eec07c5da9986d18c5feed964729e9b7615d63ca0576b22d4e4c0b","manifest":"sha256:b60f78ec46e6a30379084c112049b2faad70bc766dc2c753df80b8201c73ec54","state":"ScanLayers","component":"indexer/layerscannner/layerScanner.scan","scanner":"gobin","time":"2023-07-18T13:40:50Z","message":"scan done"}
      panic: runtime error: slice bounds out of range [:-4606900943835742192]
      
      goroutine 10719 [running]:
      io.(*SectionReader).Read(0x0?, {0xc0008520a8?, 0xc00733a898?, 0x456832?})
              io/io.go:510 +0x8c
      io.ReadAtLeast({0x13626e0, 0xc005e11e00}, {0xc0008520a8, 0x18, 0x18}, 0x18)
              io/io.go:331 +0x9a
      io.ReadFull(...)
              io/io.go:350
      encoding/binary.Read({0x13626e0, 0xc005e11e00}, {0x1370be8, 0x1bf4a78}, {0xfd3840?, 0xc000852090})
              encoding/binary/binary.go:256 +0xc3e
      debug/elf.NewFile({0x1362700?, 0xc005e11da0})
              debug/elf/file.go:441 +0x1073
      debug/buildinfo.readRawBuildInfo({0x1362700, 0xc005e11da0})
              debug/buildinfo/buildinfo.go:110 +0xea
      debug/buildinfo.Read({0x1362700?, 0xc005e11da0?})
              debug/buildinfo/buildinfo.go:74 +0x27
      github.com/quay/claircore/gobin.toPackages({0x136bb20, 0xc005e11d40}, 0xc0005cfa88, {0xc008c8a300, 0x60}, {0x1362700?, 0xc005e11da0?})
              github.com/quay/claircore@v1.4.21/gobin/exe.go:24 +0x69
      github.com/quay/claircore/gobin.Detector.Scan.func1({0xc008c8a300, 0x60}, {0x136d918, 0xc001b509a0}, {0x0, 0x0})
              github.com/quay/claircore@v1.4.21/gobin/gobin.go:138 +0x7d3
      io/fs.walkDir({0x13619e0, 0xc005ea46c0}, {0xc008c8a300, 0x60}, {0x136d918, 0xc001b509a0}, 0xc0005cfb28)
              io/fs/walk.go:66 +0x78
      io/fs.walkDir({0x13619e0, 0xc005ea46c0}, {0xc008c8a1e0, 0x58}, {0x136d918, 0xc001b507e0}, 0xc0005cfb28)
              io/fs/walk.go:85 +0x27d
      io/fs.walkDir({0x13619e0, 0xc005ea46c0}, {0xc008c8a120, 0x52}, {0x136d918, 0xc001b50700}, 0xc0005cfb28)
              io/fs/walk.go:85 +0x27d
      io/fs.walkDir({0x13619e0, 0xc005ea46c0}, {0xc001b5c230, 0x47}, {0x136d918, 0xc001b50620}, 0xc0005cfb28)
              io/fs/walk.go:85 +0x27d
      io/fs.walkDir({0x13619e0, 0xc005ea46c0}, {0xc001b5c0f0, 0x42}, {0x136d918, 0xc001b50540}, 0xc0005cfb28)
              io/fs/walk.go:85 +0x27d
      io/fs.walkDir({0x13619e0, 0xc005ea46c0}, {0xc00194b880, 0x38}, {0x136d918, 0xc001b50460}, 0xc0005cfb28)
              io/fs/walk.go:85 +0x27d
      io/fs.walkDir({0x13619e0, 0xc005ea46c0}, {0xc005e755c0, 0x2d}, {0x136d918, 0xc001b08ee0}, 0xc0005cfb28)
              io/fs/walk.go:85 +0x27d
      io/fs.walkDir({0x13619e0, 0xc005ea46c0}, {0xc005e75470, 0x25}, {0x136d918, 0xc001b08d20}, 0xc0005cfb28)
              io/fs/walk.go:85 +0x27d
      io/fs.walkDir({0x13619e0, 0xc005ea46c0}, {0xc003eb2de0, 0x1f}, {0x136d918, 0xc0015f3ea0}, 0xc0005cfb28)
              io/fs/walk.go:85 +0x27d
      io/fs.walkDir({0x13619e0, 0xc005ea46c0}, {0xc018921218, 0x14}, {0x136d918, 0xc0017757a0}, 0xc0005cfb28)
              io/fs/walk.go:85 +0x27d
      io/fs.walkDir({0x13619e0, 0xc005ea46c0}, {0xc0021fbbb0, 0x7}, {0x136d918, 0xc00176c0e0}, 0xc0005cfb28)
              io/fs/walk.go:85 +0x27d
      io/fs.walkDir({0x13619e0, 0xc005ea46c0}, {0xc0021fbb7a, 0x3}, {0x136d918, 0xc00176c000}, 0xc0005cfb28)
              io/fs/walk.go:85 +0x27d
      io/fs.walkDir({0x13619e0, 0xc005ea46c0}, {0x11811ae, 0x1}, {0x136d640, 0xc000f02200}, 0xc0005cfb28)
              io/fs/walk.go:85 +0x27d
      io/fs.WalkDir({0x13619e0, 0xc005ea46c0}, {0x11811ae, 0x1}, 0xc00733bb28)
              io/fs/walk.go:112 +0xde
      github.com/quay/claircore/gobin.Detector.Scan({}, {0x136bb20, 0xc009e4f9b0}, 0xc01012cde0)
              github.com/quay/claircore@v1.4.21/gobin/gobin.go:140 +0x4e5
      github.com/quay/claircore/indexer/layerscanner.(*result).Do(0xc0005cfdf0, {0x136bb20, 0xc009e4f9b0}, {0x7efe780a6b80?, 0x1bf4a78}, 0xc0006ce870?)
              github.com/quay/claircore@v1.4.21/indexer/layerscanner/layerscanner.go:232 +0x9d
      github.com/quay/claircore/indexer/layerscanner.(*layerScanner).scanLayer(0xc0063d96e0, {0x136ba78, 0xc0008c0300}, 0xc01012cde0, {0x7efe780a6b80, 0x1bf4a78})
              github.com/quay/claircore@v1.4.21/indexer/layerscanner/layerscanner.go:207 +0x3cd
      github.com/quay/claircore/indexer/layerscanner.(*layerScanner).Scan.func1.1()
              github.com/quay/claircore@v1.4.21/indexer/layerscanner/layerscanner.go:163 +0x10a
      golang.org/x/sync/errgroup.(*Group).Go.func1()
              golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
      created by golang.org/x/sync/errgroup.(*Group).Go
              golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5
      
      # cat clair.lo | grep -i version | head
      {"level":"info","component":"main","version":"v4.6.1 (user)","time":"2023-07-10T18:16:00Z","message":"starting"}
      {"level":"info","component":"main","version":"v4.6.1 (user)","time":"2023-07-10T18:16:00Z","message":"ready"}
      ...
      

      Can you please check this? Thank you!

        1. image-2023-08-02-14-47-39-400.png
          304 kB
          luffy zhang
        2. Quay3811_Clair_App_pod1.logs
          469 kB
          luffy zhang
        3. Quay3811_Clair_App_pod2.logs
          475 kB
          luffy zhang

              jcroslan@redhat.com Joseph Crosland
              rhn-support-ibazulic Ivan Bazulic
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved: