unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
Cc: Emacs Devel <emacs-devel@gnu.org>
Subject: Re: Core dumps in redisplay.
Date: Mon, 28 Feb 2005 18:46:28 +0100	[thread overview]
Message-ID: <x5650cfuh7.fsf@lola.goethe.zz> (raw)
In-Reply-To: <854df3d393258d420a5f4a60c87f6ea0@swipnet.se> (Jan D.'s message of "Mon, 28 Feb 2005 18:15:25 +0100")

"Jan D." <jan.h.d@swipnet.se> writes:

>> "Jan D." <jan.h.d@swipnet.se> writes:
>>
>>>>
>>>> This sounds like normally only the main thread should ever be
>>>> touching
>>>> interrupt_input_blocked, unless we have a bug.  Correct?  So we need
>>>> not think about how to synchronize accesses to the variable, but
>>>> rather make sure that no thread except the main thread will ever run
>>>> code touching it.  Correct?
>>>>
>>>> A use of BLOCK_INPUT or UNBLOCK_INPUT outside of the main thread is a
>>>> bug.  Correct?
>>>
>>> Yes times three.
>>
>> xmalloc uses BLOCK_INPUT.  BLOCK_INPUT is rather often used in alloc.c.
>
> Yes, there is a check for main thread there also, see macros
> (UN)BLOCK_INPUT_ALLOC.

This is a bad joke, right?  BLOCK_INPUT_ALLOC makes sure that it uses
BLOCK_INPUT only in the main thread, using a semaphore elsewhere.  So
far, so nice.  And BLOCK_INPUT_ALLOC hooks into malloc, free and
realloc.

But xmalloc and all related routines use BLOCK_INPUT nevertheless.  So
it is obvious that although malloc seemingly can be used (given _BOTH_
PTHREAD and GTK) without problems, all uses of xmalloc still are
flawed in the old way.

So we still can't allow using xmalloc except in the main thread.  What
is the design?  Should xmalloc be usable outside of the main thread or
not?

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

  reply	other threads:[~2005-02-28 17:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-26 13:40 Core dumps in redisplay David Kastrup
2005-02-27 13:43 ` Richard Stallman
2005-02-27 18:56   ` David Kastrup
2005-02-27 20:08     ` Jan D.
2005-02-27 20:21       ` David Kastrup
2005-02-27 20:35         ` Jan D.
2005-02-27 21:28           ` David Kastrup
2005-02-27 22:08             ` Kim F. Storm
2005-02-28  5:34             ` Jan D.
2005-02-28 10:38               ` David Kastrup
2005-02-28 17:15                 ` Jan D.
2005-02-28 17:46                   ` David Kastrup [this message]
2005-02-28 19:09                     ` Jan D.
2005-02-28 19:38                       ` David Kastrup
2005-02-28 20:05                         ` Jan D.
2005-02-28 20:29                           ` David Kastrup
2005-02-28 17:14               ` David Kastrup
2005-02-28 14:49             ` Richard Stallman
2005-03-04 18:54               ` Jan D.
2005-02-27 21:51     ` Stefan Monnier
2005-02-27 22:36       ` David Kastrup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=x5650cfuh7.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).