Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Race on Close command #1006

Open
3 tasks done
dido18 opened this issue Jan 10, 2025 · 0 comments
Open
3 tasks done

Data Race on Close command #1006

dido18 opened this issue Jan 10, 2025 · 0 comments
Labels
type: imperfection Perceived defect in any part of project

Comments

@dido18
Copy link
Contributor

dido18 commented Jan 10, 2025

Describe the problem

A data race is detected

2025/01/10 14:53:20 stderr: ==================
2025/01/10 14:53:20 stderr: WARNING: DATA RACE
2025/01/10 14:53:20 stderr: Read at 0x00c000447988 by goroutine 80:
2025/01/10 14:53:20 stderr:   main.(*serport).reader()
2025/01/10 14:53:20 stderr:       /home/dido/code/arduino/arduino-create-agent/serialport.go:88 +0x167
2025/01/10 14:53:20 stderr:   main.spHandlerOpen()
2025/01/10 14:53:20 stderr:       /home/dido/code/arduino/arduino-create-agent/serialport.go:345 +0x1467
2025/01/10 14:53:20 stderr:   main.checkCmd.gowrap4()
2025/01/10 14:53:20 stderr:       /home/dido/code/arduino/arduino-create-agent/hub.go:157 +0x6b
2025/01/10 14:53:20 stderr: 
2025/01/10 14:53:20 stderr: Previous write at 0x00c000447988 by goroutine 86:
2025/01/10 14:53:20 stderr:   main.(*serport).Close()
2025/01/10 14:53:20 stderr:       /home/dido/code/arduino/arduino-create-agent/serialport.go:351 +0x37
2025/01/10 14:53:20 stderr:   main.spClose()
2025/01/10 14:53:20 stderr:       /home/dido/code/arduino/arduino-create-agent/serial.go:267 +0xee
2025/01/10 14:53:20 stderr:   main.checkCmd.gowrap5()
2025/01/10 14:53:20 stderr:       /home/dido/code/arduino/arduino-create-agent/hub.go:163 +0x44
2025/01/10 14:53:20 stderr: 
2025/01/10 14:53:20 stderr: Goroutine 80 (running) created at:
2025/01/10 14:53:20 stderr:   main.checkCmd()
2025/01/10 14:53:20 stderr:       /home/dido/code/arduino/arduino-create-agent/hub.go:157 +0x366
2025/01/10 14:53:20 stderr:   main.(*hub).run()
2025/01/10 14:53:20 stderr:       /home/dido/code/arduino/arduino-create-agent/hub.go:111 +0x244
2025/01/10 14:53:20 stderr:   main.loop.gowrap2()
2025/01/10 14:53:20 stderr:       /home/dido/code/arduino/arduino-create-agent/main.go:412 +0x33
2025/01/10 14:53:20 stderr: 
2025/01/10 14:53:20 stderr: Goroutine 86 (running) created at:
2025/01/10 14:53:20 stderr:   main.checkCmd()
2025/01/10 14:53:20 stderr:       /home/dido/code/arduino/arduino-create-agent/hub.go:163 +0x584
2025/01/10 14:53:20 stderr:   main.(*hub).run()
2025/01/10 14:53:20 stderr:       /home/dido/code/arduino/arduino-create-agent/hub.go:111 +0x244
2025/01/10 14:53:20 stderr:   main.loop.gowrap2()
2025/01/10 14:53:20 stderr:       /home/dido/code/arduino/arduino-create-agent/main.go:412 +0x33
2025/01/10 14:53:20 stderr: ==================

To reproduce

  • launch the service task run
  • open the http://127.0.0.1:8991/ console
  • attach a board via USB
  • type the command open /dev/ttyACM0 115200
  • type the command close /dev/ttyACM0
  • the console where the service is running shows the data-race warning.

Expected behavior

do not have the race condition

Arduino Create Agent version

1,6,1

Operating system

Linux

Operating system version

20.04

Browser

Chroome

Browser version

Chroome

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest version
  • My report contains all necessary details
@dido18 dido18 added the type: imperfection Perceived defect in any part of project label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

1 participant