pb33f / libopenapi

libopenapi is a fully featured, high performance OpenAPI 3.1, 3.0 and Swagger parser, library, validator and toolkit for golang applications.
https://pb33f.io/libopenapi/
Other
482 stars 64 forks source link

Data Race using GetAllComponentSchemas #333

Closed califlower closed 3 weeks ago

califlower commented 1 month ago
WARNING: DATA RACE
Read at 0x00c0001f82d0 by goroutine 104:
  github.com/pb33f/libopenapi/index.(*SpecIndex).GetAllComponentSchemas()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/index/spec_index.go:331 +0x38
  github.com/pb33f/libopenapi/index.(*SpecIndex).GetAllComponentSchemas-fm()
      <autogenerated>:1 +0x34
  github.com/pb33f/libopenapi/datamodel/low.LocateRefNodeWithContext()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:88 +0x434
  github.com/pb33f/libopenapi/datamodel/low/base.ExtractSchema()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/base/schema.go:1287 +0x320
  github.com/pb33f/libopenapi/datamodel/low/v3.(*MediaType).Build()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/media_type.go:95 +0x464
  github.com/pb33f/libopenapi/datamodel/low.ExtractMapExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.e114033d8920fd47cda95878864a7bac19629718fa4165c8b0cecc0ea9ec74d0].func3()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:760 +0x200
  github.com/pb33f/libopenapi/datamodel.TranslatePipeline[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.label *gopkg.in/yaml%2ev3.Node; github.com/pb33f/libopenapi/datamodel/low.value *gopkg.in/yaml%2ev3.Node },go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.k github.com/pb33f/libopenapi/datamodel/low.KeyReference[string]; github.com/pb33f/libopenapi/datamodel/low.v github.com/pb33f/libopenapi/datamodel/low.ValueReference[go.shape.*uint8] }].func1()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:237 +0x158

Previous write at 0x00c0001f82d0 by goroutine 103:
  github.com/pb33f/libopenapi/index.(*SpecIndex).GetAllComponentSchemas()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/index/spec_index.go:335 +0x88
  github.com/pb33f/libopenapi/index.(*SpecIndex).GetAllComponentSchemas-fm()
      <autogenerated>:1 +0x34
  github.com/pb33f/libopenapi/datamodel/low.LocateRefNodeWithContext()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:88 +0x434
  github.com/pb33f/libopenapi/datamodel/low/base.ExtractSchema()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/base/schema.go:1287 +0x320
  github.com/pb33f/libopenapi/datamodel/low/v3.(*MediaType).Build()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/media_type.go:95 +0x464
  github.com/pb33f/libopenapi/datamodel/low.ExtractMapExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.e114033d8920fd47cda95878864a7bac19629718fa4165c8b0cecc0ea9ec74d0].func3()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:760 +0x200
  github.com/pb33f/libopenapi/datamodel.TranslatePipeline[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.label *gopkg.in/yaml%2ev3.Node; github.com/pb33f/libopenapi/datamodel/low.value *gopkg.in/yaml%2ev3.Node },go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.k github.com/pb33f/libopenapi/datamodel/low.KeyReference[string]; github.com/pb33f/libopenapi/datamodel/low.v github.com/pb33f/libopenapi/datamodel/low.ValueReference[go.shape.*uint8] }].func1()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:237 +0x158

Goroutine 104 (running) created at:
  github.com/pb33f/libopenapi/datamodel.TranslatePipeline[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.label *gopkg.in/yaml%2ev3.Node; github.com/pb33f/libopenapi/datamodel/low.value *gopkg.in/yaml%2ev3.Node },go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.k github.com/pb33f/libopenapi/datamodel/low.KeyReference[string]; github.com/pb33f/libopenapi/datamodel/low.v github.com/pb33f/libopenapi/datamodel/low.ValueReference[go.shape.*uint8] }]()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:229 +0x1f8
  github.com/pb33f/libopenapi/datamodel/low.ExtractMapExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.e114033d8920fd47cda95878864a7bac19629718fa4165c8b0cecc0ea9ec74d0]()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:784 +0x7fc
  github.com/pb33f/libopenapi/datamodel/low.ExtractMap[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.e114033d8920fd47cda95878864a7bac19629718fa4165c8b0cecc0ea9ec74d0]()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:808 +0x6c
  github.com/pb33f/libopenapi/datamodel/low/v3.(*Response).Build()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/response.go:98 +0x4b4
  github.com/pb33f/libopenapi/datamodel/low.ExtractMapNoLookupExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.Response,go.shape.38795c49b0b56c38094fe7b8729da3508f378b9c4dcf83d2d2435e8d7636f8c1]()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:560 +0x8ac
  github.com/pb33f/libopenapi/datamodel/low.ExtractMapNoLookup[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.Response,go.shape.38795c49b0b56c38094fe7b8729da3508f378b9c4dcf83d2d2435e8d7636f8c1]()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:600 +0x410
  github.com/pb33f/libopenapi/datamodel/low/v3.(*Responses).Build()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/responses.go:73 +0x3e4
  github.com/pb33f/libopenapi/datamodel/low.ExtractObject[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.Responses,go.shape.176fa657fb0d690598bd054a3236d7039b8631a7517ee26c190be22c854721c4]()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:330 +0x3a4
  github.com/pb33f/libopenapi/datamodel/low/v3.(*Operation).Build()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/operation.go:125 +0x748
  github.com/pb33f/libopenapi/datamodel/low/v3.(*PathItem).Build.func1()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/path_item.go:294 +0xd8
  github.com/pb33f/libopenapi/datamodel.TranslateSliceParallel[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.Reference; Value *github.com/pb33f/libopenapi/datamodel/low/v3.Operation; ValueNode *gopkg.in/yaml%2ev3.Node; KeyNode *gopkg.in/yaml%2ev3.Node; Context context.Context },go.shape.interface {}].func1.2()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:77 +0xe8
  github.com/pb33f/libopenapi/datamodel.TranslateSliceParallel[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.Reference; Value *github.com/pb33f/libopenapi/datamodel/low/v3.Operation; ValueNode *gopkg.in/yaml%2ev3.Node; KeyNode *gopkg.in/yaml%2ev3.Node; Context context.Context },go.shape.interface {}].func1.gowrap1()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:93 +0xb4

Goroutine 103 (finished) created at:
  github.com/pb33f/libopenapi/datamodel.TranslatePipeline[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.label *gopkg.in/yaml%2ev3.Node; github.com/pb33f/libopenapi/datamodel/low.value *gopkg.in/yaml%2ev3.Node },go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.k github.com/pb33f/libopenapi/datamodel/low.KeyReference[string]; github.com/pb33f/libopenapi/datamodel/low.v github.com/pb33f/libopenapi/datamodel/low.ValueReference[go.shape.*uint8] }]()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:229 +0x1f8
  github.com/pb33f/libopenapi/datamodel/low.ExtractMapExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.e114033d8920fd47cda95878864a7bac19629718fa4165c8b0cecc0ea9ec74d0]()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:784 +0x7fc
  github.com/pb33f/libopenapi/datamodel/low.ExtractMap[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.e114033d8920fd47cda95878864a7bac19629718fa4165c8b0cecc0ea9ec74d0]()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:808 +0x6c
  github.com/pb33f/libopenapi/datamodel/low/v3.(*RequestBody).Build()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/request_body.go:69 +0x2bc
  github.com/pb33f/libopenapi/datamodel/low.ExtractObject[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.RequestBody,go.shape.bc414445d4b16e54b53aee4fbe859f1a617373c01915950e74670aeaa82d2bf3]()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:330 +0x3a4
  github.com/pb33f/libopenapi/datamodel/low/v3.(*Operation).Build()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/operation.go:107 +0x4e8
  github.com/pb33f/libopenapi/datamodel/low/v3.(*PathItem).Build.func1()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/path_item.go:294 +0xd8
  github.com/pb33f/libopenapi/datamodel.TranslateSliceParallel[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.Reference; Value *github.com/pb33f/libopenapi/datamodel/low/v3.Operation; ValueNode *gopkg.in/yaml%2ev3.Node; KeyNode *gopkg.in/yaml%2ev3.Node; Context context.Context },go.shape.interface {}].func1.2()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:77 +0xe8
  github.com/pb33f/libopenapi/datamodel.TranslateSliceParallel[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.Reference; Value *github.com/pb33f/libopenapi/datamodel/low/v3.Operation; ValueNode *gopkg.in/yaml%2ev3.Node; KeyNode *gopkg.in/yaml%2ev3.Node; Context context.Context },go.shape.interface {}].func1.gowrap1()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:93 +0xb4
==================
==================
WARNING: DATA RACE
Read at 0x00c00032e210 by goroutine 104:
  runtime.evacuate_fast64()
      /nix/store/4cijk6gwv59c84h1l9yhxzsaz93f67mz-go-1.23.0/share/go/src/runtime/map_fast64.go:407 +0x3dc
  github.com/pb33f/libopenapi/datamodel/low.LocateRefNodeWithContext()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:89 +0x45c
  github.com/pb33f/libopenapi/datamodel/low/base.ExtractSchema()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/base/schema.go:1287 +0x320
  github.com/pb33f/libopenapi/datamodel/low/v3.(*MediaType).Build()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/media_type.go:95 +0x464
  github.com/pb33f/libopenapi/datamodel/low.ExtractMapExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.e114033d8920fd47cda95878864a7bac19629718fa4165c8b0cecc0ea9ec74d0].func3()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:760 +0x200
  github.com/pb33f/libopenapi/datamodel.TranslatePipeline[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.label *gopkg.in/yaml%2ev3.Node; github.com/pb33f/libopenapi/datamodel/low.value *gopkg.in/yaml%2ev3.Node },go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.k github.com/pb33f/libopenapi/datamodel/low.KeyReference[string]; github.com/pb33f/libopenapi/datamodel/low.v github.com/pb33f/libopenapi/datamodel/low.ValueReference[go.shape.*uint8] }].func1()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:237 +0x158

Previous write at 0x00c00032e210 by goroutine 103:
  runtime.mapaccess2_faststr()
      /nix/store/4cijk6gwv59c84h1l9yhxzsaz93f67mz-go-1.23.0/share/go/src/runtime/map_faststr.go:117 +0x42c
  github.com/pb33f/libopenapi/index.syncMapToMap[go.shape.string,go.shape.*uint8].func1()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/index/utility_methods.go:578 +0xb0
  sync.(*Map).Range()
      /nix/store/4cijk6gwv59c84h1l9yhxzsaz93f67mz-go-1.23.0/share/go/src/sync/map.go:501 +0x190
  github.com/pb33f/libopenapi/index.syncMapToMap[go.shape.string,go.shape.*uint8]()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/index/utility_methods.go:577 +0x7c
  github.com/pb33f/libopenapi/index.(*SpecIndex).GetAllComponentSchemas()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/index/spec_index.go:334 +0x70
  github.com/pb33f/libopenapi/index.(*SpecIndex).GetAllComponentSchemas-fm()
      <autogenerated>:1 +0x34
  github.com/pb33f/libopenapi/datamodel/low.LocateRefNodeWithContext()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:88 +0x434
  github.com/pb33f/libopenapi/datamodel/low/base.ExtractSchema()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/base/schema.go:1287 +0x320
  github.com/pb33f/libopenapi/datamodel/low/v3.(*MediaType).Build()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/media_type.go:95 +0x464
  github.com/pb33f/libopenapi/datamodel/low.ExtractMapExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.e114033d8920fd47cda95878864a7bac19629718fa4165c8b0cecc0ea9ec74d0].func3()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:760 +0x200
  github.com/pb33f/libopenapi/datamodel.TranslatePipeline[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.label *gopkg.in/yaml%2ev3.Node; github.com/pb33f/libopenapi/datamodel/low.value *gopkg.in/yaml%2ev3.Node },go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.k github.com/pb33f/libopenapi/datamodel/low.KeyReference[string]; github.com/pb33f/libopenapi/datamodel/low.v github.com/pb33f/libopenapi/datamodel/low.ValueReference[go.shape.*uint8] }].func1()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:237 +0x158

Goroutine 104 (running) created at:
  github.com/pb33f/libopenapi/datamodel.TranslatePipeline[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.label *gopkg.in/yaml%2ev3.Node; github.com/pb33f/libopenapi/datamodel/low.value *gopkg.in/yaml%2ev3.Node },go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.k github.com/pb33f/libopenapi/datamodel/low.KeyReference[string]; github.com/pb33f/libopenapi/datamodel/low.v github.com/pb33f/libopenapi/datamodel/low.ValueReference[go.shape.*uint8] }]()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:229 +0x1f8
  github.com/pb33f/libopenapi/datamodel/low.ExtractMapExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.e114033d8920fd47cda95878864a7bac19629718fa4165c8b0cecc0ea9ec74d0]()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:784 +0x7fc
  github.com/pb33f/libopenapi/datamodel/low.ExtractMap[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.e114033d8920fd47cda95878864a7bac19629718fa4165c8b0cecc0ea9ec74d0]()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:808 +0x6c
  github.com/pb33f/libopenapi/datamodel/low/v3.(*Response).Build()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/response.go:98 +0x4b4
  github.com/pb33f/libopenapi/datamodel/low.ExtractMapNoLookupExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.Response,go.shape.38795c49b0b56c38094fe7b8729da3508f378b9c4dcf83d2d2435e8d7636f8c1]()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:560 +0x8ac
  github.com/pb33f/libopenapi/datamodel/low.ExtractMapNoLookup[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.Response,go.shape.38795c49b0b56c38094fe7b8729da3508f378b9c4dcf83d2d2435e8d7636f8c1]()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:600 +0x410
  github.com/pb33f/libopenapi/datamodel/low/v3.(*Responses).Build()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/responses.go:73 +0x3e4
  github.com/pb33f/libopenapi/datamodel/low.ExtractObject[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.Responses,go.shape.176fa657fb0d690598bd054a3236d7039b8631a7517ee26c190be22c854721c4]()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:330 +0x3a4
  github.com/pb33f/libopenapi/datamodel/low/v3.(*Operation).Build()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/operation.go:125 +0x748
  github.com/pb33f/libopenapi/datamodel/low/v3.(*PathItem).Build.func1()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/path_item.go:294 +0xd8
  github.com/pb33f/libopenapi/datamodel.TranslateSliceParallel[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.Reference; Value *github.com/pb33f/libopenapi/datamodel/low/v3.Operation; ValueNode *gopkg.in/yaml%2ev3.Node; KeyNode *gopkg.in/yaml%2ev3.Node; Context context.Context },go.shape.interface {}].func1.2()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:77 +0xe8
  github.com/pb33f/libopenapi/datamodel.TranslateSliceParallel[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.Reference; Value *github.com/pb33f/libopenapi/datamodel/low/v3.Operation; ValueNode *gopkg.in/yaml%2ev3.Node; KeyNode *gopkg.in/yaml%2ev3.Node; Context context.Context },go.shape.interface {}].func1.gowrap1()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:93 +0xb4

Goroutine 103 (finished) created at:
  github.com/pb33f/libopenapi/datamodel.TranslatePipeline[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.label *gopkg.in/yaml%2ev3.Node; github.com/pb33f/libopenapi/datamodel/low.value *gopkg.in/yaml%2ev3.Node },go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.k github.com/pb33f/libopenapi/datamodel/low.KeyReference[string]; github.com/pb33f/libopenapi/datamodel/low.v github.com/pb33f/libopenapi/datamodel/low.ValueReference[go.shape.*uint8] }]()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:229 +0x1f8
  github.com/pb33f/libopenapi/datamodel/low.ExtractMapExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.e114033d8920fd47cda95878864a7bac19629718fa4165c8b0cecc0ea9ec74d0]()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:784 +0x7fc
  github.com/pb33f/libopenapi/datamodel/low.ExtractMap[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.e114033d8920fd47cda95878864a7bac19629718fa4165c8b0cecc0ea9ec74d0]()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:808 +0x6c
  github.com/pb33f/libopenapi/datamodel/low/v3.(*RequestBody).Build()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/request_body.go:69 +0x2bc
  github.com/pb33f/libopenapi/datamodel/low.ExtractObject[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.RequestBody,go.shape.bc414445d4b16e54b53aee4fbe859f1a617373c01915950e74670aeaa82d2bf3]()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:330 +0x3a4
  github.com/pb33f/libopenapi/datamodel/low/v3.(*Operation).Build()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/operation.go:107 +0x4e8
  github.com/pb33f/libopenapi/datamodel/low/v3.(*PathItem).Build.func1()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/path_item.go:294 +0xd8
  github.com/pb33f/libopenapi/datamodel.TranslateSliceParallel[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.Reference; Value *github.com/pb33f/libopenapi/datamodel/low/v3.Operation; ValueNode *gopkg.in/yaml%2ev3.Node; KeyNode *gopkg.in/yaml%2ev3.Node; Context context.Context },go.shape.interface {}].func1.2()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:77 +0xe8
  github.com/pb33f/libopenapi/datamodel.TranslateSliceParallel[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.Reference; Value *github.com/pb33f/libopenapi/datamodel/low/v3.Operation; ValueNode *gopkg.in/yaml%2ev3.Node; KeyNode *gopkg.in/yaml%2ev3.Node; Context context.Context },go.shape.interface {}].func1.gowrap1()
      /Users/<hidden>/Documents/edge-projects/rest-proxy/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:93 +0xb4

Can be unreliably triggered by SearchIndexForReference in a loop? But I think there needs to be a lock of some sort on SpecIndex. I assume multiple threads are checking if they're null, then initializing them. I can submit a PR if needed

califlower commented 1 month ago

This is still an issue in 0.18.4 and wasn't fixed by the data race fix release. Throwing in the log in case there's any differences


WARNING: DATA RACE
--
  | Read at 0x00c0001fc2d0 by goroutine 625:
  | github.com/pb33f/libopenapi/index.(*SpecIndex).GetAllComponentSchemas()
  | /workdir/vendor/github.com/pb33f/libopenapi/index/spec_index.go:331 +0x44
  | github.com/pb33f/libopenapi/index.(*SpecIndex).GetAllComponentSchemas-fm()
  | <autogenerated>:1 +0x33
  | github.com/pb33f/libopenapi/datamodel/low.LocateRefNodeWithContext()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:88 +0x661
  | github.com/pb33f/libopenapi/datamodel/low/base.ExtractSchema()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/base/schema.go:1301 +0x478
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*MediaType).Build()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/media_type.go:110 +0x744
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMapExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.250e0d0e7bcc99833342e881c9c85d52cc80b0350190b6a26640d56bd0fcd429].func3()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:760 +0x302
  | github.com/pb33f/libopenapi/datamodel.TranslatePipeline[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.label *gopkg.in/yaml%2ev3.Node; github.com/pb33f/libopenapi/datamodel/low.value *gopkg.in/yaml%2ev3.Node },go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.k github.com/pb33f/libopenapi/datamodel/low.KeyReference[string]; github.com/pb33f/libopenapi/datamodel/low.v github.com/pb33f/libopenapi/datamodel/low.ValueReference[go.shape.*uint8] }].func1()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:237 +0x1f5
  |  
  | Previous write at 0x00c0001fc2d0 by goroutine 612:
  | github.com/pb33f/libopenapi/index.(*SpecIndex).GetAllComponentSchemas()
  | /workdir/vendor/github.com/pb33f/libopenapi/index/spec_index.go:335 +0xa4
  | github.com/pb33f/libopenapi/index.(*SpecIndex).GetAllComponentSchemas-fm()
  | <autogenerated>:1 +0x33
  | github.com/pb33f/libopenapi/datamodel/low.LocateRefNodeWithContext()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:88 +0x661
  | github.com/pb33f/libopenapi/datamodel/low/base.ExtractSchema()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/base/schema.go:1301 +0x478
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*MediaType).Build()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/media_type.go:110 +0x744
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMapExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.250e0d0e7bcc99833342e881c9c85d52cc80b0350190b6a26640d56bd0fcd429].func3()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:760 +0x302
  | github.com/pb33f/libopenapi/datamodel.TranslatePipeline[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.label *gopkg.in/yaml%2ev3.Node; github.com/pb33f/libopenapi/datamodel/low.value *gopkg.in/yaml%2ev3.Node },go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.k github.com/pb33f/libopenapi/datamodel/low.KeyReference[string]; github.com/pb33f/libopenapi/datamodel/low.v github.com/pb33f/libopenapi/datamodel/low.ValueReference[go.shape.*uint8] }].func1()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:237 +0x1f5
  |  
  | Goroutine 625 (running) created at:
  | github.com/pb33f/libopenapi/datamodel.TranslatePipeline[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.label *gopkg.in/yaml%2ev3.Node; github.com/pb33f/libopenapi/datamodel/low.value *gopkg.in/yaml%2ev3.Node },go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.k github.com/pb33f/libopenapi/datamodel/low.KeyReference[string]; github.com/pb33f/libopenapi/datamodel/low.v github.com/pb33f/libopenapi/datamodel/low.ValueReference[go.shape.*uint8] }]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:229 +0x2b4
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMapExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.250e0d0e7bcc99833342e881c9c85d52cc80b0350190b6a26640d56bd0fcd429]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:784 +0xaa4
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMap[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.250e0d0e7bcc99833342e881c9c85d52cc80b0350190b6a26640d56bd0fcd429]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:808 +0x9c
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*RequestBody).Build()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/request_body.go:84 +0x499
  | github.com/pb33f/libopenapi/datamodel/low.ExtractObject[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.RequestBody,go.shape.8b0ed3aa8fc3276e4074c301238ea35fc7fea99df9cec99a11e82872c7f7815e]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:330 +0x56c
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*Operation).Build()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/operation.go:121 +0x807
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*PathItem).Build.func1()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/path_item.go:309 +0x11e
  | github.com/pb33f/libopenapi/datamodel.TranslateSliceParallel[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.Reference; Value *github.com/pb33f/libopenapi/datamodel/low/v3.Operation; ValueNode *gopkg.in/yaml%2ev3.Node; KeyNode *gopkg.in/yaml%2ev3.Node; Context context.Context },go.shape.interface {}].func1.2()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:77 +0x155
  | github.com/pb33f/libopenapi/datamodel.TranslateSliceParallel[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.Reference; Value *github.com/pb33f/libopenapi/datamodel/low/v3.Operation; ValueNode *gopkg.in/yaml%2ev3.Node; KeyNode *gopkg.in/yaml%2ev3.Node; Context context.Context },go.shape.interface {}].func1.gowrap1()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:93 +0xd4
  |  
  | Goroutine 612 (finished) created at:
  | github.com/pb33f/libopenapi/datamodel.TranslatePipeline[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.label *gopkg.in/yaml%2ev3.Node; github.com/pb33f/libopenapi/datamodel/low.value *gopkg.in/yaml%2ev3.Node },go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.k github.com/pb33f/libopenapi/datamodel/low.KeyReference[string]; github.com/pb33f/libopenapi/datamodel/low.v github.com/pb33f/libopenapi/datamodel/low.ValueReference[go.shape.*uint8] }]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:229 +0x2b4
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMapExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.250e0d0e7bcc99833342e881c9c85d52cc80b0350190b6a26640d56bd0fcd429]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:784 +0xaa4
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMap[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.250e0d0e7bcc99833342e881c9c85d52cc80b0350190b6a26640d56bd0fcd429]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:808 +0x9c
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*Response).Build()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/response.go:113 +0x7a4
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMapNoLookupExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.Response,go.shape.52dffc460753a55a8619192221d6f482d2521fefc8ef0824246678b2acd6d9a8]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:560 +0xb18
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMapNoLookup[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.Response,go.shape.52dffc460753a55a8619192221d6f482d2521fefc8ef0824246678b2acd6d9a8]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:600 +0x5e4
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*Responses).Build()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/responses.go:88 +0x5a8
  | github.com/pb33f/libopenapi/datamodel/low.ExtractObject[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.Responses,go.shape.c111d9ddc09c170ad49ebf29d7bcdb1b0c5e1d777a3c07dd0618481ab189fcc0]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:330 +0x56c
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*Operation).Build()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/operation.go:139 +0xba7
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*PathItem).Build.func1()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/path_item.go:309 +0x11e
  | github.com/pb33f/libopenapi/datamodel.TranslateSliceParallel[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.Reference; Value *github.com/pb33f/libopenapi/datamodel/low/v3.Operation; ValueNode *gopkg.in/yaml%2ev3.Node; KeyNode *gopkg.in/yaml%2ev3.Node; Context context.Context },go.shape.interface {}].func1.2()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:77 +0x155
  | github.com/pb33f/libopenapi/datamodel.TranslateSliceParallel[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.Reference; Value *github.com/pb33f/libopenapi/datamodel/low/v3.Operation; ValueNode *gopkg.in/yaml%2ev3.Node; KeyNode *gopkg.in/yaml%2ev3.Node; Context context.Context },go.shape.interface {}].func1.gowrap1()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:93 +0xd4
  | ==================
  | ==================
  | WARNING: DATA RACE
  | Read at 0x00c00037ced0 by goroutine 625:
  | runtime.mapaccess1_faststr()
  | /usr/local/go/src/runtime/map_faststr.go:13 +0x0
  | github.com/pb33f/libopenapi/datamodel/low.LocateRefNodeWithContext()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:89 +0x68e
  | github.com/pb33f/libopenapi/datamodel/low/base.ExtractSchema()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/base/schema.go:1301 +0x478
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*MediaType).Build()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/media_type.go:110 +0x744
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMapExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.250e0d0e7bcc99833342e881c9c85d52cc80b0350190b6a26640d56bd0fcd429].func3()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:760 +0x302
  | github.com/pb33f/libopenapi/datamodel.TranslatePipeline[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.label *gopkg.in/yaml%2ev3.Node; github.com/pb33f/libopenapi/datamodel/low.value *gopkg.in/yaml%2ev3.Node },go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.k github.com/pb33f/libopenapi/datamodel/low.KeyReference[string]; github.com/pb33f/libopenapi/datamodel/low.v github.com/pb33f/libopenapi/datamodel/low.ValueReference[go.shape.*uint8] }].func1()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:237 +0x1f5
  |  
  | Previous write at 0x00c00037ced0 by goroutine 612:
  | runtime.mapassign_faststr()
  | /usr/local/go/src/runtime/map_faststr.go:223 +0x0
  | github.com/pb33f/libopenapi/index.syncMapToMap[go.shape.string,go.shape.*uint8].func1()
  | /workdir/vendor/github.com/pb33f/libopenapi/index/utility_methods.go:602 +0xcf
  | sync.(*Map).Range()
  | /usr/local/go/src/sync/map.go:501 +0x1e5
  | github.com/pb33f/libopenapi/index.syncMapToMap[go.shape.string,go.shape.*uint8]()
  | /workdir/vendor/github.com/pb33f/libopenapi/index/utility_methods.go:601 +0x95
  | github.com/pb33f/libopenapi/index.(*SpecIndex).GetAllComponentSchemas()
  | /workdir/vendor/github.com/pb33f/libopenapi/index/spec_index.go:334 +0x84
  | github.com/pb33f/libopenapi/index.(*SpecIndex).GetAllComponentSchemas-fm()
  | <autogenerated>:1 +0x33
  | github.com/pb33f/libopenapi/datamodel/low.LocateRefNodeWithContext()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:88 +0x661
  | github.com/pb33f/libopenapi/datamodel/low/base.ExtractSchema()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/base/schema.go:1301 +0x478
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*MediaType).Build()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/media_type.go:110 +0x744
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMapExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.250e0d0e7bcc99833342e881c9c85d52cc80b0350190b6a26640d56bd0fcd429].func3()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:760 +0x302
  | github.com/pb33f/libopenapi/datamodel.TranslatePipeline[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.label *gopkg.in/yaml%2ev3.Node; github.com/pb33f/libopenapi/datamodel/low.value *gopkg.in/yaml%2ev3.Node },go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.k github.com/pb33f/libopenapi/datamodel/low.KeyReference[string]; github.com/pb33f/libopenapi/datamodel/low.v github.com/pb33f/libopenapi/datamodel/low.ValueReference[go.shape.*uint8] }].func1()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:237 +0x1f5
  |  
  | Goroutine 625 (running) created at:
  | github.com/pb33f/libopenapi/datamodel.TranslatePipeline[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.label *gopkg.in/yaml%2ev3.Node; github.com/pb33f/libopenapi/datamodel/low.value *gopkg.in/yaml%2ev3.Node },go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.k github.com/pb33f/libopenapi/datamodel/low.KeyReference[string]; github.com/pb33f/libopenapi/datamodel/low.v github.com/pb33f/libopenapi/datamodel/low.ValueReference[go.shape.*uint8] }]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:229 +0x2b4
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMapExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.250e0d0e7bcc99833342e881c9c85d52cc80b0350190b6a26640d56bd0fcd429]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:784 +0xaa4
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMap[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.250e0d0e7bcc99833342e881c9c85d52cc80b0350190b6a26640d56bd0fcd429]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:808 +0x9c
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*RequestBody).Build()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/request_body.go:84 +0x499
  | github.com/pb33f/libopenapi/datamodel/low.ExtractObject[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.RequestBody,go.shape.8b0ed3aa8fc3276e4074c301238ea35fc7fea99df9cec99a11e82872c7f7815e]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:330 +0x56c
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*Operation).Build()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/operation.go:121 +0x807
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*PathItem).Build.func1()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/path_item.go:309 +0x11e
  | github.com/pb33f/libopenapi/datamodel.TranslateSliceParallel[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.Reference; Value *github.com/pb33f/libopenapi/datamodel/low/v3.Operation; ValueNode *gopkg.in/yaml%2ev3.Node; KeyNode *gopkg.in/yaml%2ev3.Node; Context context.Context },go.shape.interface {}].func1.2()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:77 +0x155
  | github.com/pb33f/libopenapi/datamodel.TranslateSliceParallel[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.Reference; Value *github.com/pb33f/libopenapi/datamodel/low/v3.Operation; ValueNode *gopkg.in/yaml%2ev3.Node; KeyNode *gopkg.in/yaml%2ev3.Node; Context context.Context },go.shape.interface {}].func1.gowrap1()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:93 +0xd4
  |  
  | Goroutine 612 (finished) created at:
  | github.com/pb33f/libopenapi/datamodel.TranslatePipeline[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.label *gopkg.in/yaml%2ev3.Node; github.com/pb33f/libopenapi/datamodel/low.value *gopkg.in/yaml%2ev3.Node },go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.k github.com/pb33f/libopenapi/datamodel/low.KeyReference[string]; github.com/pb33f/libopenapi/datamodel/low.v github.com/pb33f/libopenapi/datamodel/low.ValueReference[go.shape.*uint8] }]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:229 +0x2b4
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMapExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.250e0d0e7bcc99833342e881c9c85d52cc80b0350190b6a26640d56bd0fcd429]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:784 +0xaa4
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMap[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.250e0d0e7bcc99833342e881c9c85d52cc80b0350190b6a26640d56bd0fcd429]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:808 +0x9c
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*Response).Build()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/response.go:113 +0x7a4
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMapNoLookupExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.Response,go.shape.52dffc460753a55a8619192221d6f482d2521fefc8ef0824246678b2acd6d9a8]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:560 +0xb18
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMapNoLookup[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.Response,go.shape.52dffc460753a55a8619192221d6f482d2521fefc8ef0824246678b2acd6d9a8]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:600 +0x5e4
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*Responses).Build()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/responses.go:88 +0x5a8
  | github.com/pb33f/libopenapi/datamodel/low.ExtractObject[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.Responses,go.shape.c111d9ddc09c170ad49ebf29d7bcdb1b0c5e1d777a3c07dd0618481ab189fcc0]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:330 +0x56c
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*Operation).Build()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/operation.go:139 +0xba7
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*PathItem).Build.func1()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/path_item.go:309 +0x11e
  | github.com/pb33f/libopenapi/datamodel.TranslateSliceParallel[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.Reference; Value *github.com/pb33f/libopenapi/datamodel/low/v3.Operation; ValueNode *gopkg.in/yaml%2ev3.Node; KeyNode *gopkg.in/yaml%2ev3.Node; Context context.Context },go.shape.interface {}].func1.2()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:77 +0x155
  | github.com/pb33f/libopenapi/datamodel.TranslateSliceParallel[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.Reference; Value *github.com/pb33f/libopenapi/datamodel/low/v3.Operation; ValueNode *gopkg.in/yaml%2ev3.Node; KeyNode *gopkg.in/yaml%2ev3.Node; Context context.Context },go.shape.interface {}].func1.gowrap1()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:93 +0xd4
  | ==================
  | ==================
  | WARNING: DATA RACE
  | Read at 0x00c00037edb8 by goroutine 625:
  | github.com/pb33f/libopenapi/datamodel/low.LocateRefNodeWithContext()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:89 +0x69b
  | github.com/pb33f/libopenapi/datamodel/low/base.ExtractSchema()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/base/schema.go:1301 +0x478
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*MediaType).Build()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/media_type.go:110 +0x744
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMapExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.250e0d0e7bcc99833342e881c9c85d52cc80b0350190b6a26640d56bd0fcd429].func3()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:760 +0x302
  | github.com/pb33f/libopenapi/datamodel.TranslatePipeline[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.label *gopkg.in/yaml%2ev3.Node; github.com/pb33f/libopenapi/datamodel/low.value *gopkg.in/yaml%2ev3.Node },go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.k github.com/pb33f/libopenapi/datamodel/low.KeyReference[string]; github.com/pb33f/libopenapi/datamodel/low.v github.com/pb33f/libopenapi/datamodel/low.ValueReference[go.shape.*uint8] }].func1()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:237 +0x1f5
  |  
  | Previous write at 0x00c00037edb8 by goroutine 612:
  | github.com/pb33f/libopenapi/index.syncMapToMap[go.shape.string,go.shape.*uint8].func1()
  | /workdir/vendor/github.com/pb33f/libopenapi/index/utility_methods.go:602 +0xdb
  | sync.(*Map).Range()
  | /usr/local/go/src/sync/map.go:501 +0x1e5
  | github.com/pb33f/libopenapi/index.syncMapToMap[go.shape.string,go.shape.*uint8]()
  | /workdir/vendor/github.com/pb33f/libopenapi/index/utility_methods.go:601 +0x95
  | github.com/pb33f/libopenapi/index.(*SpecIndex).GetAllComponentSchemas()
  | /workdir/vendor/github.com/pb33f/libopenapi/index/spec_index.go:334 +0x84
  | github.com/pb33f/libopenapi/index.(*SpecIndex).GetAllComponentSchemas-fm()
  | <autogenerated>:1 +0x33
  | github.com/pb33f/libopenapi/datamodel/low.LocateRefNodeWithContext()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:88 +0x661
  | github.com/pb33f/libopenapi/datamodel/low/base.ExtractSchema()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/base/schema.go:1301 +0x478
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*MediaType).Build()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/media_type.go:110 +0x744
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMapExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.250e0d0e7bcc99833342e881c9c85d52cc80b0350190b6a26640d56bd0fcd429].func3()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:760 +0x302
  | github.com/pb33f/libopenapi/datamodel.TranslatePipeline[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.label *gopkg.in/yaml%2ev3.Node; github.com/pb33f/libopenapi/datamodel/low.value *gopkg.in/yaml%2ev3.Node },go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.k github.com/pb33f/libopenapi/datamodel/low.KeyReference[string]; github.com/pb33f/libopenapi/datamodel/low.v github.com/pb33f/libopenapi/datamodel/low.ValueReference[go.shape.*uint8] }].func1()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:237 +0x1f5
  |  
  | Goroutine 625 (running) created at:
  | github.com/pb33f/libopenapi/datamodel.TranslatePipeline[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.label *gopkg.in/yaml%2ev3.Node; github.com/pb33f/libopenapi/datamodel/low.value *gopkg.in/yaml%2ev3.Node },go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.k github.com/pb33f/libopenapi/datamodel/low.KeyReference[string]; github.com/pb33f/libopenapi/datamodel/low.v github.com/pb33f/libopenapi/datamodel/low.ValueReference[go.shape.*uint8] }]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:229 +0x2b4
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMapExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.250e0d0e7bcc99833342e881c9c85d52cc80b0350190b6a26640d56bd0fcd429]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:784 +0xaa4
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMap[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.250e0d0e7bcc99833342e881c9c85d52cc80b0350190b6a26640d56bd0fcd429]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:808 +0x9c
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*RequestBody).Build()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/request_body.go:84 +0x499
  | github.com/pb33f/libopenapi/datamodel/low.ExtractObject[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.RequestBody,go.shape.8b0ed3aa8fc3276e4074c301238ea35fc7fea99df9cec99a11e82872c7f7815e]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:330 +0x56c
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*Operation).Build()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/operation.go:121 +0x807
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*PathItem).Build.func1()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/path_item.go:309 +0x11e
  | github.com/pb33f/libopenapi/datamodel.TranslateSliceParallel[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.Reference; Value *github.com/pb33f/libopenapi/datamodel/low/v3.Operation; ValueNode *gopkg.in/yaml%2ev3.Node; KeyNode *gopkg.in/yaml%2ev3.Node; Context context.Context },go.shape.interface {}].func1.2()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:77 +0x155
  | github.com/pb33f/libopenapi/datamodel.TranslateSliceParallel[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.Reference; Value *github.com/pb33f/libopenapi/datamodel/low/v3.Operation; ValueNode *gopkg.in/yaml%2ev3.Node; KeyNode *gopkg.in/yaml%2ev3.Node; Context context.Context },go.shape.interface {}].func1.gowrap1()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:93 +0xd4
  |  
  | Goroutine 612 (finished) created at:
  | github.com/pb33f/libopenapi/datamodel.TranslatePipeline[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.label *gopkg.in/yaml%2ev3.Node; github.com/pb33f/libopenapi/datamodel/low.value *gopkg.in/yaml%2ev3.Node },go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.k github.com/pb33f/libopenapi/datamodel/low.KeyReference[string]; github.com/pb33f/libopenapi/datamodel/low.v github.com/pb33f/libopenapi/datamodel/low.ValueReference[go.shape.*uint8] }]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:229 +0x2b4
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMapExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.250e0d0e7bcc99833342e881c9c85d52cc80b0350190b6a26640d56bd0fcd429]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:784 +0xaa4
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMap[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.MediaType,go.shape.250e0d0e7bcc99833342e881c9c85d52cc80b0350190b6a26640d56bd0fcd429]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:808 +0x9c
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*Response).Build()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/response.go:113 +0x7a4
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMapNoLookupExtensions[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.Response,go.shape.52dffc460753a55a8619192221d6f482d2521fefc8ef0824246678b2acd6d9a8]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:560 +0xb18
  | github.com/pb33f/libopenapi/datamodel/low.ExtractMapNoLookup[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.Response,go.shape.52dffc460753a55a8619192221d6f482d2521fefc8ef0824246678b2acd6d9a8]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:600 +0x5e4
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*Responses).Build()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/responses.go:88 +0x5a8
  | github.com/pb33f/libopenapi/datamodel/low.ExtractObject[go.shape.*github.com/pb33f/libopenapi/datamodel/low/v3.Responses,go.shape.c111d9ddc09c170ad49ebf29d7bcdb1b0c5e1d777a3c07dd0618481ab189fcc0]()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/extraction_functions.go:330 +0x56c
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*Operation).Build()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/operation.go:139 +0xba7
  | github.com/pb33f/libopenapi/datamodel/low/v3.(*PathItem).Build.func1()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/low/v3/path_item.go:309 +0x11e
  | github.com/pb33f/libopenapi/datamodel.TranslateSliceParallel[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.Reference; Value *github.com/pb33f/libopenapi/datamodel/low/v3.Operation; ValueNode *gopkg.in/yaml%2ev3.Node; KeyNode *gopkg.in/yaml%2ev3.Node; Context context.Context },go.shape.interface {}].func1.2()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:77 +0x155
  | github.com/pb33f/libopenapi/datamodel.TranslateSliceParallel[go.shape.struct { github.com/pb33f/libopenapi/datamodel/low.Reference; Value *github.com/pb33f/libopenapi/datamodel/low/v3.Operation; ValueNode *gopkg.in/yaml%2ev3.Node; KeyNode *gopkg.in/yaml%2ev3.Node; Context context.Context },go.shape.interface {}].func1.gowrap1()
  | /workdir/vendor/github.com/pb33f/libopenapi/datamodel/translate.go:93 +0xd4
daveshanley commented 1 month ago

I have not yet addressed this issue myself, please feel free to submit a PR! All are welcome.

califlower commented 1 month ago

Sure! I have a commit that fixes this. I'm running a few tests for this to ensure that it solves the issue (I think it does). I'll submit a fix soon. Sorry for posting giant logs.

califlower commented 1 month ago

@daveshanley Submitted #344