Loading ...
Sorry, an error occurred while loading the content.

16578Re: sigaltstack

Expand Messages
  • Bram Moolenaar
    Dec 1, 2000
    • 0 Attachment
      Matthew Hawkins wrote:

      [Note: this is about FreeBSD]

      > I've just subscribed but found this thread in the archives. Sorry about
      > the lack of References: but obviously I don't have the originals ;)
      >
      > Anyway my problem is identical, but I have some further insight Bram and
      > Johannes missed.
      >
      > Johannes is linking against libpython, has obviously compiled it with
      > thread support, and hence -pthread is added to the gcc command line.
      > This makes gcc use libc_r.so, not libc.so, obviously because threaded
      > applications will need the reentrant versions of the functions.
      >
      > The trick is, libc_r does not have sigaltstack(). nm the library.
      > To complicate matters further, it also does not have sigstack() which
      > means simply undefining HAVE_SIGALTSTACK and hence using the alternative
      > init_signal_stack() code will not work.
      >
      > I guess one solution is to compile python without threads support. I
      > doubt this will make for happy python campers ;)
      >
      > Any ideas for a real solution? This hits FreeBSD 4.2 with Python 2.0 as
      > well (aka, my box ;).

      I recently dived into this problem and discovered what you already knew. I've
      reported a problem with sigaltstack to GNATS, a patch was made by Marcel
      Moolenaar (no relative). Don't know in which release it will appear (probably
      just missed 4.2).

      I've now changed configure to do the test for the presence of sigaltstack()
      with the right library. That means when Vim is compiled with Python, it won't
      use sigaltstack(). But it does compile.

      It's now also possible to run Vim with Perl and Python at the same time.
      I noticed that for Perl "-lc" was added to the linker line, making Vim use
      libc instead of libc_r. This caused weird problems when running Vim
      (compilation didn't complain, which was very confusing!). Lesson learned: you
      can't link with libc if you compiled with -D_THREAD_SAFE.

      You'll see it in version 6.0o in a few days. First have to finish
      reading/writing Unicode files with a BOM...

      --
      ARTHUR: Well, I AM king...
      DENNIS: Oh king, eh, very nice. An' how'd you get that, eh? By exploitin'
      the workers -- by 'angin' on to outdated imperialist dogma which
      perpetuates the economic an' social differences in our society! If
      there's ever going to be any progress--
      The Quest for the Holy Grail (Monty Python)

      /// Bram Moolenaar Bram@... http://www.moolenaar.net \\\
      \\\ Vim: http://www.vim.org ICCF Holland: http://iccf-holland.org ///
    • Show all 12 messages in this topic