Bug 227312

Summary: lang/perl5* Fails to configure DTRACE=on when CTF info contains > 2^15 entries
Product: Ports & Packages Reporter: Keith Beattie <ksbeattie>
Component: Individual Port(s)Assignee: freebsd-perl mailing list <perl>
Status: Open ---    
Severity: Affects Some People CC: bagas1983, jtkoerting, koobs, leres, mikhail.rokhin, perl, tatsuki_makino
Priority: --- Flags: bugzilla: maintainer-feedback? (perl)
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224857
Bug Depends on: 232675    
Bug Blocks:    

Description Keith Beattie 2018-04-06 00:30:41 UTC
Note that this works for perl5.2.4, this is failing for perl5.26:

Support DTrace if available? [y]  
Where is the dtrace executable? (~name ok) [/usr/sbin/dtrace]  

*** Configure:  Fatal Error:  /usr/sbin/dtrace doesn't support -h flag
*** Your installed dtrace doesn't support the -h switch to compile a D
*** program into a C header. Can't continue.

===>  Script "Configure" failed unexpectedly.

Also note that files/patch-dtrace exists for perl5.24 but does not for perl5.26
Comment 1 Mathieu Arnold freebsd_committer 2018-04-06 08:00:48 UTC
I cannot reproduce, the issue. On all 11.1, dtrace has a -h.  Does not your dtrace has a -h option ?

The patch-dtrace file was removed in January of 2017 because the dtrace support was fixed between Perl 5.25.8 and Perl 5.25.9, so it has always worked out of the box in Perl 5.26.
Comment 2 Keith Beattie 2018-04-06 16:42:55 UTC
Indeed my dtrace does have the -h option.  Digging into the test that fails during the perl5.26 build, (which is at line 8208 of ./work/perl-5.26.1/Configure on my machine) then trying it manually, I see a different error:

# dtrace -h -s ./work/perl-5.26.1/perldtrace.d -o  perldtrace.tmp
dtrace: failed to compile script ./work/perl-5.26.1/perldtrace.d: "/usr/lib/dtrace/mbuf.d", line 114: syntax error near "caddr_t"

Googling that, this appears to be related to bug #224857, the last comment there pointing to a suggestion to enable

  makeoptions   DEBUG=-g                # Build kernel with gdb(1) debug symbols

in the kernel conf file, which I have had commented out for many years now.  I'll rebuild and see if that fixes this, though that still seems like a bug to me.
Comment 3 Keith Beattie 2018-04-06 20:56:15 UTC
Ok, rebuilding a new kernel with debug symbols has fixed it.  That seems like an undesirable situation where dtrace usage depends on kernel debug symbols being in place.  It wasn't the case before, as I've had that option commented out for a long while now.  Is that worth another PR?

At least this is a workaround for now.  Thanks for your help.
Comment 4 James T. Koerting 2018-05-23 00:13:24 UTC
No bug. All you need is to have several kernel files in /boot/kernel.

To see what's needed, just try a

truss dtrace -h

to see what .ko files dtrace wants to access.

# truss dtrace -h 2>&1 | grep kernel
openat(AT_FDCWD,"/boot/kernel/kernel",O_RDONLY,00) = 3 (0x3)
openat(AT_FDCWD,"/boot/kernel/accf_data.ko",O_RDONLY,00) = 3 (0x3)
openat(AT_FDCWD,"/boot/kernel/accf_http.ko",O_RDONLY,00) = 3 (0x3)
openat(AT_FDCWD,"/boot/kernel/mac_portacl.ko",O_RDONLY,00) = 3 (0x3)
openat(AT_FDCWD,"/boot/kernel/cc_htcp.ko",O_RDONLY,00) = 3 (0x3)
openat(AT_FDCWD,"/boot/kernel/ulpt.ko",O_RDONLY,00) = 3 (0x3)
openat(AT_FDCWD,"/boot/kernel/nullfs.ko",O_RDONLY,00) = 3 (0x3)
openat(AT_FDCWD,"/boot/kernel/tmpfs.ko",O_RDONLY,00) = 3 (0x3)
openat(AT_FDCWD,"/boot/kernel/fdescfs.ko",O_RDONLY,00) = 3 (0x3)
Comment 5 bagas 2018-10-27 06:33:57 UTC

I have such a mistake.
Deleted completely with dependences pearl 5.24
pkg_deinstall -rR perl5
I try to install from ports pearl5.26.
root@FIL_ELI:/usr/ports/lang/perl5.26 # make install clean
Until this bug is not fixed?


Support DTrace if available? [y]
Where is the dtrace executable? (~name ok) [/usr/sbin/dtrace]

*** Configure:  Fatal Error:  /usr/sbin/dtrace doesn't support -h flag
*** Your installed dtrace doesn't support the -h switch to compile a D
*** program into a C header. Can't continue.

===>  Script "Configure" failed unexpectedly.
Please report the problem to mat@FreeBSD.org [maintainer] and attach the
"/usr/ports/lang/perl5.26/work/perl-5.26.2/config.log" including the output
of the failure of your make command. Also, it might be a good idea to provide
an overview of all packages installed on your system (e.g. a
/usr/local/sbin/pkg-static info -g -Ea).
*** Error code 1

make[1]: stopped in /usr/ports/lang/perl5.26
*** Error code 1

make: stopped in /usr/ports/lang/perl5.26
Comment 6 mikhail.rokhin 2018-11-05 16:42:03 UTC
Confirm at CURRENT amd64 (rv 340151) the same bug with dtrace

# dtrace -h
dtrace: failed to establish error handler: "/usr/lib/dtrace/ip.d", line 112: failed to copy typedef in6_addr_t source type: Type information is in parent and unavailable

leading to failure at perl5.26.2 compilation with dtrace option "on"
Comment 7 mikhail.rokhin 2018-11-05 18:44:58 UTC
bug #232995
Comment 8 Tatsuki Makino 2018-12-24 04:12:46 UTC
I also encountered the same error when building with poudriere jail.

FreeBSD: 10.4-STABLE amd64 (r341607)
portstree: Revision: 488252
Perl: lang/perl5.28

This is just information because I am using an unsupported version of FreeBSD.
Comment 9 Tatsuki Makino 2018-12-24 04:42:58 UTC
Continuation of comment #8. I entered the powder keg in interactive mode and tried next.

tar -x -f /distfiles/perl/perl-5.28.1.tar.xz -C /tmp/
cd /tmp/
dtrace -h -s perl-5.28.1/perldtrace.d -o perldtrace.tmp

I got the following error message.

dtrace: failed to compile script perl-5.28.1/perldtrace.d: "/usr/lib/dtrace/psinfo.d", line 37: syntax error near "uid_t"

However, FreeBSD version is old.
Comment 10 Kubilay Kocak freebsd_committer freebsd_triage 2019-05-28 05:24:33 UTC
The root cause of this appears to be bug 232675, affecting any kernel/version where CTF info ever contains > 2^15 entries