/proc/<pid>/maps syntax

From: Boehm, Hans
Date: Wed Jul 27 2005 - 13:53:09 EST


FYI -

[I'm not subscribed the kernel list.]

The syntax for /proc/<pid>/maps as exported by
the Linux kernel changed around August 2003.
The layout of individual lines used to start
with a bunch of fixed width fields (mostly addresses).
It no longer does on 64-bit platforms. This
introduced subtle breakage in our garbage collector.
I'll post a patch shortly, though it seems to cause
problems mostly in nonstandard configurations.

I copied the kernel list, since I'd like to

a) Encourage better documentation of such formats
(as if I didn't have that problem).

b) Possibly encourage consideration of other alternatives
in future issues along these lines.

Presumably this was done, so that 32-bit apps could
decode /proc/self/maps?

The down side is that

a) It broke some existing 64-bit code.

b) We ended up with an inferior format in the long run.
Both the fixed-field width format, and a hypothetical
alternative with no leading zeroes, have advantages in
speeding up parsing. The latter is shorter, and probably
easier to generate. The current hybrid seems to lose
both benefits.

Perhaps the documentation should clearly state that
address and offset fields may or may not have leading zeroes,
and declare the intent to eventually remove the remaining
leading zeroes? I think that would have no impact on a sane
parser that wasn't already broken by the last change?

Hans
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/