DragonFlyBSD / DPorts

The dedicated application build system for DragonFly BSD
Other
89 stars 44 forks source link

sysutils/entr encounters a symbol clash in libc #84

Closed eradman closed 10 years ago

eradman commented 10 years ago

I tried running entr on 3.6.0 and found that it immediately segfaults. It turns out that defining _open clashes with a symbol of the same name in libc. I can reproduce the issue using this test program:

#include <fcntl.h>

int (*_open)(const char *path, int flags, ...);

int main(int argc, char *argv[]) {
        _open = open;
        return 0;
}

Is there a known workaround for such a clash?

In the meantime I've updated the source at http://bitbucket.org/eradman/entr/ by renaming each function that begins with an underscore.

jrmarino commented 10 years ago

From context, I take it you are the author of entr?

If so, if a new release of entr was made, and introduced into ports, then the fix would trickle down to DPorts in 2-3 weeks.

Barring a release, entr would have to have patches added to the /files subdirectory.

eradman commented 10 years ago

Yes, I should have clarified that, I'm the author of entr. Thanks for the response, cutting a new release is easy enough, we'll do that.

I suppose I was really just logging this scenario in case this has happened before. If not, the lesson is that there is an unwritten rule that it's not safe to alias system calls using an underscore!

jrmarino commented 10 years ago

The port is maintained by danilo who is a very active new committer. If, after the release, you write a PR ( http://www.freebsd.org/send-pr.html ) with "sysutils/entr" in the title, he'll be automatically notified. Just let him know a new release exists and what it fixes and it should be in ports pretty quickly. Thanks!

eradman commented 10 years ago

The FreeBSD port has been updated. I also send in a patch to run the unit tests:

regression-test: build
        @(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} -f ${MAKEFILE} ${MAKE_ARGS} test)

Is this the recommended test target?

jrmarino commented 10 years ago

I don't know of any standard target. "make regression-test" is as good as any. It will only be run manually but that's fine. Theoretically it only needs to be run once per platform per arch per release, right?

eradman commented 10 years ago

From a recent discussion on IRC: other BSD distributions also ship packages without running tests because too many are brittle.