linux-user: fix multi-threaded /proc/self/maps
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): CAFEAcA-caVgBY3if2kVeLuwekiuFF0YLqHsuvBq=f6vWpBdW=g@mail.gmail.com
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): CAFEAcA8toSYefdtDz4m0O_RpMX7JVcszXN_hRn08wHH-dxt73g@mail.gmail.com
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): CAFEAcA8epaEQLpqHMM+D6wXxDOCxDoY0YPmJ=qHiVFDja44ewA@mail.gmail.com
Quoted 24 lines · Peter Maydell
Quoted 7 lines · Alexander Graf
Quoted 6 lines · Peter Maydell
Quoted 5 lines · Alexander Graf
Quoted 3 lines · Peter Maydell
So in the multithreaded case do all the thread stacks live in this one mapping, or do the non-primary thread stacks live in a standard mmap'd mapping?
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
I thought
/proc/self/mapsalways shows the initial stack map as [stack]?I dunno, I asked because I'm too lazy to check myself :-)
Same here. Mind to check? Your time zone fits this better atm ;)
So none of the processes on my system have more than one [stack] mapping, even the multithreaded ones. OTOH the kernel sources:
http://lxr.free-electrons.com/source/fs/proc/task_mmu.c#L262
indicate that it is possible for them to print [stack:TID] for a thread stack in some cases...However, I think your change is right, because the secondary threads ought to see the main process
/proc/self/mapsand that should show the main stack.
Quoted 8 lines
Q: I think the reason for the
#ifdefined(TARGET_ARM)||defined(TARGET_M68K)||defined(TARGET_UNICORE32)is becauselinux-user/main.conly sets upts->stack_base
on those targets. If we're not usingts->stack_base
any more can we drop the #if here?(more generally I wonder if we can drop
ts->stack_basecompletely in favour ofts->info->start_stack...)
Good point. Maybe?
Alex