ABI change in libkvm (kvm_uread removal)

Jilles Tjoelker jilles at stack.nl
Tue Jul 9 21:17:14 UTC 2013


On Tue, Jul 09, 2013 at 09:59:19PM +0300, Mikolaj Golub wrote:
> On Tue, Jul 09, 2013 at 07:45:59PM +0200, Robert Millan wrote:
> > In 2011 you removed kvm_uread() from libkvm, in r227839.

> > Was this an intentional ABI change? I notice that kvm.h public header
> > still has the declaration. Also, the soname was not bumped.

> I think I thought then that kvm_uread() was for internal usage only
> (it was used by libkvm only for reading process args and env via
> procfs(5), no other consumers were found in base, no man page). Also
> reading from procfs(5) did not look like libkvm job, so after the last
> consumers had been removed, retiring it looked natural. I think I
> overlooked the declaration in kvm.h and that I might break ABI,
> otherwise it would have made me think more and ask other people if the
> removal was ok.

> > Should kvm.h and Makefile be adjusted to reflect the new ABI?

> Suggestions how this should be fixed properly (if possible) are highly
> appreciated. I will do what people suggest.

I would suggest bringing back kvm_uread() in stable/9 so that the ABI is
kept. In head, I suggest removing kvm_uread() from the header file and
bumping the soname. I think MFCing the soname bump will cause more
annoyance than the removal of kvm_uread() itself.

Much of the code using libkvm uses it to access kernel internals, which
are not a proper ABI/API and change fairly frequently. Therefore, it is
probably acceptable for this library not to use symbol versioning.

The functions that do not expose the caller to kernel internals like
kvm_getprocs() should probably not be used; instead, libprocstat
provides a more ABI-stable way to do the same. Calling the sysctls
directly is also an option.

-- 
Jilles Tjoelker


More information about the freebsd-arch mailing list