This message was deleted.
# helpdesk
s
This message was deleted.
d
Copy code
WARNING: DATA RACE
Read at 0x00c0006d1440 by goroutine 121:
  reflect.Value.pointer()
      /usr/lib/go/src/reflect/value.go:103 +0x230
  reflect.Value.Pointer()
      /usr/lib/go/src/reflect/value.go:2138 +0x21e
  fmt.(*pp).fmtPointer()
      /usr/lib/go/src/fmt/print.go:553 +0x8f
  fmt.(*pp).printValue()
      /usr/lib/go/src/fmt/print.go:929 +0x1cb3
  fmt.(*pp).printValue()
      /usr/lib/go/src/fmt/print.go:853 +0x1d25
  fmt.(*pp).printValue()
      /usr/lib/go/src/fmt/print.go:853 +0x1d25
  fmt.(*pp).printValue()
      /usr/lib/go/src/fmt/print.go:923 +0x12da
  fmt.(*pp).printArg()
      /usr/lib/go/src/fmt/print.go:759 +0xe44
  fmt.(*pp).doPrintln()
      /usr/lib/go/src/fmt/print.go:1223 +0x51
  fmt.Sprintln()
      /usr/lib/go/src/fmt/print.go:321 +0x4e
  log.Println()
      /usr/lib/go/src/log/log.go:359 +0x75
  citra/internal.onDataReceived()
      /home/masoud/Desktop/citra/internal/livekit.go:176 +0xfd
  <http://github.com/livekit/server-sdk-go.(*Room).handleDataReceived()|github.com/livekit/server-sdk-go.(*Room).handleDataReceived()>
      /home/masoud/go/pkg/mod/github.com/livekit/server-sdk-go@v1.0.13/room.go:329 +0x1e1
  <http://github.com/livekit/server-sdk-go.(*Room).handleDataReceived-fm()|github.com/livekit/server-sdk-go.(*Room).handleDataReceived-fm()>
      <autogenerated>:1 +0x44
  <http://github.com/livekit/server-sdk-go.(*RTCEngine).handleDataPacket()|github.com/livekit/server-sdk-go.(*RTCEngine).handleDataPacket()>
      /home/masoud/go/pkg/mod/github.com/livekit/server-sdk-go@v1.0.13/engine.go:374 +0x1d6
  <http://github.com/livekit/server-sdk-go.(*RTCEngine).handleDataPacket-fm()|github.com/livekit/server-sdk-go.(*RTCEngine).handleDataPacket-fm()>
      <autogenerated>:1 +0x71
  <http://github.com/pion/webrtc/v3.(*DataChannel).onMessage()|github.com/pion/webrtc/v3.(*DataChannel).onMessage()>
      /home/masoud/go/pkg/mod/github.com/pion/webrtc/v3@v3.2.14/datachannel.go:300 +0x97
  <http://github.com/pion/webrtc/v3.(*DataChannel).readLoop()|github.com/pion/webrtc/v3.(*DataChannel).readLoop()>
      /home/masoud/go/pkg/mod/github.com/pion/webrtc/v3@v3.2.14/datachannel.go:376 +0x8e
  <http://github.com/pion/webrtc/v3.(*DataChannel).handleOpen.func3()|github.com/pion/webrtc/v3.(*DataChannel).handleOpen.func3()>
      /home/masoud/go/pkg/mod/github.com/pion/webrtc/v3@v3.2.14/datachannel.go:328 +0x39

Previous write at 0x00c0006d1440 by goroutine 47:
  <http://github.com/livekit/server-sdk-go.(*baseParticipant).updateInfo()|github.com/livekit/server-sdk-go.(*baseParticipant).updateInfo()>
      /home/masoud/go/pkg/mod/github.com/livekit/server-sdk-go@v1.0.13/participant.go:154 +0x6c
  <http://github.com/livekit/server-sdk-go.(*RemoteParticipant).updateInfo()|github.com/livekit/server-sdk-go.(*RemoteParticipant).updateInfo()>
      /home/masoud/go/pkg/mod/github.com/livekit/server-sdk-go@v1.0.13/remoteparticipant.go:29 +0x66
  <http://github.com/livekit/server-sdk-go.(*Room).handleParticipantUpdate()|github.com/livekit/server-sdk-go.(*Room).handleParticipantUpdate()>
      /home/masoud/go/pkg/mod/github.com/livekit/server-sdk-go@v1.0.13/room.go:351 +0x21e
  <http://github.com/livekit/server-sdk-go.(*Room).handleParticipantUpdate-fm()|github.com/livekit/server-sdk-go.(*Room).handleParticipantUpdate-fm()>
      <autogenerated>:1 +0x57
  <http://github.com/livekit/server-sdk-go.NewRTCEngine.func1()|github.com/livekit/server-sdk-go.NewRTCEngine.func1()>
      /home/masoud/go/pkg/mod/github.com/livekit/server-sdk-go@v1.0.13/engine.go:70 +0x70
  <http://github.com/livekit/server-sdk-go.(*SignalClient).handleResponse()|github.com/livekit/server-sdk-go.(*SignalClient).handleResponse()>
      /home/masoud/go/pkg/mod/github.com/livekit/server-sdk-go@v1.0.13/signalclient.go:288 +0x4c2
  <http://github.com/livekit/server-sdk-go.(*SignalClient).readWorker()|github.com/livekit/server-sdk-go.(*SignalClient).readWorker()>
      /home/masoud/go/pkg/mod/github.com/livekit/server-sdk-go@v1.0.13/signalclient.go:344 +0x129
  <http://github.com/livekit/server-sdk-go.(*SignalClient).Start.func1()|github.com/livekit/server-sdk-go.(*SignalClient).Start.func1()>
      /home/masoud/go/pkg/mod/github.com/livekit/server-sdk-go@v1.0.13/signalclient.go:54 +0x39
d
that is inside of your code.. when you are printing out
rp
, it accesses internal state without lock.
d
How should I put lock on rp that is instance of lksdk.RemoteParticipant that I just received in OnDataReceived function ?? 🤔
d
do you need to print out the entire remote participant? when you access accessors here, they are all protected by read locks
d
Yeah, I saw your locks a few minutes ago I just put that log statement in order to print all fields of rp for testing and I just removed that line. Thanks.
btw, I have another problem. When User connects to room, I want to send room data to that user and 30-40% of the time livekit won't send room data to user that just connected. I don't know what causes this problem and I'm trying to reproduce it for you.
also have another problem like this that is when guest (anonymous) user connects a enter to room request will be send to room host users through data message and again 30-40% of time this message won't be send to host users