From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dan Kegel Newsgroups: gmane.lisp.guile.user Subject: Re: guile 2.2.3 crashing on osx 10.11? Date: Mon, 1 Jan 2018 10:25:46 -0800 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1514831063 29104 195.159.176.226 (1 Jan 2018 18:24:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 1 Jan 2018 18:24:23 +0000 (UTC) Cc: guile-user@gnu.org To: Matt Wette Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Jan 01 19:24:19 2018 Return-path: Envelope-to: guile-user@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 1eW4ku-0006o9-OW for guile-user@m.gmane.org; Mon, 01 Jan 2018 19:24:13 +0100 Original-Received: from localhost ([::1]:38908 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eW4mt-0004GX-LT for guile-user@m.gmane.org; Mon, 01 Jan 2018 13:26:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eW4mT-0004FY-SO for guile-user@gnu.org; Mon, 01 Jan 2018 13:25:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eW4mS-0001D6-IU for guile-user@gnu.org; Mon, 01 Jan 2018 13:25:49 -0500 Original-Received: from mail-pl0-x231.google.com ([2607:f8b0:400e:c01::231]:40558) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eW4mS-0001Cv-9k for guile-user@gnu.org; Mon, 01 Jan 2018 13:25:48 -0500 Original-Received: by mail-pl0-x231.google.com with SMTP id 62so25785624pld.7 for ; Mon, 01 Jan 2018 10:25:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=nKeYsA/+IkA1TWm8qokr7nBOV7MwAnLyp0bTG3b4iWA=; b=HI7hA9WPBe1eJ7V5hwIEMEQTcq2nc/4unP3gogBOmYLaSU4fUSyJxS5LQ5BeCFezAg p8A6mBoKUJf4lL+G3GT8hZ59ITfK4iu7OKRMlYCfHaOvPPGeW4fGtlvvaRmAWrcJ02K/ Mlm/c7B+4LAH6iI6ZRyel9ydV9P4SeYv2rFjCDJY6f3KDaAkt6jRVIrmXHgBkANscONk 18G7PxUliDqwK/15ysmkYIuRTFMK8yolaL6bDIF4AoaT1Wepxkybv/n7hPu1ay6D84H7 oUGR1R2Q8cLo6r4BVOsCZDOzdGzMTGvSNf7r0qnPf2UtmzBGDjYFzlbwL5TsQ5M+5aYf Rtdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=nKeYsA/+IkA1TWm8qokr7nBOV7MwAnLyp0bTG3b4iWA=; b=YrklDrALwcaScbDXGnzWPb/F++FiwgXGB9rQV1Kt0CbVzlTYbekdP8PkS11VXMBIno e7kWJb97MVOi21rYi8iAPpvkiRTsYRZwa0hLUG4if3ms+OKEGnS3a+Al6PE69HKsbw/y y2ufQjTVDSSVgz8x39bhuUyvYJbJOqJJKgIavNvZj5zlAVSc9BMcxs//mUqwlzdef3jx XAnVdY2LidaKmSJi1bQEz5YQfvo6MXyIcNcXSsRddk6s7rWMVWTk3fLGnou1w42RRtDO 9IGUtk28WzbP+uQv0cAO0OfNmEUb1LlrzYAwChiT7OLNWm9Yepr09jsEPPHdJHcMmhM9 B90Q== X-Gm-Message-State: AKGB3mJlmlI6ppW1ppzqL66cTzWyR8aC5KzWt6OahZ/9rsvR9r5p0PGU 6ORu4ZOF/LTSH5oEOnCFvcNfXxjQP5F+E69HSio= X-Google-Smtp-Source: ACJfBouln5hSWOtawdyw8X1kGBWTW980LSAlyNKLFH8Pq2zqXGJC6jJMkIxtPO/2ECuSunavaGs/e7uauJq1AVmaSwo= X-Received: by 10.159.216.141 with SMTP id s13mr45022958plp.310.1514831147083; Mon, 01 Jan 2018 10:25:47 -0800 (PST) Original-Received: by 10.100.170.79 with HTTP; Mon, 1 Jan 2018 10:25:46 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: _rttKacUd2Vo7H9_6fvGL-Qu2NI X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::231 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:14398 Archived-At: So, for completeness, here's why guile was crashing instantly in gmp on some machines for me. If you build and run everything on the same machine, none of this is likely to affect you; this is only for the case where each library is built by a random machine from a buildbot pool. I had been paying attention to the AVX1.0 divide across our buildbot fleet, and arranged to segregate MacPro5,1 machines off in their own pool, to avoid crashes from vxorps (an AVX instruction) in ImageMagick; here's the output of sysctl -n hw.model machdep.cpu.brand_string machdep.cpu.features on our machines, with boring bits removed: MacPro5,1 E5620 SMX SSE4.2 MacBookPro8,2 i7-2720QM SMX SSE4.2 x2APIC XSAVE OSXSAVE TSCTMR AVX1.0 Macmini6,2 i7-3615QM SSE4.2 x2APIC XSAVE OSXSAVE TSCTMR AVX1.0 RDRAND F16C MacBookPro9,1 i7-3720QM SMX SSE4.2 x2APIC XSAVE OSXSAVE TSCTMR AVX1.0 RDRAND F16C MacBookPro11,2 i7-4870HQ SMX FMA SSE4.2 x2APIC MOVBE XSAVE OSXSAVE SEGLIM64 TSCTMR AVX1.0 RDRAND F16C MacBookPro11,2 i7-4960HQ SMX FMA SSE4.2 x2APIC MOVBE XSAVE OSXSAVE SEGLIM64 TSCTMR AVX1.0 RDRAND F16C MacBookPro11,5 i7-4980HQ SMX FMA SSE4.2 x2APIC MOVBE XSAVE OSXSAVE SEGLIM64 TSCTMR AVX1.0 RDRAND F16C MULX is a nice Intel instruction that was introduced in 2013 in non-low-end Haswell chips. https://software.intel.com/sites/default/files/m/f/7/c/36945 says one detects it like this: CPUID.(EAX=07H, ECX=0H):EBX.BMI2[bit 8]: if 1 indicates the processor supports the second group of advanced bit manipulation extensions (BZHI, MULX, PDEP, PEXT, RORX, SARX, SHLX, SHRX); http://publicclu2.blogspot.com/2013/05/flags-in-x86-linuxs-proccpuinfo.html clarifies that, on Linux, /proc/cpuinfo will contain the string BMI2 if MULX is present. This evidently is also true of sysctl -n machdep.cpu.leaf7_features on mac, which says: MacPro5,1 E5620 MacBookPro8,2 i7-2720QM Macmini6,2 i7-3615QM SMEP ERMS RDWRFSGS MacBookPro9,1 i7-3720QM SMEP ERMS RDWRFSGS MacBookPro11,2 i7-4870HQ SMEP ERMS RDWRFSGS TSC_THREAD_OFFSET BMI1 HLE AVX2 BMI2 INVPCID RTM MacBookPro11,2 i7-4960HQ SMEP ERMS RDWRFSGS TSC_THREAD_OFFSET BMI1 HLE AVX2 BMI2 INVPCID RTM FPU_CSDS MacBookPro11,5 i7-4980HQ SMEP ERMS RDWRFSGS TSC_THREAD_OFFSET BMI1 AVX2 BMI2 INVPCID FPU_CSDS which means I have three basic groups: 1) no AVX: (MacPro5,1; circa 2010) 2) AVX but no BMI2 (circa 2011-2012) 3) AVX and BMI2 (MacBookPro11.2, 11.5; circa 2013-2015) I'm sure other people will have different needs, but for me, segregating shared build machines into those three pools -- and/or sticking with two pools and disabling use of MULX in gmp -- should avoid the crashes I saw due to ImageMagick and GMP cpu specific instruction assumptions. It'd be nice if gmp and imagemagick were more agile about cpu feature detection, and did (more of) it at runtime, but that's life. - Dan On Sun, Dec 31, 2017 at 5:53 PM, Dan Kegel wrote: > On Sat, Dec 30, 2017 at 3:31 PM, Matt Wette wrote: >>> On Dec 30, 2017, at 2:32 PM, Dan Kegel wrote: >>> osx 10.11, though, crashes when I just evaluate (display (version)), >>> or sometimes while building. >> >> I have not seen that on macOS before, but previously ran into other issues. This may help to chase it down: >> >> build with use >> CFLAGS=-g LDFLAGS=-g ./configure --disable-shared --prefix=/opt/local >> >> in meta/gdb-uninstalled-guile, change: >> gdb --args ${top_builddir}/libguile/guile "$@" >> to >> lldb -- ${top_builddir}/libguile/guile "$@" >> >> and, IIRC, run meta/gdb-installed-guile > > Thanks. Also had to do > sudo /usr/sbin/DevToolsSecurity --enable > > Here's a backtrace: > > * thread #1: tid = 0x1628f8, 0x00000001003e95be > libgmp.10.dylib`__gmpn_mul_1 + 94, queue = 'com.apple.main-thread', > stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) > frame #0: 0x00000001003e95be libgmp.10.dylib`__gmpn_mul_1 + 94 > libgmp.10.dylib`__gmpn_mul_1: > -> 0x1003e95be <+94>: mulxq (%rsi), %rbx, %rax > > Guess what? This machine is a i7-3720QM (in a Macbook Pro 9,1), which > doesn't support MULX. (It's 2012 Ivy Bridge, which is just > pre-Haswell.) > > $ gobjdump -d libgmp.dylib | grep mulx > confirms the presence of the mulx instruction. > > So my gmp was built wrong for this machine. (There was a related > bugfix for low-end cpus in gmp 6.1.1, but I've got 6.1.2, and no > low-end cpus.) > > Bit of a mystery, then, but nothing to do with guile. > - Dan