svn commit: r226157 - head/usr.bin/kdump

Garrett Cooper yanegomi at gmail.com
Fri Oct 21 08:52:13 UTC 2011


On Sat, Oct 8, 2011 at 5:47 AM, Dag-Erling Smorgrav <des at freebsd.org> wrote:
> Author: des
> Date: Sat Oct  8 12:47:00 2011
> New Revision: 226157
> URL: http://svn.freebsd.org/changeset/base/226157
>
> Log:
>  Bring ioctlname() in line with all the other *name() functions, which
>  actually print the name (or the numeric value, if they can't figure out
>  the correct name) instead of just returning a pointer to it.  Also, since
>  ioctl numbers are not and probably never will be unique, drop support for
>  using a switch statement instead of an if/else chain.

This commit broke truss by changing the ioctlname API signature. Example:

$ truss camcontrol devlist
# ...
Segmentation fault: 11 (core dumped)

Reason being is that truss uses ioctlname via an extern, so the
compiler doesn't note the difference (I assume because NO_WERROR= is
set in the Makefile) things go down in flames when it tries to print
out the ioctl call (dereferences a bad pointer with strdup)

This patch fixes it (with some minor Makefile cleanup), at the cost of
duplicating the mkioctls guts between kdump and truss (truss depended
on the old API signature).

Note: I did an `svn copy ../kdump/mkioctls .' beforehand in order to
bootstrap the svn history; that will need to be done before committing
my attached patch.

Thanks!
-Garrett
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-truss-ioctlname-segfault.patch
Type: text/x-patch
Size: 2136 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20111021/63e8211c/fix-truss-ioctlname-segfault.bin


More information about the svn-src-head mailing list