Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

fix FBSD shared library issues #1333

Merged
merged 7 commits into from Aug 17, 2015

Conversation

MartinNowak
Copy link
Member

  • add tests for module collision check
  • fix copy relocation check so it can deal with
    __bss_start/_end being defined in a DSO
  • workaround FBSD bug (Issue 14824)
  • reenable druntime-debug unittests

@jmdavis
Copy link
Member

jmdavis commented Jul 25, 2015

Well, I don't know if this was supposed to fix all of the shared library bugs that have been reported for FreeBSD or not, but these changes seem to fix https://issues.dlang.org/show_bug.cgi?id=14776. However, I'm still hitting https://issues.dlang.org/show_bug.cgi?id=14663 on my FreeBSD 10 system, and it looks like the tests are failing on several platforms on the autotester (including on Linux) - around the load_mod_collision test it looks like, which is after the link_linkdep test that is failing on my FreeBSD 10 system.

So, as far as the systems on the auto tester go, you seem to have fixed the issue with FreeBSD and debug builds while creating a new one, and the problem that was failing on FreeBSD 10 in release builds is still failing (and debug builds now hit the same failure instead of the one they were hitting before).

But thank you for looking into this. I was afraid that I was going to have to start looking into the shared library issues, since I've been using FreeBSD of late, but I know nothing about how the shared library support works. And technically, FreeBSD 8.x will be at End-of-Life come August, so without shared library support getting fixed in FreeBSD 9 and/or 10, we soon won't actually be able to successfully run the druntime unit tests on a supported FreeBSD system (which of course doesn't say good things about how well it actually works on those systems). :(

@MartinNowak
Copy link
Member Author

around the load_mod_collision test it looks like,

The test itself works fine, but it seems that the tester doesn't like the pre-pipe command fail with a segfault (assert(0)).

@MartinNowak MartinNowak force-pushed the fixRuntimeLoading branch 4 times, most recently from 8f052a6 to e6a39a2 Compare July 26, 2015 14:21
@MartinNowak
Copy link
Member Author

Found the linux issue. The distribution on the auto-tester links with --as-needed by default, and b/c it isn't used by link_mod_collision lib.so was not linked.

- fixes Issue 14776 - shared library test - loadDR - segfaults on FreeBSD 10

- the executable might not define _end or __bss_start
  in which case they'll resolve to within the shared
  druntime library

- skip copy relocation check when we can't determine the
  copy reloc section b/c druntime was dynamically loaded

- copy relocations can't occur when dynamically loading a
  library anyhow

- checkModuleCollisions only needed for version (Shared) druntime build
- A bug in FBSD's rtld will lead to a crash when
  calling a function over an PLT entry that was
  previously resolved to a now unloaded dynamic
  library.
- to avoid a segfault/bus error
- enforces the linking of lib.so even though the lib isn't used
@MartinNowak
Copy link
Member Author

Please don't let that bitrot, it's kinda difficult to load this topic into my head.

@DmitryOlshansky
Copy link
Member

Sadly have no idea about this part of druntime. Everything sans the first commit is simple and makes sense. The bulk of changes for copy relocations better be reviewed by somebody competent.

@DmitryOlshansky
Copy link
Member

Auto-merge toggled on

@DmitryOlshansky
Copy link
Member

It's been hanging for a while here and on trello so I guess nobody can be bothered to double check it

DmitryOlshansky added a commit that referenced this pull request Aug 17, 2015
@DmitryOlshansky DmitryOlshansky merged commit 8663f53 into dlang:master Aug 17, 2015
@MartinNowak MartinNowak deleted the fixRuntimeLoading branch August 17, 2015 19:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants