Bug #2108

getcontext() is missing on DragonFly x86_64

Added by alexh over 6 years ago. Updated about 6 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


I'm seeing this when trying to build pkgsrc/net/powerdns-recursor.

Related issues

Blocks Bug #2286: 3.0 release catchall ticketClosed2012-01-22


#1 Updated by pavalos over 6 years ago

So a little history:

-On the initial import of amd64/x86_64, the functions existed.
-In July 2006 they were removed in 635872e06f82693646a8d979c423433fa839a656
because i386 didn't have them and they are marked obsolete.
-Then in January 2007, they were added for i386 in

So that's why they're there for i386 and not x86_64. The question is, do we
want them or not? They are completely removed from IEEE Std 1003.1-2008, but
there's still 3rd-party software that's using those functions. My vote is to
keep them and make them available to x86_64.

#2 Updated by swildner over 6 years ago

The original amd64 getcontext() we had in libc assumed it was a syscall.

The i386 version is libc only. So just bringing back the amd64 one we had won't

Someone will have to write a x86_64 libc only getcontext.S.

#4 Updated by dragonflybsd1 over 6 years ago

We need to bump this up in priority. On x86_64, every ruby package using ruby19-base is failing due to missing getcontext and makecontext on pkgsrc-current.

#5 Updated by dragonflybsd1 over 6 years ago

  • Priority changed from Normal to High

While researching why chat/gale failed, I discovered Boehm GC uses getcontext. So anything using this garbage collector will fail on X86_64.

#6 Updated by profmakx over 6 years ago

I dug up my seemingly working implementation of getcontext for x86_64 last weekend. The email to submit@ seems to have been lost. Anyway, the patch is available at

or in my git repository a3cb33319377734976008e240fded1e69ea07272,

I tested it with w3m, which uses boehm-gc, but had some issues with vkernels that stopped me from testing the other programs mentioned here. Heres a patch, feedback is appreciated.

#7 Updated by profmakx over 6 years ago

new commit in my git repository ref 1e29c3ebaaf978d191d581087167cd268268c106

#8 Updated by marino about 6 years ago

  • Assignee deleted (0)

Hmm, is this ready for testing?
I didn't see these update messages.
A new bulkbuild came in. The Ruby193 failure is worth 416 broken packages by itself.

This should be in Release 3.0 if it's good.

#9 Updated by profmakx about 6 years ago

I have a patch in my git repository that adds getcontext, setcontext, makecontext and swapcontext. However, testing this with puffs still segfaults the machine so there are issues. I welcome any testing/feedback though.

#10 Updated by profmakx about 6 years ago

commit 5f643fb7f2f5b3020964cfd507b9e8120c19535c in git:// now contains a patch that adds the functions in the context-family. I tested puffs, w3m and gale (compiling and running) and up to now i did not have any problems.

Would people please pull this patch and test a bit more intensively than I have time for at the moment?

#11 Updated by swildner about 6 years ago

  • Status changed from New to In Progress

I've committed Markus' implementation. Thanks!

Let's do some testing and if all looks good I'll MFC to 3.0.

#12 Updated by swildner about 6 years ago

  • Status changed from In Progress to Closed

Markus' work was pushed as 1b773b6ea04f3ba154036fa224a73207b22f8182 (master) and 98b8c7e1954b75b6607ab6f87a29ef5538a5fd37 (release).

Also available in: Atom PDF