Replies: 4 comments 1 reply
-
I have not seen this before. But it probably comes from You could try inserting a print of the name, to see what's going on. I don't recall why macOS needed to use named semaphore, but if non-named are available now, we could try switching to that. Otherwise, it sounds like there's a name clash, and we'd need to figure out why that's happening. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the pointer! Assume that at some point in the past bluesim crashed**, after the named semaphore was created, but before it was unlinked. In that case, the semaphore will live on, essentially leaving a "poisoned" PID on the machine. The next time bluesim gets the same PID, it will fail because that semaphore already exists. I verified the plausibility of this by printing out the name of the semaphore when it fails, and I am seeing repeating PIDs. So I am pretty sure this is the issue. Some possible solutions:
Thoughts? Shall I put option 4 into a pull request? ** I don't know what exactly the circumstances might have been, but since I was writing bdpi functions, it is not inconceivable that during development, I might have crashed it a few times. I estimate that I have about 30 "poisoned" PIDs. |
Beta Was this translation helpful? Give feedback.
-
Oh, and I verified that unnamed semaphores still do not exist on mac. (https://www.quora.com/Why-does-OS-X-not-support-unnamed-semaphores seems like a pretty authoritative answer of why) |
Beta Was this translation helpful? Give feedback.
-
Made a pull request for it: #613 |
Beta Was this translation helpful? Give feedback.
-
I am seeing a rare, but reproducible runtime failure when running bluesim executables.
We have not been able to repro on linux, but I seem to be able to get it to fail reliably on my mac.
The failure looks like this:
I uploaded an example here:
https://github.com/rossc719g/bsc_examples/tree/main/runtime_flake
Which has a little script that runs a trivial example 50000 times, and records failures.
(I usually see 8-10 failures when I run it)
Has anyone seen something like this before?
Beta Was this translation helpful? Give feedback.
All reactions