Page MenuHomeFreeBSD

devel/qt5-core: Add a patch that fixes QLockFilePrivate::processNameByPid() function to return non-truncated name.
ClosedPublic

Authored by arrowd on Jun 6 2018, 10:02 AM.

Details

Summary

String returned from sysctl() can't be longer than COMMLEN (19) symbols, so it returns bogus data for processes with long file name.
Use kvm and procstat librarires to obtain correct name and only use sysctl as a fallback.

Test Plan

make check for qlockfile passes.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

arrowd created this revision.Jun 6 2018, 10:02 AM
arrowd updated this revision to Diff 43356.Jun 6 2018, 11:00 AM

Add missing patch.

You need to bump the PORTTREVISION too.

tcberner added inline comments.Jun 6 2018, 7:29 PM
devel/qt5-core/files/patch-src_corelib_io_qlockfile__unix.cpp
16 ↗(On Diff #43356)

^ shouldn't there be some chekc on the return value of kvm_open?

59 ↗(On Diff #43356)

^ name is already defined on line 49.

arrowd updated this revision to Diff 43419.Jun 7 2018, 3:28 PM
  • Error handling
  • Bump PORTREVISION
arrowd marked an inline comment as done.Jun 7 2018, 3:29 PM
arrowd marked an inline comment as done.Jun 7 2018, 3:50 PM
arrowd updated this revision to Diff 43420.Jun 7 2018, 3:51 PM
  • Fix redifinition.
rakuco added a subscriber: rakuco.Jun 7 2018, 10:01 PM
rakuco added inline comments.
devel/qt5-core/files/patch-src_corelib_io_qlockfile__unix.cpp
11 ↗(On Diff #43420)

Isn't it easier to just add a freebsd condition in the else block below?

} else {
  SOURCES += ...
  freebsd {
    LIBS += lkvm -lprocstat
  }
}
34 ↗(On Diff #43420)

Style: the * needs to be next to kp (this applies to the other pointer declarations below too).

50 ↗(On Diff #43420)

Style: this should've been part of the previous line.

68 ↗(On Diff #43420)

Same here.

arrowd updated this revision to Diff 43451.Jun 8 2018, 12:18 PM
arrowd marked 4 inline comments as done.
  • Address rakuco's comments.

If @rakuco has nothing more to add, it looks fine to me.

Looks OK to me. It'd be good to clean this up and submit the patch upstream later.

tcberner accepted this revision.Jun 12 2018, 5:43 AM
This revision is now accepted and ready to land.Jun 12 2018, 5:43 AM
This revision was automatically updated to reflect the committed changes.
cmt added a subscriber: cmt.Jun 12 2018, 1:18 PM

The patch file (148 lines) contains the same 74 line patch twice, thus the build doesn't even start because of "patch failed".