Re: [Uclinux-dist-devel] [PATCH] NOMMU: Add '[stack]' label to /proc/pid/maps output

From: Mike Frysinger
Date: Fri Jun 04 2010 - 19:01:47 EST


On Fri, Jun 4, 2010 at 16:48, Andrew Morton wrote:
> On Tue, 01 Jun 2010 19:59:37 +0100 David Howells wrote:
>> From: Mike Frysinger <vapier@xxxxxxxxxx>
>>
>> Add support to the NOMMU /proc/pid/maps file to show which mapping is the stack
>> of the original thread after execve. ÂThis is largely based on the MMU code.
>> Subsidiary thread stacks are not indicated.
>>
>> For FDPIC, we now get:
>>
>> Â Â Â root:/> cat /proc/self/maps
>> Â Â Â 02064000-02067ccc rw-p 0004d000 00:01 22 Â Â Â Â /bin/busybox
>> Â Â Â 0206e000-0206f35c rw-p 00006000 00:01 295 Â Â Â Â/lib/ld-uClibc.so.0
>> Â Â Â 025f0000-025f6f0c r-xs 00000000 00:01 295 Â Â Â Â/lib/ld-uClibc.so.0
>> Â Â Â 02680000-026ba6b0 r-xs 00000000 00:01 297 Â Â Â Â/lib/libc.so.0
>> Â Â Â 02700000-0274d384 r-xs 00000000 00:01 22 Â Â Â Â /bin/busybox
>> Â Â Â 02816000-02817000 rw-p 00000000 00:00 0
>> Â Â Â 02848000-0284c0d8 rw-p 00000000 00:00 0
>> Â Â Â 02860000-02880000 rw-p 00000000 00:00 0 Â Â Â Â Â[stack]
>>
>> The semi-downside here is that for FLAT, we get:
>>
>> Â Â Â root:/> cat /proc/155/maps
>> Â Â Â 029f0000-029f9000 rwxp 00000000 00:00 0 Â Â Â Â Â[stack]
>>
>> The reason being that FLAT combines a whole lot of stuff into one map
>> (including the stack). ÂBut this isn't any worse than the current output (which
>> is nothing), so screw it.
>
> So it's a non-back-compatible change which can a) break nommu-only
> userspace and b) unbreak mmu-tested userspace which gets run on nommu.

i dont see how it breaks anything really. any code that parses the
maps file has to account for an optional label in the maps output.

i guess if someone wrote some code that does something special with
"[stack]", then behavior would change with FLAT files, but that's
pretty unlikely i would think. plus, FLAT is not ELF and as such, its
layout in memory is highly unlike any existing ELF layout. so someone
would already have to be writing a custom handler for FLAT files which
means they account for the "one blob is everything" layout.
-mike
--
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/