From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.devel Subject: When should ralloc.c be used? (WAS: bug#24358) Date: Fri, 21 Oct 2016 23:03:04 -0400 Message-ID: <87d1itt79z.fsf_-_@users.sourceforge.net> References: <87twe6sx2g.fsf@users.sourceforge.net> <87eg51ng4r.fsf_-_@users.sourceforge.net> <87k2djwumn.fsf@users.sourceforge.net> <83h98nidvd.fsf@gnu.org> <87eg3rvtsf.fsf@users.sourceforge.net> <83k2dihpm9.fsf@gnu.org> <8760p2wzgj.fsf@users.sourceforge.net> <838ttyhhzu.fsf@gnu.org> <871szqwu51.fsf@users.sourceforge.net> <831szqhbc2.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1477112079 19904 195.159.176.226 (22 Oct 2016 04:54:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 22 Oct 2016 04:54:39 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 22 06:54:36 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bxoKC-0003ZA-PY for ged-emacs-devel@m.gmane.org; Sat, 22 Oct 2016 06:54:28 +0200 Original-Received: from localhost ([::1]:35543 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxoKF-0004jX-3X for ged-emacs-devel@m.gmane.org; Sat, 22 Oct 2016 00:54:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxoK7-0004jA-Ni for emacs-devel@gnu.org; Sat, 22 Oct 2016 00:54:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxoK2-0008Ea-TW for emacs-devel@gnu.org; Sat, 22 Oct 2016 00:54:23 -0400 Original-Received: from mail-it0-x235.google.com ([2607:f8b0:4001:c0b::235]:36642) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bxoK2-0008EF-Og for emacs-devel@gnu.org; Sat, 22 Oct 2016 00:54:18 -0400 Original-Received: by mail-it0-x235.google.com with SMTP id e187so29994970itc.1 for ; Fri, 21 Oct 2016 21:54:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=FOLvACXYQG87KzEO5WKJXOgA6hOjm3c3jUTB3Q42x0Y=; b=pQZya/XpEPpaWjg55U1j0u3PDaOY0KRcwpnj9uoaCLMup/kLyCdrvRFN+03dB2613G CWvuFkPWNkQYrM3NJDm9bzIYIptqXk/f9UKMoLdRvru5yJDaNaAC8/LIn8QZ226sRuML i+HmkJKUuq7NvmK0GcRJosQMzqfBElQr/X2IH+OxswG1YiHTjmvpB2/eeOztQCpBLiHd NiMeA1Be5r0G3WvFTEF7c1a5Md6CL4uLvlJ2srHjBBNRDvnrEFZza+3kgtXZ5jhgqcx7 Y0OyAdUjKkZT8aqBtWi1PNqu0sMBVsa3bI9+1oq0hl2zO+7FqrU7R0uceqWi6vvA4COM RuoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:references:date :in-reply-to:message-id:user-agent:mime-version :content-transfer-encoding; bh=FOLvACXYQG87KzEO5WKJXOgA6hOjm3c3jUTB3Q42x0Y=; b=MSMhbzyrjHU/7yVMyioY6nG+J/1zyo1XYdaRJYODt3C7G4ctjvUDz7vEe0301FUBB3 r/T8mSb16qmQ9Si5y1VoWvdlZ1Oxa/PhnyNLyvpXnoygEzJ7FabNcOgr5QHAV92H28E6 MY0whutVk/xGOn0jdhjlzQiGvehvxL4O0Zz3Tq+AwZN5maOev3pkS0DKKRDyWbqYCUlY 33UEQMfRGi7DrCTctyHvbHtpyOC7XUCNG0VcwBADt6jZe9+r0oJto+DQzk6lRyztfg+w gEEGU/rWC0o5/TykBiZ70BAzfUMsCC+jmYYdaJJyADSPE1uibYprLhofsIv6isE0xio/ f7sg== X-Gm-Message-State: ABUngvcBXCK7uyQwrzLtywtMWab3Vqakn1H98IK6RRMotR2v5mCeULY/9u+NWXiUUZEZAg== X-Received: by 10.107.135.36 with SMTP id j36mr4076709iod.143.1477105346837; Fri, 21 Oct 2016 20:02:26 -0700 (PDT) Original-Received: from zony ([45.2.7.130]) by smtp.googlemail.com with ESMTPSA id u184sm564405ith.4.2016.10.21.20.02.26 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 21 Oct 2016 20:02:26 -0700 (PDT) In-Reply-To: <831szqhbc2.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 08 Oct 2016 22:47:41 +0300") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4001:c0b::235 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:208590 Archived-At: Eli Zaretskii writes: >> Thread 1 "emacs" hit Hardware watchpoint 4: current_buffer->text->beg >>=20 >> Old value =3D (unsigned char *) 0x18351b8 "" >> New value =3D (unsigned char *) 0x188a1b8 "" >> r_alloc_sbrk (size=3D290816) at ralloc.c:818 > > r_alloc_sbrk? What OS is this? We only use ralloc.c on a handful of > them, as of Emacs 25. Should ralloc.c be used on GNU/Linux systems that have GNU libc? I found this in my config.log (I think it's related to ralloc use, though I'm finding the configure code a bit confusing): configure:11440: checking whether malloc is Doug Lea style configure:11461: gcc -o conftest -O0 -g3 -march=3Dnative conftest.c= >&5=20 conftest.c: In function 'main': conftest.c:107:6: error: '__malloc_initialize_hook' undeclared (first u= se in this function) __malloc_initialize_hook =3D hook; ^~~~~~~~~~~~~~~~~~~~~~~~ It seems that my malloc.h does not declare __malloc_initialize_hook, even though 'man 3 malloc_hook' says #include void *(*__malloc_hook)(size_t size, const void *caller); void *(*__realloc_hook)(void *ptr, size_t size, const void *caller); void *(*__memalign_hook)(size_t alignment, size_t size, const void *caller); void (*__free_hook)(void *ptr, const void *caller); void (*__malloc_initialize_hook)(void); void (*__after_morecore_hook)(void); Perhaps this is because the recommended way to set this hook (which is different from what the configure test is using) doesn't require a declaration? The variable __malloc_initialize_hook points at a function that is c= alled once when the mal=E2=80=90 loc implementation is initialized. This is a weak variable, so it= can be overridden in the application with a definition like the following: void (*__malloc_initialize_hook)(void) =3D my_init_hook;