Originally Posted by pike87
Suppose, I debug a *nux application and put a breakpoint into a function defined by a dynamically linked used by the application. Will that breakpoint stop any other application that makes use of the same library?
No. When your process (or the debugger for your process) writes to a page of the shared area, the kernel copies that whole page (4096 bytes) to give your process a private copy of that page.
Originally Posted by Ygrex
sure, other applications should stop by a contagion magic
Sarcasm really wasn't called for. If you know the basics of how shared objects work and you know the basics of how breakpoints work, you would have legitimate reason to be concerned about the issue the OP raised.
Most code pages of a .so are shared
by all processes using that .so at the same time. Breakpoints are implemented by the debugger changing a byte of an instruction into a breakpoint instruction. So it is normal to wonder why those two facts don't combine to put that breakpoint instruction into the address space of every process using that .so.
There are a number of different situations in Linux in which a page of virtual memory is shareable by multiple processes as long as none of them write to it, but any process writing to the page gets a private copy. I don't know the exact details of how that mechanism is used for breakpoints in .so mappings, but that is the basic concept.