viega / hatrack Goto Github PK
View Code? Open in Web Editor NEWFast, multi-reader, multi-writer, lockless data structures for parallel programming
License: Other
Fast, multi-reader, multi-writer, lockless data structures for parallel programming
License: Other
I haven't quite nailed down the exact circumstances in which this bug occurs, but I think you can reliably reproduce it by modifying examples/basic.c
to add multiple calls to hatrack_dict_put(envp_dict, env_key, env_val)
in the same loop iteration when populating envp_dict
, like so:
while (envp[i]) {
p = envp[i];
env_eq = strchr(p, '=');
env_key = strndup(p, env_eq - p);
env_val = strdup(env_eq + 1);
hatrack_dict_put(envp_dict, env_key, env_val);
hatrack_dict_put(envp_dict, env_key, env_val);
hatrack_dict_put(envp_dict, env_key, env_val);
hatrack_dict_put(envp_dict, env_key, env_val);
hatrack_dict_put(envp_dict, env_key, env_val);
hatrack_dict_put(envp_dict, env_key, env_val);
hatrack_dict_put(envp_dict, env_key, env_val);
hatrack_dict_put(envp_dict, env_key, env_val);
hatrack_dict_put(envp_dict, env_key, env_val);
i++;
}
Obviously, this depends on the number of environment variables. I have about 40. Just add more calls hatrack_dict_put(envp_dict, env_key, env_val)
if you still don't trigger the bug.
I think this is related to the value of HATRACK_RETIRE_FREQ
, because the bug occurs in the function call to mmm_empty()
in mmm_retire()
in mmm.c
.
I'm running this on an M1 macOS 13.4 with Xcode 14.3.1 clang:
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin22.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
I configured hatrack from scripts/config-debug
.
Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.