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

Unbreak on FreeBSD 12+ #133

Closed
wants to merge 1 commit into from

Conversation

smortex
Copy link

@smortex smortex commented Apr 10, 2019

This is a follow-up to jnr/jnr-ffi#189, which is a follow-up to jnr/jffi#66.


FreeBSD 12 switched to 64 bits inodes, and struct stat was updated accordingly:
freebsd/freebsd-src@e75ba1d

On recent FreeBSD, due to struct stat size change, jnr-posix acts inconsistently.

Fix the issue by forcing usage of the legacy API which is available through versioned symbols.

Running the test suite on FreeBSD before this change produces:

Tests run: 93, Failures: 10, Errors: 3, Skipped: 1

Failed tests:
FileStatTest.filestat:63 expected:<1567> but was:<149054000>
FileStatTest.filestatDirectory:196 null
FileTest.futimeTest:185 mtime failed
FileTest.futimens:144->assertStatNanoSecond:661 Access timestamp should be updated expected:<4299262296485> but was:<4299262296484>
FileTest.lutimesTest:162 atime seconds failed expected:<800> but was:<4299262296484>
FileTest.utimensatAbsolutePath:115->utimensat:656->assertStatNanoSecond:661 Access timestamp should be updated expected:<4299262296486> but was:<4299262296484>
FileTest.utimensatRelativePath:124->utimensat:656->assertStatNanoSecond:661 Access timestamp should be updated expected:<4299262296486> but was:<4299262296484>
FileTest.utimesDefaultValuesTest:73 mtime failed
FileTest.utimesPointerTest:95 atime seconds failed expected:<800> but was:<4299262296484>
FileTest.utimesTest:42 atime seconds failed expected:<800> but was:<4299262296484>

With this change, the results are:

Tests run: 93, Failures: 0, Errors: 3, Skipped: 1

Tests in error rely on unimplemented methods for FreeBSD and are
expected:

Tests in error:
EnvTest.testEnv:70 » UnsupportedOperation unimplemented method: environ
IOTest.testSendRecvMsg_NoControl:115 » UnsupportedOperation unimplemented method: allocateMsgHdr
IOTest.testSendRecvMsg_WithControl:163 » UnsupportedOperation unimplemented method: allocateMsgHdr

FreeBSD 12 switched to 64 bits inodes, and struct stat was updated
accordingly:
freebsd/freebsd-src@e75ba1d

On recent FreeBSD, due to struct stat size change, jnr-posix acts
inconsistently.

Fix the issue by forcing usage of the legacy API which is available
through versioned symbols.

Running the test suite on FreeBSD before this change produces:

> Tests run: 93, Failures: 10, Errors: 3, Skipped: 1
>
> Failed tests:
>   FileStatTest.filestat:63 expected:<1567> but was:<149054000>
>   FileStatTest.filestatDirectory:196 null
>   FileTest.futimeTest:185 mtime failed
>   FileTest.futimens:144->assertStatNanoSecond:661 Access timestamp should be updated expected:<4299262296485> but was:<4299262296484>
>   FileTest.lutimesTest:162 atime seconds failed expected:<800> but was:<4299262296484>
>   FileTest.utimensatAbsolutePath:115->utimensat:656->assertStatNanoSecond:661 Access timestamp should be updated expected:<4299262296486> but was:<4299262296484>
>   FileTest.utimensatRelativePath:124->utimensat:656->assertStatNanoSecond:661 Access timestamp should be updated expected:<4299262296486> but was:<4299262296484>
>   FileTest.utimesDefaultValuesTest:73 mtime failed
>   FileTest.utimesPointerTest:95 atime seconds failed expected:<800> but was:<4299262296484>
>   FileTest.utimesTest:42 atime seconds failed expected:<800> but was:<4299262296484>

With this change, the results are:

> Tests run: 93, Failures: 0, Errors: 3, Skipped: 1

Tests in error rely on unimplemented methods for FreeBSD and are
expected:

> Tests in error:
>   EnvTest.testEnv:70 » UnsupportedOperation unimplemented method: environ
>   IOTest.testSendRecvMsg_NoControl:115 » UnsupportedOperation unimplemented method: allocateMsgHdr
>   IOTest.testSendRecvMsg_WithControl:163 » UnsupportedOperation unimplemented method: allocateMsgHdr
@headius
Copy link
Member

headius commented Jan 20, 2020

Ping! Can this be updated, if it is still necessary?

@smortex
Copy link
Author

smortex commented Jan 21, 2020

@headius a workaround was committed as #132, the discussion took place in #126. It's up to you (maintainers) to decide if this workaround is enought or if bringing support for versioned symbols offer more flexibility.

@grembo
Copy link

grembo commented May 28, 2020

#150 contains an implementation of the missing features in FreeBSD (handling MsgHdr), which should address this issue (at least in this respect).

@headius
Copy link
Member

headius commented Jun 12, 2020

@smortex @grembo Thank you for clarifying, I appreciate the help. I've merged in #134 and will merge in #150 and get a release out soon.

@headius
Copy link
Member

headius commented Jun 12, 2020

Oops, I meant I have merged in #150 and will look at #134 to see what more needs to be done there.

@headius
Copy link
Member

headius commented Jun 12, 2020

Ok, the main problem with #133 is that *I think it would require us to update every binary, and we have no good way to do that for several platforms.

I will get other stuff merged in for now but this is an ongoing problem preventing us from evolving jffi like we need to.

@headius
Copy link
Member

headius commented Jun 12, 2020

@grembo I'm going to take your word for it that FreeBSD 12 is basically "unbroken" with current patches and close this.

The links @smortex listed above are still outstanding, though, and likely will need for us to be able to rebuild the library at least on platforms where we are able (it may be possible to do it incrementally rather than e.g. being forced to wait until someone rebuilds binaries on OpenVMS. 🙄

@headius headius closed this Jun 12, 2020
@headius headius added this to the 3.0.58 milestone Jun 12, 2020
@grembo
Copy link

grembo commented Jun 12, 2020

@headius I can only comment on the MsgHdr features I implemented in the pull request you just merged (thanks!). So I was referring to fixing “Tests in error rely on unimplemented methods for FreeBSD and are expected:“ part of this bug report. I can’t really comment on the stat problems, that seems to have been addressed though.

That said, all unit tests run okay on FreeBSD now and I could use jnr-posix now to unbreak dbus-java on FreeBSD.

@grembo
Copy link

grembo commented Jun 13, 2020

@smortex Maybe you can comment too? (I'm happy with this)

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

Successfully merging this pull request may close these issues.

3 participants