all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Locking temporary files?
@ 2013-08-04 16:05 Eli Zaretskii
  2013-08-04 16:58 ` Paul Eggert
  0 siblings, 1 reply; 2+ messages in thread
From: Eli Zaretskii @ 2013-08-04 16:05 UTC (permalink / raw)
  To: emacs-devel

I discovered that when we invoke call-process-region, we lock the
temporary file used as input for the sub-process.  The lock happens
inside write-region.  Here's the relevant portion of a backtrace
showing the call sequence:

  #0  mkostemp (
      template=0x82aa00 "c:/DOCUME~1/USERNAME/LOCALS~1/Temp/.#-emacsXXXXXX",
      flags=32896) at w32.c:3448
  #1  0x01110deb in create_lock_file (
      lfname=0x82cb50 "c:/DOCUME~1/USERNAME/LOCALS~1/Temp/.#ema02336",
      lock_info_str=0x82aae0 "eliz@HOME-C4E4A596F7.1840:1375370886",
      force=false) at filelock.c:417
  #2  0x01111027 in lock_file_1 (
      lfname=0x82cb50 "c:/DOCUME~1/USERNAME/LOCALS~1/Temp/.#ema02336",
      force=false) at filelock.c:482
  #3  0x01111598 in lock_if_free (clasher=0x82cbe0,
      lfname=0x82cb50 "c:/DOCUME~1/USERNAME/LOCALS~1/Temp/.#ema02336")
      at filelock.c:636
  #4  0x01111813 in lock_file (fn=270669553) at filelock.c:720
  #5  0x01127532 in Fwrite_region (start=4, end=3424, filename=270669553,
      append=53446682, visit=53501050, lockname=270669553, mustbenew=53446682)
      at fileio.c:4875
  #6  0x011cba54 in create_temp_file (nargs=8, args=0x82f584) at callproc.c:1062
  #7  0x011cbb30 in Fcall_process_region (nargs=8, args=0x82f584)
      at callproc.c:1119

Locking temporary files sounds redundant, doesn't it?



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Locking temporary files?
  2013-08-04 16:05 Locking temporary files? Eli Zaretskii
@ 2013-08-04 16:58 ` Paul Eggert
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggert @ 2013-08-04 16:58 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

On 08/04/2013 09:05 AM, Eli Zaretskii wrote:
> Locking temporary files sounds redundant, doesn't it?

Yes it does.  I'm working on a patch that should fix this,
along with the races I discovered in that area.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-08-04 16:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-04 16:05 Locking temporary files? Eli Zaretskii
2013-08-04 16:58 ` Paul Eggert

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.