News for hackers. Stuff that matters.
Re:Rust Dependencies Scare Me by andy_xor_andrew on Friday May 09, 2025 @04:51PM (#43940746)
ok, I'm hooked - how is setting an env var in the current process unsafe? My gut says it's not unsafe in a memory-ownership sense, but rather in a race condition sense?

whatever the issue is, "setting an env var is unsafe" is so interesting to me that I'm now craving a blog post explaining this

Re:Rust Dependencies Scare Me by Orangeair on Friday May 09, 2025 @04:57PM (#43940796)
It's a long standing bug, setenv and unsetenv are not thread-safe

https://www.evanjones.ca/setenv-is-not-thread-safe.html

Re:Rust Dependencies Scare Me by robertlagrant on Friday May 09, 2025 @05:04PM (#43940848)
I honestly think using setenv is just a terrible idea.
Re:Rust Dependencies Scare Me by ak_111 on Saturday May 10, 2025 @05:51AM (#43944432)
can you elaborate what is the simpelist alternative?
Re:Rust Dependencies Scare Me by darthwalsh on Saturday May 10, 2025 @04:53PM (#43948909)
Simple, you don't set any env vars after starting new threads
Re:Rust Dependencies Scare Me by estebank on Friday May 09, 2025 @05:14PM (#43940928)