{"id":13694538,"url":"https://github.com/amit-davidson/Chronos","last_synced_at":"2025-05-03T04:30:30.265Z","repository":{"id":55606980,"uuid":"300626408","full_name":"amit-davidson/Chronos","owner":"amit-davidson","description":"Chronos - A static race detector for the go language","archived":false,"fork":false,"pushed_at":"2022-04-22T08:41:52.000Z","size":14085,"stargazers_count":428,"open_issues_count":6,"forks_count":11,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-12T21:38:51.741Z","etag":null,"topics":["analysis","data-race-detection","detection","detects-races","go","golang","mutex-synchronisation","pointer-analysis","race-condition","race-conditions","race-detection","ssa","static-analysis","static-code-analysis","synchronization"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amit-davidson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-02T13:39:18.000Z","updated_at":"2024-11-06T07:48:42.000Z","dependencies_parsed_at":"2022-08-15T04:10:57.771Z","dependency_job_id":null,"html_url":"https://github.com/amit-davidson/Chronos","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amit-davidson%2FChronos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amit-davidson%2FChronos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amit-davidson%2FChronos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amit-davidson%2FChronos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amit-davidson","download_url":"https://codeload.github.com/amit-davidson/Chronos/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252144263,"owners_count":21701377,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analysis","data-race-detection","detection","detects-races","go","golang","mutex-synchronisation","pointer-analysis","race-condition","race-conditions","race-detection","ssa","static-analysis","static-code-analysis","synchronization"],"created_at":"2024-08-02T17:01:34.388Z","updated_at":"2025-05-03T04:30:28.992Z","avatar_url":"https://github.com/amit-davidson.png","language":"Go","readme":"# Chronos\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://i.imgur.com/AhLyxVh.jpeg\" width=\"150\" height=\"225\"\u003e\n\u003c/p\u003e\n\n[![made-with-Go](https://github.com/go-critic/go-critic/workflows/Go/badge.svg)](http://golang.org)\n[![made-with-Go](https://img.shields.io/badge/Made%20with-Go-1f425f.svg)](http://golang.org)\n[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n[![amit-davidson](https://circleci.com/gh/amit-davidson/Chronos.svg?style=svg)](https://app.circleci.com/pipelines/github/amit-davidson/Chronos)\n\nChronos is a static race detector for the Go language written in Go.\n\n## Quick Start:\n\nDownload the package\n\n```\ngo get -v github.com/amit-davidson/Chronos/cmd/chronos\n```\n\nPass the entry point\n\n```\nchronos --file \u003cpath_to_main\u003e --mod \u003cpath_to_module\u003e\n```\n\nHelp\n\n```\nUsage of ./chronos:\n  --file string\n    \tThe file containing the entry point of the program\n  --mod string\n    \tAbsolute or relative path to the module where the search should be performed. Should end in the format:{VCS}/{organization}/{package}. Packages outside this path are excluded rom the search.\n```\n\n## Example:\n\n\u003cp float=\"left\"\u003e\n    \u003cimg src=\"https://i.imgur.com/LJMP9c2.png\" width=\"245\" height=\"300\"\u003e\n    \u003cimg src=\"https://i.imgur.com/X89VVfr.png\" width=\"700\" height=\"300\"\u003e\n\u003c/p\u003e\n\n## Features:\n\nSupport:\n\n- Detects races on pointers passed around the program.\n- Analysis of conditional branches, nested functions, interfaces, select, gotos, defers, for loops and recursions.\n- Synchronization using mutex and goroutines starts.\n\nLimitations:\n\n- Big programs and external packages. (Due to stack overflow)\n- Synchronization using channels, waitgroups, once, cond and atomic.\n\n## Chronos vs go race:\n\nChronos successfully reports cases where go race fails thanks to it's static nature. Mostly because data races appear in unexpected production workloads, which are hard to produce in dev.\nIn addition, go race is having trouble with short programs where without contrived synchronization the program may exit too quickly.\n\nIn contrast, Chronos managed to report only 244/403 = 60.5% of go race test cases. This can be explained by Chronos partial support with Go's features so this number will increase in the future.\nAlso, it lacked due to his static nature where context/path sensitivity was required.\n\nTherefore, I suggest using both according the strengths and weaknesses of each of the race detectors.\n\n## Credits:\n\nJan Wen, J., Jhala, R., \u0026amp; Lerner, S. (n.d.). [RELAY: Static Race Detection on Millions of Lines of Code](https://cseweb.ucsd.edu/~lerner/papers/relay.pdf)  \nColin J. Fidge (February 1988). [Timestamps in Message-Passing Systems That Preserve the Partial Ordering\"](http://zoo.cs.yale.edu/classes/cs426/2012/lab/bib/fidge88timestamps.pdf)\n\n## More examples:\n\n\u003cp float=\"left\"\u003e\n    \u003cimg src=\"https://i.imgur.com/NvVWFRf.png\" width=\"230\" height=\"440\"\u003e\n    \u003cimg src=\"https://i.imgur.com/eCNFAX7.png\" width=600\" height=\"300\"\u003e\n\u003c/p\u003e\n\u003chr style=\"border:2px solid gray\"\u003e \u003c/hr\u003e\n","funding_links":[],"categories":["开源类库","Code Analysis","Open source library","代码分析"],"sub_categories":["开发辅助包","Routers","Development Aid Package","路由器"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famit-davidson%2FChronos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famit-davidson%2FChronos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famit-davidson%2FChronos/lists"}