Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Mar 1997 12:34:20 -0800
From:      John Polstra <jdp@polstra.com>
To:        Shawn Carey <smc@servtech.com>
Cc:        dyson@freebsd.org, hackers@freebsd.org
Subject:   Re: Anyone else seen this? 
Message-ID:  <199703282034.MAA04175@austin.polstra.com>
In-Reply-To: Your message of "Fri, 28 Mar 1997 00:46:57 EST." <333B5B51.41C67EA6@servtech.com> 
References:  <199703270427.XAA04344@dyson.iquest.net> <333AA089.41C67EA6@servtech.com> <199703280313.TAA28286@austin.polstra.com>  <333B5B51.41C67EA6@servtech.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> If I run the same executable under GDB, it runs for 10 seconds at the
> most and then GDB kills it before reporting "Process terminated due to
> text file modification".  No breakpoints, no nuthin.  Not even a
> .gdbinit.
> 
> Now, if I link with -static, the exectuable retains its timestamp, even
> whe run under GDB, and GDB lets it run peacefully.

It's worth noting that there are hooks between gdb and the dynamic
linker.  The dynamic linker can tell whether the program is being run
under the debugger or not.  If it is being run under the debugger, then
the dynamic linker itself sets a breakpoint in the executable, to allow
gdb to take control just after the shared libraries have all been
loaded.  So even if you don't explicitly set a breakpoint, one gets set
anyway.

> Any chance we have two unrelated but similar problems?

Sure.

> When I run my executable (linked against shared libs) directly from
> the shell (GDB not involved), the timestamp on the file changes
> every time, though it appears to run normally.

I suppose it is possible that (due to an error in "ld" perhaps) your
particular executable has the flag set that tells the dynamic linker the
program is running under gdb.  In that case, the dynamic linker would
again set a breakpoint.

Setting breakpoints shouldn't change the modtime of the file, of course,
since it's mapped copy-on-write.  So there still seems to be some sort
of VM problem, regardless of these other considerations.

John P.
--
   John Polstra                                       jdp@polstra.com
   John D. Polstra & Co., Inc.                Seattle, Washington USA
   "Self-knowledge is always bad news."                 -- John Barth



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703282034.MAA04175>