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

Issues with FreeBSD 11.3 and OpenJDK (BitBucket) #108

Open
jasonkafer opened this issue Mar 29, 2020 · 2 comments
Open

Issues with FreeBSD 11.3 and OpenJDK (BitBucket) #108

jasonkafer opened this issue Mar 29, 2020 · 2 comments

Comments

@jasonkafer
Copy link

We recently upgraded BitBucket to 7.1.0 which now utilizes the NuProcess 2.0.0 library. We are getting the following exception on Freebsd 11.3 using OpenJDK8 and OpenJDK11

java.lang.RuntimeException: syscall(SYS__pthread_chdir) failed to set current directory, return code: -1, last error: 45
at com.zaxxer.nuprocess.internal.BasePosixProcess.checkReturnCode(BasePosixProcess.java:648)
at com.zaxxer.nuprocess.osx.OsxProcess.spawnWithCwd(OsxProcess.java:185)
at com.zaxxer.nuprocess.osx.OsxProcess.prepareProcess(OsxProcess.java:151)
at com.zaxxer.nuprocess.osx.OsxProcess.run(OsxProcess.java:107)
at com.zaxxer.nuprocess.osx.OsxProcessFactory.runProcess(OsxProcessFactory.java:43)
at com.zaxxer.nuprocess.NuProcessBuilder.run(NuProcessBuilder.java:273)
at com.atlassian.bitbucket.internal.process.nu.NuNioProcessHelper.run(NuNioProcessHelper.java:75)

@jasonkafer
Copy link
Author

After digging into the code, it appears that the issue on FreeBSD is due to the value that is set for the SYS___pthread_chdir value in LibC.java

I am not sure where the value of 348 comes from, but based on the FreeBSD syscall.h (https://github.com/freebsd/freebsd/blob/master/sys/sys/syscall.h) the correct value to pass here is 12. I made a custom build of the library and replaced the library in bitbucket and all is good.

I'll submit a pull request for the change.

@jasonkafer
Copy link
Author

Pull request submitted

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