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

Acme crashes on AIX 7.3 #699

Open
bhuntsman opened this issue Feb 10, 2025 · 1 comment
Open

Acme crashes on AIX 7.3 #699

bhuntsman opened this issue Feb 10, 2025 · 1 comment

Comments

@bhuntsman
Copy link
Contributor

When running Acme on AIX 7.3, the window briefly flashes on the screen, then disappears, and the following message is printed to the terminal:

acme: can't post service: Restart the system call

This occurs on AIX 7.3, and possibly 7.2 though I haven't tested it on 7.2. This was also tested with a working build on AIX 7.1 and copied to a 7.3 system and the same behavior observed.

The error is generated from src/cmd/acme/fsys.c:127

Though it is hard to tell where the "Restart the system call" return value is coming from.

This appears to be an issue related to timing and possibly threads. If the program is run under the debugger with a breakpoint set in post9pservice, and the post9pservice call is single-stepped through, the window eventually gets displayed and then works. Further debugging assistance would be greatly appreciated.

@bhuntsman
Copy link
Contributor Author

This definitely looks like a timing issue on AIX 7.3. The following patch resolves the issue:

diff --git a/src/lib9/post9p.c b/src/lib9/post9p.c
index e894ef9e..93710cbd 100644
--- a/src/lib9/post9p.c
+++ b/src/lib9/post9p.c
@@ -41,6 +41,7 @@ post9pservice(int fd, char *name, char *mtpt)
                }
                close(fd);
                w = waitfor(pid);
+               sleep(10);
                if(w == nil)
                        return -1;
                if(w->msg && w->msg[0]){

However, I'm not sure that's the best way to go. On the other hand it shouldn't hurt.

bhuntsman added a commit to bhuntsman/plan9port that referenced this issue Feb 17, 2025
On newer versions of AIX (at least 7.3, possibly 7.2), when a program calls
post9pservice, the call fails due to a timing problem just after the
call to waitfor.  Adding this short delay allows the function to succeed
and the program works correctly on AIX afterwards.

Fixes 9fans#699
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant