Describe the bug
I hit this race once as far as I'm aware during some integration tests, where we have a reconcile thread that reads VM properties, and the test thread that does a vm.Reconfigure operation (at least that is my theory since all I have in backtraces from the simulator side).
To Reproduce
Steps to reproduce the behavior:
I don't have clear steps at the moment. It appears that part of the code is for an ethernet card that doesn't have its properties filled out (macAddress/unitNumber).
I suspect some sort of lock is missing that would prevent writing to that config while property collector is reading it.
Expected behavior
Expect no data race in this part of the code.
Affected version
govmomi@v0.47.0
Screenshots/Debug Output
2025-02-24T16:40:54.5885532Z ==================
2025-02-24T16:40:54.5886097Z WARNING: DATA RACE
2025-02-24T16:40:54.5888491Z Read at 0x000005463148 by goroutine 508:
2025-02-24T16:40:54.5888966Z reflect.Value.Index()
2025-02-24T16:40:54.5889427Z /usr/local/go/src/reflect/value.go:1419 +0x256
2025-02-24T16:40:54.5991382Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalValue()
2025-02-24T16:40:54.5992244Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:455 +0x168d
2025-02-24T16:40:54.5992952Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalStruct()
2025-02-24T16:40:54.5993668Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:960 +0x14c5
2025-02-24T16:40:54.5994170Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalValue()
2025-02-24T16:40:54.5994666Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:532 +0x14a4
2025-02-24T16:40:54.6066985Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalValue()
2025-02-24T16:40:54.6067865Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:455 +0x16b3
2025-02-24T16:40:54.6068466Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalStruct()
2025-02-24T16:40:54.6069142Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:960 +0x14c5
2025-02-24T16:40:54.6070067Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalValue()
2025-02-24T16:40:54.6070559Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:532 +0x14a4
2025-02-24T16:40:54.6071289Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalStruct()
2025-02-24T16:40:54.6072348Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:960 +0x14c5
2025-02-24T16:40:54.6108403Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalValue()
2025-02-24T16:40:54.6120116Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:532 +0x14a4
2025-02-24T16:40:54.6121871Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalStruct()
2025-02-24T16:40:54.6133218Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:960 +0x14c5
2025-02-24T16:40:54.6133775Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalValue()
2025-02-24T16:40:54.6134250Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:532 +0x14a4
2025-02-24T16:40:54.6134622Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalValue()
2025-02-24T16:40:54.6135050Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:455 +0x16b3
2025-02-24T16:40:54.6135638Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalStruct()
2025-02-24T16:40:54.6136062Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:960 +0x14c5
2025-02-24T16:40:54.6136427Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalValue()
2025-02-24T16:40:54.6136804Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:532 +0x14a4
2025-02-24T16:40:54.6137152Z github.com/vmware/govmomi/vim25/xml.(*Encoder).Encode()
2025-02-24T16:40:54.6140185Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:162 +0x64
2025-02-24T16:40:54.6142643Z github.com/vmware/govmomi/vim25/xml.Marshal()
2025-02-24T16:40:54.6143328Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:81 +0x204
2025-02-24T16:40:54.6143826Z github.com/vmware/govmomi/simulator.deepCopy()
2025-02-24T16:40:54.6144477Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/object.go:69 +0x44
2025-02-24T16:40:54.6145545Z github.com/vmware/govmomi/simulator.(*retrieveResult).collect()
2025-02-24T16:40:54.6146078Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/property_collector.go:476 +0x471
2025-02-24T16:40:54.6146530Z github.com/vmware/govmomi/simulator.collect.func2()
2025-02-24T16:40:54.6147087Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/property_collector.go:555 +0xa5
2025-02-24T16:40:54.6148785Z github.com/vmware/govmomi/simulator.(*Registry).WithLock()
2025-02-24T16:40:54.6149262Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/registry.go:666 +0x58
2025-02-24T16:40:54.6149816Z github.com/vmware/govmomi/simulator.(*Context).WithLock()
2025-02-24T16:40:54.6203767Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/session_manager.go:432 +0x364
2025-02-24T16:40:54.6204466Z github.com/vmware/govmomi/simulator.collect()
2025-02-24T16:40:54.6205061Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/property_collector.go:555 +0x270
2025-02-24T16:40:54.6205591Z github.com/vmware/govmomi/simulator.(*PropertyCollector).RetrievePropertiesEx()
2025-02-24T16:40:54.6206158Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/property_collector.go:670 +0xaf
2025-02-24T16:40:54.6206702Z runtime.call32()
2025-02-24T16:40:54.6208195Z /usr/local/go/src/runtime/asm_amd64.s:776 +0x42
2025-02-24T16:40:54.6208788Z reflect.Value.Call()
2025-02-24T16:40:54.6209181Z /usr/local/go/src/reflect/value.go:365 +0xb5
2025-02-24T16:40:54.6209592Z github.com/vmware/govmomi/simulator.(*Service).call.func1()
2025-02-24T16:40:54.6210955Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/simulator.go:217 +0x87
2025-02-24T16:40:54.6211558Z github.com/vmware/govmomi/simulator.(*Registry).WithLock()
2025-02-24T16:40:54.6212054Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/registry.go:666 +0x58
2025-02-24T16:40:54.6212515Z github.com/vmware/govmomi/simulator.(*Service).call()
2025-02-24T16:40:54.6212979Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/simulator.go:216 +0x1bcd
2025-02-24T16:40:54.6213629Z github.com/vmware/govmomi/simulator.(*Service).ServeSDK()
2025-02-24T16:40:54.6214248Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/simulator.go:514 +0xe12
2025-02-24T16:40:54.6214976Z github.com/vmware/govmomi/simulator.(*Service).ServeSDK-fm()
2025-02-24T16:40:54.6215366Z <autogenerated>:1 +0x51
2025-02-24T16:40:54.6215750Z net/http.HandlerFunc.ServeHTTP()
2025-02-24T16:40:54.6216139Z /usr/local/go/src/net/http/server.go:2220 +0x47
2025-02-24T16:40:54.6216540Z net/http.(*ServeMux).ServeHTTP()
2025-02-24T16:40:54.6216948Z /usr/local/go/src/net/http/server.go:2747 +0x255
2025-02-24T16:40:54.6217338Z net/http.serverHandler.ServeHTTP()
2025-02-24T16:40:54.6217779Z /usr/local/go/src/net/http/server.go:3210 +0x2a1
2025-02-24T16:40:54.6218135Z net/http.(*conn).serve()
2025-02-24T16:40:54.6218490Z /usr/local/go/src/net/http/server.go:2092 +0x12a4
2025-02-24T16:40:54.6219005Z net/http.(*Server).Serve.gowrap3()
2025-02-24T16:40:54.6219404Z /usr/local/go/src/net/http/server.go:3360 +0x4f
2025-02-24T16:40:54.6219654Z
2025-02-24T16:40:54.6219847Z Previous write at 0x000005463148 by goroutine 604:
2025-02-24T16:40:54.6220297Z github.com/vmware/govmomi/object.VirtualDeviceList.AssignController()
2025-02-24T16:40:54.6220845Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/object/virtual_device_list.go:553 +0x2b9
2025-02-24T16:40:54.6221344Z github.com/vmware/govmomi/simulator.(*VirtualMachine).configureDevice()
2025-02-24T16:40:54.6221786Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/virtual_machine.go:1348 +0x20fe
2025-02-24T16:40:54.6222268Z github.com/vmware/govmomi/simulator.(*VirtualMachine).configureDevices()
2025-02-24T16:40:54.6222757Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/virtual_machine.go:1850 +0xf46
2025-02-24T16:40:54.6223189Z github.com/vmware/govmomi/simulator.(*VirtualMachine).configure()
2025-02-24T16:40:54.6226027Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/virtual_machine.go:610 +0x848
2025-02-24T16:40:54.6226595Z github.com/vmware/govmomi/simulator.(*VirtualMachine).ReconfigVMTask.func1()
2025-02-24T16:40:54.6227120Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/virtual_machine.go:2108 +0x3b5
2025-02-24T16:40:54.6227730Z github.com/vmware/govmomi/simulator.(*Task).Run.func1()
2025-02-24T16:40:54.6228173Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/task.go:130 +0x13b
2025-02-24T16:40:54.6228457Z
2025-02-24T16:40:54.6229193Z Goroutine 508 (running) created at:
2025-02-24T16:40:54.6249188Z net/http.(*Server).Serve()
2025-02-24T16:40:54.6249537Z /usr/local/go/src/net/http/server.go:3360 +0x8ec
2025-02-24T16:40:54.6249926Z github.com/vmware/govmomi/simulator/internal.(*Server).goServe.func1()
2025-02-24T16:40:54.6250398Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/internal/server.go:278 +0xbb
2025-02-24T16:40:54.6250674Z
2025-02-24T16:40:54.6250818Z Goroutine 604 (finished) created at:
2025-02-24T16:40:54.6251147Z github.com/vmware/govmomi/simulator.(*Task).Run()
2025-02-24T16:40:54.6251597Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/task.go:125 +0x724
2025-02-24T16:40:54.6252020Z github.com/vmware/govmomi/simulator.(*VirtualMachine).ReconfigVMTask()
2025-02-24T16:40:54.6252469Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/virtual_machine.go:2115 +0x164
2025-02-24T16:40:54.6252867Z runtime.call32()
2025-02-24T16:40:54.6253263Z /usr/local/go/src/runtime/asm_amd64.s:776 +0x42
2025-02-24T16:40:54.6253550Z reflect.Value.Call()
2025-02-24T16:40:54.6253910Z /usr/local/go/src/reflect/value.go:365 +0xb5
2025-02-24T16:40:54.6254252Z github.com/vmware/govmomi/simulator.(*Service).call.func1()
2025-02-24T16:40:54.6254611Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/simulator.go:217 +0x87
2025-02-24T16:40:54.6255001Z github.com/vmware/govmomi/simulator.(*Registry).WithLock()
2025-02-24T16:40:54.6255617Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/registry.go:666 +0x58
2025-02-24T16:40:54.6256010Z github.com/vmware/govmomi/simulator.(*Service).call()
2025-02-24T16:40:54.6256373Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/simulator.go:216 +0x1bcd
2025-02-24T16:40:54.6256811Z github.com/vmware/govmomi/simulator.(*Service).ServeSDK()
2025-02-24T16:40:54.6257219Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/simulator.go:514 +0xe12
2025-02-24T16:40:54.6257955Z github.com/vmware/govmomi/simulator.(*Service).ServeSDK-fm()
2025-02-24T16:40:54.6258385Z <autogenerated>:1 +0x51
2025-02-24T16:40:54.6258721Z net/http.HandlerFunc.ServeHTTP()
2025-02-24T16:40:54.6259098Z /usr/local/go/src/net/http/server.go:2220 +0x47
2025-02-24T16:40:54.6259619Z net/http.(*ServeMux).ServeHTTP()
2025-02-24T16:40:54.6259964Z /usr/local/go/src/net/http/server.go:2747 +0x255
2025-02-24T16:40:54.6260416Z net/http.serverHandler.ServeHTTP()
2025-02-24T16:40:54.6260810Z /usr/local/go/src/net/http/server.go:3210 +0x2a1
2025-02-24T16:40:54.6261144Z net/http.(*conn).serve()
2025-02-24T16:40:54.6261442Z /usr/local/go/src/net/http/server.go:2092 +0x12a4
2025-02-24T16:40:54.6261763Z net/http.(*Server).Serve.gowrap3()
2025-02-24T16:40:54.6262073Z /usr/local/go/src/net/http/server.go:3360 +0x4f
2025-02-24T16:40:54.6262376Z ==================
2025-02-24T16:40:54.6262599Z ==================
2025-02-24T16:40:54.6262873Z WARNING: DATA RACE
2025-02-24T16:40:54.6263314Z Read at 0x00c0010e053c by goroutine 508:
2025-02-24T16:40:54.6263644Z reflect.Value.Int()
2025-02-24T16:40:54.6263918Z /usr/local/go/src/reflect/value.go:1458 +0x150
2025-02-24T16:40:54.6264296Z github.com/vmware/govmomi/vim25/xml.isEmptyValue()
2025-02-24T16:40:54.6264683Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:1057 +0xb4
2025-02-24T16:40:54.6265050Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalValue()
2025-02-24T16:40:54.6265460Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:413 +0x10b
2025-02-24T16:40:54.6265808Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalValue()
2025-02-24T16:40:54.6266180Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:455 +0x16b3
2025-02-24T16:40:54.6266561Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalStruct()
2025-02-24T16:40:54.6266939Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:960 +0x14c5
2025-02-24T16:40:54.6267303Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalValue()
2025-02-24T16:40:54.6267809Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:532 +0x14a4
2025-02-24T16:40:54.6268192Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalValue()
2025-02-24T16:40:54.6268587Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:455 +0x16b3
2025-02-24T16:40:54.6268968Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalStruct()
2025-02-24T16:40:54.6269401Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:960 +0x14c5
2025-02-24T16:40:54.6269768Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalValue()
2025-02-24T16:40:54.6270294Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:532 +0x14a4
2025-02-24T16:40:54.6270692Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalStruct()
2025-02-24T16:40:54.6271193Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:960 +0x14c5
2025-02-24T16:40:54.6271544Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalValue()
2025-02-24T16:40:54.6271899Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:532 +0x14a4
2025-02-24T16:40:54.6272259Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalStruct()
2025-02-24T16:40:54.6272607Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:960 +0x14c5
2025-02-24T16:40:54.6272998Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalValue()
2025-02-24T16:40:54.6273469Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:532 +0x14a4
2025-02-24T16:40:54.6273869Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalValue()
2025-02-24T16:40:54.6274246Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:455 +0x16b3
2025-02-24T16:40:54.6274663Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalStruct()
2025-02-24T16:40:54.6275016Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:960 +0x14c5
2025-02-24T16:40:54.6275385Z github.com/vmware/govmomi/vim25/xml.(*printer).marshalValue()
2025-02-24T16:40:54.6275735Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:532 +0x14a4
2025-02-24T16:40:54.6276145Z github.com/vmware/govmomi/vim25/xml.(*Encoder).Encode()
2025-02-24T16:40:54.6276498Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:162 +0x64
2025-02-24T16:40:54.6277136Z github.com/vmware/govmomi/vim25/xml.Marshal()
2025-02-24T16:40:54.6277724Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/vim25/xml/marshal.go:81 +0x204
2025-02-24T16:40:54.6278159Z github.com/vmware/govmomi/simulator.deepCopy()
2025-02-24T16:40:54.6278625Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/object.go:69 +0x44
2025-02-24T16:40:54.6279036Z github.com/vmware/govmomi/simulator.(*retrieveResult).collect()
2025-02-24T16:40:54.6279460Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/property_collector.go:476 +0x471
2025-02-24T16:40:54.6279989Z github.com/vmware/govmomi/simulator.collect.func2()
2025-02-24T16:40:54.6280474Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/property_collector.go:555 +0xa5
2025-02-24T16:40:54.6280840Z github.com/vmware/govmomi/simulator.(*Registry).WithLock()
2025-02-24T16:40:54.6281277Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/registry.go:666 +0x58
2025-02-24T16:40:54.6281680Z github.com/vmware/govmomi/simulator.(*Context).WithLock()
2025-02-24T16:40:54.6282194Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/session_manager.go:432 +0x364
2025-02-24T16:40:54.6282639Z github.com/vmware/govmomi/simulator.collect()
2025-02-24T16:40:54.6283171Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/property_collector.go:555 +0x270
2025-02-24T16:40:54.6283708Z github.com/vmware/govmomi/simulator.(*PropertyCollector).RetrievePropertiesEx()
2025-02-24T16:40:54.6284212Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/property_collector.go:670 +0xaf
2025-02-24T16:40:54.6284580Z runtime.call32()
2025-02-24T16:40:54.6284895Z /usr/local/go/src/runtime/asm_amd64.s:776 +0x42
2025-02-24T16:40:54.6285244Z reflect.Value.Call()
2025-02-24T16:40:54.6285636Z /usr/local/go/src/reflect/value.go:365 +0xb5
2025-02-24T16:40:54.6285968Z github.com/vmware/govmomi/simulator.(*Service).call.func1()
2025-02-24T16:40:54.6286356Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/simulator.go:217 +0x87
2025-02-24T16:40:54.6286745Z github.com/vmware/govmomi/simulator.(*Registry).WithLock()
2025-02-24T16:40:54.6287129Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/registry.go:666 +0x58
2025-02-24T16:40:54.6287535Z github.com/vmware/govmomi/simulator.(*Service).call()
2025-02-24T16:40:54.6288001Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/simulator.go:216 +0x1bcd
2025-02-24T16:40:54.6288408Z github.com/vmware/govmomi/simulator.(*Service).ServeSDK()
2025-02-24T16:40:54.6288761Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/simulator.go:514 +0xe12
2025-02-24T16:40:54.6289382Z github.com/vmware/govmomi/simulator.(*Service).ServeSDK-fm()
2025-02-24T16:40:54.6289718Z <autogenerated>:1 +0x51
2025-02-24T16:40:54.6290030Z net/http.HandlerFunc.ServeHTTP()
2025-02-24T16:40:56.4717854Z /usr/local/go/src/net/http/server.go:2220 +0x47
2025-02-24T16:40:56.4718360Z net/http.(*ServeMux).ServeHTTP()
2025-02-24T16:40:56.4814289Z /usr/local/go/src/net/http/server.go:2747 +0x255
2025-02-24T16:40:56.4815169Z net/http.serverHandler.ServeHTTP()
2025-02-24T16:40:56.4858061Z /usr/local/go/src/net/http/server.go:3210 +0x2a1
2025-02-24T16:40:56.4858416Z net/http.(*conn).serve()
2025-02-24T16:40:56.4865379Z /usr/local/go/src/net/http/server.go:2092 +0x12a4
2025-02-24T16:40:56.4878180Z net/http.(*Server).Serve.gowrap3()
2025-02-24T16:40:56.4878650Z /usr/local/go/src/net/http/server.go:3360 +0x4f
2025-02-24T16:40:56.4884495Z
2025-02-24T16:40:56.4884706Z Previous write at 0x00c0010e053c by goroutine 604:
2025-02-24T16:40:56.4885221Z github.com/vmware/govmomi/object.VirtualDeviceList.AssignController()
2025-02-24T16:40:56.4899486Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/object/virtual_device_list.go:553 +0x295
2025-02-24T16:40:56.4899937Z github.com/vmware/govmomi/simulator.(*VirtualMachine).configureDevice()
2025-02-24T16:40:56.4905076Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/virtual_machine.go:1348 +0x20fe
2025-02-24T16:40:56.5024788Z github.com/vmware/govmomi/simulator.(*VirtualMachine).configureDevices()
2025-02-24T16:40:56.5025562Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/virtual_machine.go:1850 +0xf46
2025-02-24T16:40:56.5026008Z github.com/vmware/govmomi/simulator.(*VirtualMachine).configure()
2025-02-24T16:40:56.5026394Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/virtual_machine.go:610 +0x848
2025-02-24T16:40:56.5046602Z github.com/vmware/govmomi/simulator.(*VirtualMachine).ReconfigVMTask.func1()
2025-02-24T16:40:56.5059847Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/virtual_machine.go:2108 +0x3b5
2025-02-24T16:40:56.5069014Z github.com/vmware/govmomi/simulator.(*Task).Run.func1()
2025-02-24T16:40:56.5069547Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/task.go:130 +0x13b
2025-02-24T16:40:56.5069752Z
2025-02-24T16:40:56.5069851Z Goroutine 508 (running) created at:
2025-02-24T16:40:56.5089844Z net/http.(*Server).Serve()
2025-02-24T16:40:56.5106194Z /usr/local/go/src/net/http/server.go:3360 +0x8ec
2025-02-24T16:40:56.5106563Z github.com/vmware/govmomi/simulator/internal.(*Server).goServe.func1()
2025-02-24T16:40:56.5118419Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/internal/server.go:278 +0xbb
2025-02-24T16:40:56.5122850Z
2025-02-24T16:40:56.5122985Z Goroutine 604 (finished) created at:
2025-02-24T16:40:56.5127782Z github.com/vmware/govmomi/simulator.(*Task).Run()
2025-02-24T16:40:56.5149109Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/task.go:125 +0x724
2025-02-24T16:40:56.5311240Z github.com/vmware/govmomi/simulator.(*VirtualMachine).ReconfigVMTask()
2025-02-24T16:40:56.5311719Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/virtual_machine.go:2115 +0x164
2025-02-24T16:40:56.5312006Z runtime.call32()
2025-02-24T16:40:56.5312254Z /usr/local/go/src/runtime/asm_amd64.s:776 +0x42
2025-02-24T16:40:56.5312566Z reflect.Value.Call()
2025-02-24T16:40:56.5312853Z /usr/local/go/src/reflect/value.go:365 +0xb5
2025-02-24T16:40:56.5423780Z github.com/vmware/govmomi/simulator.(*Service).call.func1()
2025-02-24T16:40:56.5438778Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/simulator.go:217 +0x87
2025-02-24T16:40:56.5444339Z github.com/vmware/govmomi/simulator.(*Registry).WithLock()
2025-02-24T16:40:56.5444893Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/registry.go:666 +0x58
2025-02-24T16:40:56.5457578Z github.com/vmware/govmomi/simulator.(*Service).call()
2025-02-24T16:40:56.5458091Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/simulator.go:216 +0x1bcd
2025-02-24T16:40:56.5464050Z github.com/vmware/govmomi/simulator.(*Service).ServeSDK()
2025-02-24T16:40:56.5470007Z /go/pkg/mod/github.com/vmware/govmomi@v0.47.0/simulator/simulator.go:514 +0xe12
2025-02-24T16:40:56.5470807Z github.com/vmware/govmomi/simulator.(*Service).ServeSDK-fm()
2025-02-24T16:40:56.5478472Z <autogenerated>:1 +0x51
2025-02-24T16:40:56.5478828Z net/http.HandlerFunc.ServeHTTP()
2025-02-24T16:40:56.5490070Z /usr/local/go/src/net/http/server.go:2220 +0x47
2025-02-24T16:40:56.5494627Z net/http.(*ServeMux).ServeHTTP()
2025-02-24T16:40:56.5500572Z /usr/local/go/src/net/http/server.go:2747 +0x255
2025-02-24T16:40:56.5505791Z net/http.serverHandler.ServeHTTP()
2025-02-24T16:40:56.5515330Z /usr/local/go/src/net/http/server.go:3210 +0x2a1
2025-02-24T16:40:56.5515652Z net/http.(*conn).serve()
2025-02-24T16:40:56.5533084Z /usr/local/go/src/net/http/server.go:2092 +0x12a4
2025-02-24T16:40:56.5602891Z net/http.(*Server).Serve.gowrap3()
2025-02-24T16:40:56.5603345Z /usr/local/go/src/net/http/server.go:3360 +0x4f
2025-02-24T16:40:56.5649478Z ==================
Additional context
Add any other context about the problem here.
Describe the bug
I hit this race once as far as I'm aware during some integration tests, where we have a reconcile thread that reads VM properties, and the test thread that does a vm.Reconfigure operation (at least that is my theory since all I have in backtraces from the simulator side).
To Reproduce
Steps to reproduce the behavior:
I don't have clear steps at the moment. It appears that part of the code is for an ethernet card that doesn't have its properties filled out (macAddress/unitNumber).
I suspect some sort of lock is missing that would prevent writing to that config while property collector is reading it.
Expected behavior
Expect no data race in this part of the code.
Affected version
govmomi@v0.47.0
Screenshots/Debug Output
Additional context
Add any other context about the problem here.