Bug 203092 - dtrace/procsystime - identifier redeclaration
Summary: dtrace/procsystime - identifier redeclaration
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 10.2-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Mark Johnston
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-14 02:15 UTC by Walter Schwarzenfeld
Modified: 2015-09-22 00:45 UTC (History)
1 user (show)

See Also:


Attachments
patch (976 bytes, patch)
2015-09-14 04:28 UTC, Mark Johnston
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Walter Schwarzenfeld 2015-09-14 02:15:23 UTC
procsystime shows error message "/usr/lib/dtrace/ip.d", line 112: identifier redeclared: ip6_t and stops.
If I comment out the redeclaration at line 112 it works.
Comment 1 Mark Johnston freebsd_committer freebsd_triage 2015-09-14 02:27:35 UTC
I'm able to run procsystime in an unmodified 10.2 VM:

# ./procsystime 
Tracing... Hit Ctrl-C to end...
^C

Elapsed Times for all processes,

         SYSCALL          TIME (ns)
          getpid               1730
       sigreturn               2449
       sigaction               4075
           fstat               9475
     sigprocmask              12324
            stat              23917
        __sysctl              64723
            mmap              98138
          munmap             102664
           write             210395
   clock_gettime             233549
           ioctl            1390206
          select         5230689440
        _umtx_op         7991532922

# uname -a
FreeBSD  10.2-RELEASE FreeBSD 10.2-RELEASE #0 r286666: Wed Aug 12 15:26:37 UTC 2015     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64

Have you recompiled your kernel? Are you running the script from within a jail?
Comment 2 Walter Schwarzenfeld 2015-09-14 03:32:32 UTC
Have you recompiled your kernel? 
Last with update to 10.2-Release-p14
Are you running the script from within a jail?
No.
Comment 3 Walter Schwarzenfeld 2015-09-14 03:33:22 UTC
Sorry , 10.2-RELEASE-p2.
Comment 4 Mark Johnston freebsd_committer freebsd_triage 2015-09-14 03:36:06 UTC
Could you paste the output of procsystime with DTRACE_DEBUG=1 set in the environment?
Comment 5 Walter Schwarzenfeld 2015-09-14 03:43:41 UTC
"/usr/lib/dtrace/ip.d", line 112: identifier redeclared: ip6_t - nothing more
Comment 6 Mark Johnston freebsd_committer freebsd_triage 2015-09-14 03:45:43 UTC
(In reply to Walter Schwarzenfeld from comment #5)
dtrace(1) will always print extra debug output if DTRACE_DEBUG=1 is set:

# DTRACE_DEBUG=1 ./procsystime 
libdtrace DEBUG: opened 64-bit module kernel () [0]
libdtrace DEBUG: opened 64-bit module dtraceall.ko () [0]
libdtrace DEBUG: opened 64-bit module opensolaris.ko () [0]
libdtrace DEBUG: opened 64-bit module dtrace.ko () [0]
libdtrace DEBUG: opened 64-bit module dtmalloc.ko () [0]
libdtrace DEBUG: opened 64-bit module dtnfscl.ko () [0]
...
Comment 7 Walter Schwarzenfeld 2015-09-14 03:50:40 UTC
Have you recompiled your kernel? 
Last with update to 10.2-Release-p14
Are you running the script from within a jail?
No.(In reply to Mark Johnston from comment #6)
No, it does not.
Comment 8 Walter Schwarzenfeld 2015-09-14 03:52:26 UTC
(In reply to Mark Johnston from comme(In reply to Mark Johnston from comment #6)
No, it does not.
Comment 9 Walter Schwarzenfeld 2015-09-14 04:01:21 UTC
The modules are all loaded.
Comment 10 Mark Johnston freebsd_committer freebsd_triage 2015-09-14 04:05:00 UTC
(In reply to Walter Schwarzenfeld from comment #7)
That's pretty strange. Does it work when dtrace(1) is invoked from the command line? For example,

# DTRACE_DEBUG=1 dtrace -n 'fbt::kern_ioctl:entry'

Nonetheless, I think I see the problem. Do you have ipfilter.ko loaded by any chance?
Comment 11 Walter Schwarzenfeld 2015-09-14 04:13:52 UTC
This works:
DTRACE_DEBUG=1 dtrace -n 'fbt::kern_ioctl:entry'
Password:
libdtrace DEBUG: opened provider dtrace
libdtrace DEBUG: opened provider profile
libdtrace DEBUG: opened provider lockstat
libdtrace DEBUG: opened provider fbt
libdtrace DEBUG: opened provider dtmalloc
libdtrace DEBUG: opened 64-bit module kernel () [0]
libdtrace DEBUG: opened 64-bit module lindev.ko () [0]
libdtrace DEBUG: opened 64-bit module coretemp.ko () [0]
libdtrace DEBUG: opened 64-bit module amdtemp.ko () [0]
libdtrace DEBUG: opened 64-bit module nvidia.ko () [0]
libdtrace DEBUG: opened 64-bit module linux.ko () [0]
libdtrace DEBUG: opened 64-bit module fuse.ko () [0]
libdtrace DEBUG: opened 64-bit module libiconv.ko () [0]
libdtrace DEBUG: opened 64-bit module sem.ko () [0]
libdtrace DEBUG: opened 64-bit module tmpfs.ko () [0]
libdtrace DEBUG: opened 64-bit module linprocfs.ko () [0]
libdtrace DEBUG: opened 64-bit module fdescfs.ko () [0]
libdtrace DEBUG: opened 64-bit module linsysfs.ko () [0]
libdtrace DEBUG: opened 64-bit module ipl.ko () [0]
libdtrace DEBUG: opened 64-bit module ums.ko () [0]
libdtrace DEBUG: opened 64-bit module vboxnetflt.ko () [0]
libdtrace DEBUG: opened 64-bit module netgraph.ko () [0]
libdtrace DEBUG: opened 64-bit module vboxdrv.ko () [0]
libdtrace DEBUG: opened 64-bit module ng_ether.ko () [0]
libdtrace DEBUG: opened 64-bit module vboxnetadp.ko () [0]
libdtrace DEBUG: opened 64-bit module dtrace.ko () [0]
libdtrace DEBUG: opened 64-bit module opensolaris.ko () [0]
libdtrace DEBUG: opened 64-bit module dtraceall.ko () [0]
libdtrace DEBUG: opened 64-bit module dtmalloc.ko () [0]
libdtrace DEBUG: opened 64-bit module dtnfscl.ko () [0]
libdtrace DEBUG: opened 64-bit module fbt.ko () [0]
libdtrace DEBUG: opened 64-bit module fasttrap.ko () [0]
libdtrace DEBUG: opened 64-bit module lockstat.ko () [0]
libdtrace DEBUG: opened 64-bit module sdt.ko () [0]
libdtrace DEBUG: opened 64-bit module systrace.ko () [0]
libdtrace DEBUG: opened 64-bit module systrace_freebsd32.ko () [0]
libdtrace DEBUG: opened 64-bit module profile.ko () [0]

ipfilter.ko is not loaded, but ipfw started.
Comment 12 Walter Schwarzenfeld 2015-09-14 04:15:53 UTC
Should be ipf is started.
Comment 13 Mark Johnston freebsd_committer freebsd_triage 2015-09-14 04:26:39 UTC
(In reply to Walter Schwarzenfeld from comment #11)
Ok, thank you. I meant ipl.ko rather than ipfilter.ko, and you do indeed have it loaded. The trouble is that ip.d defines a type that's also defined in ipl.ko. It's not really needed, though.

The attached patch should fix the issue when applied to /usr/lib/dtrace/ip.d. I'll commit it to svn shortly.
Comment 14 Mark Johnston freebsd_committer freebsd_triage 2015-09-14 04:28:43 UTC
Created attachment 161031 [details]
patch

Actually attach the patch this time.
Comment 15 Walter Schwarzenfeld 2015-09-14 04:43:30 UTC
Seems to work. But DTRACE_DEBUG=1 has not more output.
Comment 16 commit-hook freebsd_committer freebsd_triage 2015-09-15 05:16:49 UTC
A commit references this bug:

Author: markj
Date: Tue Sep 15 05:16:28 UTC 2015
New revision: 287807
URL: https://svnweb.freebsd.org/changeset/base/287807

Log:
  Remove an unneeded typedef of ip6_t from the DTrace ip provider library.
  It causes an error when ipfilter is enabled, since ipl.ko contains an
  identical typedef.

  PR:		203092
  MFC after:	1 week

Changes:
  head/cddl/lib/libdtrace/ip.d
  head/share/man/man4/dtrace_ip.4
Comment 17 commit-hook freebsd_committer freebsd_triage 2015-09-22 00:45:47 UTC
A commit references this bug:

Author: markj
Date: Tue Sep 22 00:45:17 UTC 2015
New revision: 288080
URL: https://svnweb.freebsd.org/changeset/base/288080

Log:
  MFC r287807:
  Remove an unneeded typedef of ip6_t from the DTrace ip provider library.

  PR:	203092

Changes:
_U  stable/10/
  stable/10/cddl/lib/libdtrace/ip.d