[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#504699: libc6: makecontext() on AMD64 does not handle pointers; docs do not make this clear



Package: libc6
Version: 2.7-15
Severity: normal


makecontext() on AMD64 cannot pass pointer arguments to the invoked
function; they get squashed to 32bit values, ignoring the top bits.

I'm aware that the POSIX spec doesn't require the ability to pass
pointers, though it isn't all that clear on the subject.

I've had a variety of C programmers read the makecontext(3) manpage, and
most of them didn't spot the fact it can't do pointers until I
specifically mentioned this fact. The current documentation is
insufficiently clear on the subject.

I'd like to propose either:

 a) Extending makecontext() on AMD64 so it can pass pointers, and add a
    section to the manpage to explain that you cannot portably do this,
    but GNU libc happens to allow it,

or

 b) Explain in the manpage that GNU libc cannot pass pointers.

Naturally I'd prefer option a because that is more useful; without the
ability to pass a pointer, it becomes much harder to actually use the
function to perform useful work in real programs, aside from the tiny
trivial examples usually given.


-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libc6 depends on:
ii  libgcc1                       1:4.3.2-1  GCC support library

libc6 recommends no packages.

Versions of packages libc6 suggests:
pn  glibc-doc                     <none>     (no description available)
ii  locales                       2.7-15     GNU C Library: National Language (

-- debconf information:
  glibc/upgrade: true
  glibc/restart-failed:
  glibc/restart-services:



Reply to: