Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PowerPC] Bus error when using OpenBLAS with PPC970 kernel (on G5): address 0x5dc4, cause 'invalid alignment' (but no error with PPCG4 kernel) #4376

Closed
barracuda156 opened this issue Dec 15, 2023 · 9 comments · Fixed by #4379

Comments

@barracuda156
Copy link
Contributor

@martin-frbg We got some obscure issue with PPC970 kernel. It does not show up with every dependent of OpenBLAS, but did show up in two cases. A notable one is with R-float, which links to OpenBLAS and fails on launch like this:

> library(float)

 *** caught bus error ***
address 0x5dc4, cause 'invalid alignment'

Traceback:
 1: dyn.load(file, DLLpath = DLLpath, ...)
 2: library.dynam(lib, package, package.lib)
 3: loadNamespace(package, lib.loc)
 4: doTryCatch(return(expr), name, parentenv, handler)
 5: tryCatchOne(expr, names, parentenv, handlers[[1L]])
 6: tryCatchList(expr, classes, parentenv, handlers)
 7: tryCatch({    attr(package, "LibPath") <- which.lib.loc    ns <- loadNamespace(package, lib.loc)    env <- attachNamespace(ns, pos = pos, deps, exclude, include.only)}, error = function(e) {    P <- if (!is.null(cc <- conditionCall(e)))         paste(" in", deparse(cc)[1L])    else ""    msg <- gettextf("package or namespace load failed for %s%s:\n %s",         sQuote(package), P, conditionMessage(e))    if (logical.return && !quietly)         message(paste("Error:", msg), domain = NA)    else stop(msg, call. = FALSE, domain = NA)})
 8: library(float)

Crash log:

Process:         R [51991]
Path:            /opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/bin/exec_orig/R
Identifier:      R
Version:         ??? (???)
Code Type:       PPC (Native)
Parent Process:  bash [51990]

Date/Time:       2023-12-15 13:10:45.942 +0800
OS Version:      Mac OS X 10.6 (10A190)
Report Version:  6

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000005dc4
Crashed Thread:  0

Thread 0 Crashed:
0   libopenblas.0.dylib           	0x0aca4f04 openblas_read_env + 436
1   libopenblas.0.dylib           	0x0b5e5dd8 _sub_I_65535_1 + 72
2   dyld                          	0x8fe15d5c ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 388
3   dyld                          	0x8fe15d5c ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 388
. . .
508 dyld                          	0x8fe15d5c ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 388

Thread 0 crashed with PPC Thread State 32:
  srr0: 0x0aca4f04  srr1: 0x0000d030   dar: 0x00d9dad1 dsisr: 0x40000000
    r0: 0x0aca4e34    r1: 0xbffe1df0    r2: 0x00000000    r3: 0x00000000
    r4: 0xbffe1ddc    r5: 0x01900480    r6: 0xffffffff    r7: 0x018fc094
    r8: 0x00000014    r9: 0x00000052   r10: 0x0b5d9fe0   r11: 0x01900584
   r12: 0x0075fe30   r13: 0x04049ee8   r14: 0x007189d4   r15: 0x04571144
   r16: 0x00000003   r17: 0x00000000   r18: 0x8fe2b954   r19: 0x0000000d
   r20: 0x0185e900   r21: 0x00000001   r22: 0x0aca4488   r23: 0x0aca4230
   r24: 0x8fe33ca0   r25: 0x00000001   r26: 0x0b5e6008   r27: 0x8fe33c48
   r28: 0x0aca42ac   r29: 0x00000001   r30: 0x0b5e5d98   r31: 0x0aca4d58
    cr: 0x24002242   xer: 0x20000000    lr: 0x0aca4e34   ctr: 0x00000014
vrsave: 0x80000000

Binary Images:
    0x1000 -     0x2fff +R ??? (???) <a638d38343e3cb9c3d15a1c838738cef> /opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/bin/exec_orig/R
    0xa000 -    0x10fff +libMacportsLegacySupport.dylib ??? (???) <53beb950636548d2ca6842a231451732> /opt/local/lib/libMacportsLegacySupport.dylib
   0x14000 -    0x14fff +libgcc_s.1.dylib ??? (???) <52f8e6b93cfbb9fa40f44e2651069377> /opt/local/lib/libgcc/libgcc_s.1.dylib
   0x1e000 -    0x39fff +libRblas.dylib ??? (???) <ed04e9ee71781a29d58f07fe4fb1e145> /opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/lib/libRblas.dylib
   0x3c000 -    0x42ffe +libMacportsLegacySystem.B.dylib ??? (???) <ab16a724e8b8414acbf4100b83b7674b> /opt/local/lib/libMacportsLegacySystem.B.dylib
   0x46000 -    0x4bff7 +libgcc_s.1.1.dylib ??? (???) <e9df52164a9f3356bf03e9a2f259d499> /opt/local/lib/libgcc/libgcc_s.1.1.dylib
   0x4e000 -    0x53fff +libgcc_ehs.1.1.dylib ??? (???) <09caa332743feca0988e493f2fb3c503> /opt/local/lib/libgcc/libgcc_ehs.1.1.dylib
   0x56000 -    0x5bff6  libmathCommon.A.dylib ??? (???) <e166c8e59a80a82b4504b1dd43d1f50a> /usr/lib/system/libmathCommon.A.dylib
   0x5f000 -    0x8efff +libreadline.8.dylib ??? (???) <17e0855f0b94b3fa285cd3252f8bca66> /opt/local/lib/libreadline.8.dylib
   0xa1000 -    0xc7ffc +liblzma.5.dylib ??? (???) <9ae7a86779c2c1acc082958e02b88691> /opt/local/lib/liblzma.5.dylib
   0xcd000 -    0xdbff5 +libbz2.1.0.dylib ??? (???) <561eabf373907c3899487650867150dc> /opt/local/lib/libbz2.1.0.dylib
   0xf2000 -   0x105ffc +libz.1.dylib ??? (???) <6a6402e61f87f6aec3ce3ea2cae04f2a> /opt/local/lib/libz.1.dylib
  0x109000 -   0x13cff1  libauto.dylib ??? (???) <2848423526fb9c0f381c6ceacc4f2c27> /usr/lib/libauto.dylib
  0x175000 -   0x183fff  libz.1.dylib ??? (???) <c296d00fd65aa7271f3d5592c25c0f96> /usr/lib/libz.1.dylib
  0x1a7000 -   0x1a8ffc  dns.so ??? (???) <d61372b816f011ea19a6b524c61f14a7> /usr/lib/info/dns.so
  0x1ac000 -   0x1b2fff +methods.so ??? (???) <8fdc8115125b6bd5ed685fcb957b60c7> /opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library/methods/libs/methods.so
  0x1b6000 -   0x1bffff +utils.so ??? (???) <6f9246f2e8d2448a6fb70996b12f1c00> /opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library/utils/libs/utils.so
  0x1c5000 -   0x1c6fff  com.apple.audio.units.AudioUnit 1.6 (1.6) <686082ea0ec42b7f009e99a571ceec81> /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit
  0x23e000 -   0x23fffa  liblangid.dylib ??? (???) <01ec0f0bdf13f73d8e0334a2e39e75b4> /usr/lib/liblangid.dylib
  0x243000 -   0x243fff  com.apple.Accelerate 1.4.2 (Accelerate 1.4.2) <e8c929e9ed651c210e5238b66b947e6e> /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
  0x3ab000 -   0x5f5ff3 +libR.dylib ??? (???) <77df81a01de4b7cfe44cd532185d7e80> /opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/lib/libR.dylib
  0x756000 -   0x920fe7  libSystem.B.dylib ??? (???) <420b38fe0fa0944f6f5bc4840bf29a4e> /usr/lib/libSystem.B.dylib
  0x9a8000 -   0xa8affb +libgfortran.5.dylib ??? (???) <f331999142aba13cfc5337d9a058882f> /opt/local/lib/libgcc/libgfortran.5.dylib
  0xa9a000 -   0xbf2ff7  com.apple.CoreFoundation 6.6 (511.1) <b82d52070a5949f92c5001e06d67044b> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
  0xcfc000 -   0xd7cffe +libpcre2-8.0.dylib ??? (???) <61b09a66fb7ba96432367e8b8019b0c8> /opt/local/lib/libpcre2-8.0.dylib
  0xd81000 -   0xe86fff +libiconv.2.dylib ??? (???) <71dfab8f77eb71baebdb38550a0ed408> /opt/local/lib/libiconv.2.dylib
  0xe95000 -   0xfe5fff +libicuuc.74.dylib ??? (???) <4b4b28d2326e34ea812f4ad4989d2406> /opt/local/lib/libicuuc.74.dylib
 0x1050000 -  0x120efff +libicui18n.74.dylib ??? (???) <a614cdbdb7f257b0fee5b15eb8a925a9> /opt/local/lib/libicui18n.74.dylib
 0x1302000 -  0x148bfff  libicucore.A.dylib ??? (???) <28f339176d9e26b663f19c1cad91784e> /usr/lib/libicucore.A.dylib
 0x14db000 -  0x155cfe7  libobjc.A.dylib ??? (???) <bb09ce82013fa9c4a4010c58fe6c1e10> /usr/lib/libobjc.A.dylib
 0x156e000 -  0x16c4ff7 +libstdc++.6.dylib ??? (???) <e1e245b4b3ffb0ce8df288fcaae5b6e2> /opt/local/lib/libgcc/libstdc++.6.dylib
 0x174f000 -  0x179affc +libncurses.6.dylib ??? (???) <462c50b8c350821d1fce74422c31471c> /opt/local/lib/libncurses.6.dylib
 0x17ea000 -  0x17f5fff  com.apple.speech.recognition.framework 3.8.2 (3.8.2) <42de060582f36d5185c23e60beb8dab8> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition
 0x1d3f000 -  0x1d40ff8  com.apple.ApplicationServices 36 (36) <8d5530987cce48c3375a350c7f134b9c> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
 0x1d56000 -  0x1d58fff  libRadiance.dylib ??? (???) <8c97d9ae80dd2661573bb62db798e710> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib
 0x1d5f000 -  0x3abbfff +libicudata.74.dylib ??? (???) <60be796525a65c4c97596af92d58f42d> /opt/local/lib/libicudata.74.dylib
 0x3c00000 -  0x3c20fff  libresolv.9.dylib ??? (???) <2b57f734cfd1eb7ebf2eb9a4bbbc5a23> /usr/lib/libresolv.9.dylib
 0x3c6a000 -  0x3ca3fff +grDevices.so ??? (???) <431647f72f07c27e22ac09f1d37e13dd> /opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library/grDevices/libs/grDevices.so
 0x3cb6000 -  0x3cbffff  com.apple.DiskArbitration 2.2.1 (2.2.1) <daa422fc5a934366c8f0a12204b46cb1> /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
 0x3cc8000 -  0x3cd1ffc  libkxld.dylib ??? (???) <725cd6e644549962b0110493f4bb7c08> /usr/lib/system/libkxld.dylib
 0x3e1b000 -  0x3e71ff3  com.apple.framework.IOKit 1.5.1 (???) <21f9b751b7578a33306804af2c6ded8d> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
 0x3e8a000 -  0x3ebeffb  com.apple.coreui 0.2 (89) <be964ae9fad2620345b04aec50268e6e> /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI
 0x3edd000 -  0x3eddffa  com.apple.CoreServices 41 (41) <97bf3903384c706ba0f7d19577f0ef8c> /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
 0x3ef3000 -  0x3ef7ffc  libGIF.dylib ??? (???) <ebdc74ca8b923dc8281d8644db5bf855> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib
 0x3ff1000 -  0x3ff3ffd  IOSurface ??? (???) <5433ef600fe03d1fce7564db343d71a7> /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface
 0x3ff9000 -  0x3ffbff4  libCoreVMClient.dylib ??? (???) <b2ea0d8b9bf3ec7a35c64bb23091fb71> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib
 0x5000000 -  0x5258fff  com.apple.Foundation 6.6 (711.1) <42ee053ddba592040925af9eb9542462> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
 0x53a2000 -  0x54d6ffb  com.apple.audio.toolbox.AudioToolbox 1.6 (1.6) <838258abe5efe516c46f29eaefb99b79> /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox
 0x553d000 -  0x562cffb  com.apple.CoreData 100.1 (205) <6712b8051aee2ff6ba2cf2cf025a7fab> /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
 0x56a9000 -  0x575cfff  com.apple.DesktopServices 1.5.0 (1.5.0) <8fda370f06c5c6ddb4e054ccf5ccb815> /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv
 0x57ba000 -  0x57cdfff  com.apple.LangAnalysis 1.6.5 (1.6.5) <e7713c1bde76548000a0a0e7b9f27324> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis
 0x57da000 -  0x57edffb  com.apple.speech.synthesis.framework 3.10.1 (3.10.1) <67907b42aecf8e5cef273ce5085f19b5> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis
 0x6000000 -  0x67f6ffc  com.apple.AppKit 6.6 (988.3) <41788f85dd3bb1a0c36efa11aea7d01a> /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
 0x6d35000 -  0x707afe3  com.apple.HIToolbox 1.6.0 (???) <1a4693b0eff8ed8d6fe18c37f5440f61> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
 0x71e5000 -  0x74d3ff3  com.apple.QuartzCore 1.6.0 (184.0) <61638f8b16dace924c2738e8d4025e49> /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
 0x75bb000 -  0x77e9ff7  com.apple.security 6.0 (34772) <df4f0710dfee6e04e7fdba557064977b> /System/Library/Frameworks/Security.framework/Versions/A/Security
 0x7900000 -  0x7a1bfff  libxml2.2.dylib ??? (???) <2bdb2ca8d4aabba550ba9f2111ebf46a> /usr/lib/libxml2.2.dylib
 0x7a3e000 -  0x7ab3fff  com.apple.audio.CoreAudio 3.2.0 (3.2) <8476a77d790570f688f95d47f0d77fb7> /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
 0x7af0000 -  0x7b8bfff  com.apple.ApplicationServices.ATS 4.0 (???) <4210dabffcc1cafdf05b6a22996a4eb6> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS
 0x7bb2000 -  0x7c86ff7  com.apple.ColorSync 4.6.0 (4.6.0) <c4746bb1c5e21b1ff1ee9e23150dae91> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSync.framework/Versions/A/ColorSync
 0x7cc5000 -  0x832cff7  com.apple.CoreGraphics 1.507.2 (???) <dc83caa82d24f470958a99ca6e198a2f> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
 0x83f3000 -  0x8456fff  com.apple.CoreText 3.0.0 (???) <367767da30e7fda6ac4302fc54116f29> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework/Versions/A/CoreText
 0x848f000 -  0x84e8fff  com.apple.HIServices 1.7.0 (???) <4e20ca5a0f021908e274610eab85af23> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices
 0x8514000 -  0x86bfffb  com.apple.ImageIO.framework 3.0.0 (3.0.0) <840a13dc20c1c1a1ed50edef6d706239> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
 0x872c000 -  0x87dcffb  com.apple.QD 3.18 (???) <f6b3db0d330e0268a24dc5e3fdb820a5> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD
 0x880b000 -  0x8b31ff7  com.apple.CoreServices.CarbonCore 818 (818) <3e631022aef7f9d15373e1f56e74ff00> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
 0x8bba000 -  0x8c7affb  com.apple.CFNetwork 417.1 (417.1) <911e0fa87591b77e8bb8ec4759941216> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
 0x8ce2000 -  0x8d22fff  com.apple.Metadata 10.6.0 (429.1) <d8b50a8ca605800f8f36caf448daed42> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata
 0x8d3b000 -  0x8e13fff  com.apple.CoreServices.OSServices 310 (310) <633ea4081155a516c80bf948f004d235> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
 0x8e7e000 -  0x8efbffb  com.apple.SearchKit 1.3.0 (1.3.0) <4c7ffa79c1cd48d28eb165768fbfc2f4> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
 0x8f3a000 -  0x8f72fff  com.apple.AE 464 (464) <492b7cdb81e64fca5af300b0c231ebec> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
 0x8f8a000 -  0x9021ff7  com.apple.LaunchServices 318.1 (318.1) <5ee43f629f636d1863e73dc312c736c2> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices
 0x9067000 -  0x908afff  com.apple.DictionaryServices 1.0.0 (1.0.0) <f2f1f85469f3036ec9890bfa888edbe2> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices
 0x90a0000 -  0x90b2fff  libbsm.0.dylib ??? (???) <c43c47af4211639e8828d3e8ff93a019> /usr/lib/libbsm.0.dylib
 0x90b8000 -  0x90c5ffe  NetFS ??? (???) <5125b2c825637b243afa1ea942ba8220> /System/Library/Frameworks/NetFS.framework/Versions/A/NetFS
 0x90cc000 -  0x917dff7  libsqlite3.0.dylib ??? (???) <cc6135a5433e43988bf825e149e47483> /usr/lib/libsqlite3.0.dylib
 0x9189000 -  0x91c4fff  com.apple.SystemConfiguration 1.10 (1.10) <2daf422a1a7ca90ba32720000e56b3aa> /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
 0x91e0000 -  0x920cfff  libxslt.1.dylib ??? (???) <da4552da93bf856897f6b399bb10806d> /usr/lib/libxslt.1.dylib
 0x9215000 -  0x924cfff  libFontParser.dylib ??? (???) <e83c633b4e6ac7de6acfa5edbe925f7a> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontParser.dylib
 0x927a000 -  0x935dff3  libcrypto.0.9.8.dylib ??? (???) <90068ab1dc24a941bdd01726024c515d> /usr/lib/libcrypto.0.9.8.dylib
 0x93ae000 -  0x93cdfff  com.apple.vecLib 3.4.2 (vecLib 3.4.2) <9e27768a4224789f73942ddb2e03e729> /System/Library/Frameworks/vecLib.framework/Versions/A/vecLib
 0x942a000 -  0x954affa  com.apple.vImage 4.0 (4.0) <40c9ff1a236e54afc0af0dbe01d59ae0> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage
 0x9559000 -  0x9578fff  com.apple.Accelerate.vecLib 3.4.2 (vecLib 3.4.2) <c56e0d707296e54bceac01b6944e99e3> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib
 0x95d5000 -  0x964ffff  libvMisc.dylib ??? (???) <2607b58a270aca106281054e078194d1> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib
 0x9659000 -  0x96f6fe3  libvDSP.dylib ??? (???) <18d61ac588914626b88c2c2babb2ac25> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib
 0x9710000 -  0x9d7dff7  libBLAS.dylib ??? (???) <b09754bb15f771807655be04f5200efd> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
 0x9dbb000 -  0xa153ff7  libLAPACK.dylib ??? (???) <7f1ccd1f986607cb24ada410c3548482> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
 0xa2cc000 -  0xa310ff3  libTIFF.dylib ??? (???) <7b0f8b579d3fd66175f0e695370c2232> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
 0xa31b000 -  0xa336fff  libPng.dylib ??? (???) <ce17de27142c8af8406c282b45de241a> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib
 0xa33d000 -  0xa35fff2  libJPEG.dylib ??? (???) <df09b8c643d8325deae52adf5818b338> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib
 0xa366000 -  0xa394fff  libcups.2.dylib ??? (???) <dfcb272c0281e5d2ec0f89f1f75f6d88> /usr/lib/libcups.2.dylib
 0xa39f000 -  0xa3abffb  com.apple.audio.SoundManager 3.9.3 (3.9.3) <3c277575e7182f3c3130f2f634eb9920> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CarbonSound.framework/Versions/A/CarbonSound
 0xa3b3000 -  0xa3ccfff  com.apple.CoreVideo 1.5.0 (18.0) <5cf2b5140975287f2ec3a7feaf8683b0> /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
 0xa3e0000 -  0xa3efffb  com.apple.opengl 1.6.2 (1.6.2) <7057304e586007ad73491c1f466cf20c> /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
 0xa3f6000 -  0xa43bffd  libGLImage.dylib ??? (???) <9d4b12b3ed2eaae2c34569be29e4b6d7> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib
 0xa442000 -  0xa498ff7  libGLU.dylib ??? (???) <0d58cf5be12c0800774385b0dab6061a> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib
 0xa4ac000 -  0xa4d4ffb  libGL.dylib ??? (???) <62c15417340866d11848068acfbceba9> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
 0xa4e3000 -  0xa601fff  libGLProgrammability.dylib ??? (???) <9773d0426f2831c71a8baafed455acf6> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLProgrammability.dylib
 0xa69b000 -  0xa6cffff +graphics.so ??? (???) <68f27eb8cbdd2574f95dcdee045131a1> /opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library/graphics/libs/graphics.so
 0xa869000 -  0xa8dafff +stats.so ??? (???) <fd5f2e29c7e60380a449941fd7649b9a> /opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library/stats/libs/stats.so
 0xa8e5000 -  0xaa2fffb +libRlapack.dylib ??? (???) <a8641b8d334a5ca6b62f6fe55a023d93> /opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/lib/libRlapack.dylib
 0xac7c000 -  0xac8cffd +tools.so ??? (???) <66124246722466262ca68402e05173e8> /opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library/tools/libs/tools.so
 0xac91000 -  0xaca0fff +float.so ??? (???) <366ec3548a7e5b9669d8207b5e07a124> /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_R_R-float/R-float/work/destroot/opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library/00LOCK-float/00new/float/libs/float.so
 0xaca4000 -  0xb5e5fff +libopenblas.0.dylib ??? (???) <0a3b8993de0d13fda32cf6f965de0d4d> /opt/local/lib/libopenblas.0.dylib
0x20000000 - 0x2009efff  edu.mit.Kerberos 6.5.3 (6.5.3) <af8fd279b2ec6f91e99e82352f2541c9> /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos
0x8fe00000 - 0x8fe31143  dyld 113.0 (???) <ee555e655e1cf66cac80728801add419> /usr/lib/dyld
0xfa100000 - 0xfa189ffb  com.apple.print.framework.PrintCore 6.0 (276) <049c93926212fa9408e9e56186970e4b> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore
0xffff8000 - 0xffff9703  libSystem.B.dylib ??? (???) /usr/lib/libSystem.B.dylib

There is no failure when PPCG4 kernel is used, both with and without optflags. (My initial thought was to blame -mcpu or/and -maltivec, but with PPCG4 kernel they do not break anything.)

Second case is flexiblas, which fails to detect OpenBLAS as functional at configure when PPC970 kernel is used, but detects it correctly with PPCG4 kernel: mpimd-csc/flexiblas#40

There are no problems with linking against either version of OpenBLAS with whatever dependents I tested so far.

Notice, that I build for ppc (32-bit), but on G5 cpu, so PPC970 is supposed to be the right one.

What in principle might go wrong:

  1. Some or all of optflags, while working for G4 kernel, break G5 kernel.
  2. CMake build of G5 kernel is broken, unrelated to optflags (which are identical, save for cpu type).
  3. There is a bug in GCC itself, showing up with G5 kernel.
  4. ?

I have to rebuild OpenBLAS again a couple of times to rule out some of there, hopefully. To be updated.

@martin-frbg
Copy link
Collaborator

failure on launch would almost certainly have to be compiler or flags used, as it wouldn't have had a reason to access one of the cpu-specific BLAS kernels yet. the only other cause I can imagine is that the default BUFFERSIZE is somehow too large for this hardware (but I guess that would not raise sigbus)

@barracuda156
Copy link
Contributor Author

@martin-frbg I will rebuild PPC970 now, first dropping -maltivec, then, provided it remains semi-broken, -mcpu. Should find a working combo eventually.

P. S. It is a bit strange case; I am pretty sure that -mcpu= -mtune= have been used elsewhere with no evident detrimental effects, as well as -faltivec/-maltivec. Maybe we should retain -mtune= but drop -mcpu=, at least on Apple.

It would be nice if someone could test PPC970 kernel on G5 with Linux or BSD. (Just in case, FreeBSD 13+ has broken multicpu support for PowerPC, so 12– are needed.)

@barracuda156
Copy link
Contributor Author

@martin-frbg Okay, -maltivec is not at fault; I also used -mcpu=G5 -mtune=G5 (though this should be just an alias to 970 anyway). Library still broken. Rebuilding without -mcpu now.

@iains Iain, could you please say, if gcc is expected to generate correct code for G5 with -mcpu=970 -mtune=970, and are -faltivec and -maltivec strictly identical in effect on Darwin?

For some reason here it looks like -mcpu=G4 -mtune=G4 is all good while -mcpu=970 -mtune=970 produces a broken library. (Both tested on G5 for ppc.)
(To make it explicit, I had to add -force_cpusubtype_ALL flag as well, otherwise linking failed. But AFAIU is does a different thing to optflags and as such does not contradict them.)

@barracuda156
Copy link
Contributor Author

@martin-frbg So, -mcpu is breaking it. (That is, weirdly, -mcpu=G4 was okay on G5, but -mcpu=G5 is not.)
Leaving -mtune=970 -maltivec is fine.

Now, I have no idea whether this will apply to Linux and BSD cases. I am also not sure if -mcpu=G4 is good to have (it seems to work fine), or rather remove it for consistency with G5 case.

barracuda156 added a commit to barracuda156/OpenBLAS that referenced this issue Dec 15, 2023
@martin-frbg
Copy link
Collaborator

Thanks for this update - I have no idea either, but with hardware that old it is probably safer to have it working at all, rather than try to get the last millisecond of speedup out of compiler flags

@iains
Copy link

iains commented Dec 15, 2023

from memory (I am tied up with other stuff at the moment)

  • 64 bit binaries should not use this (the mtune=g5/970 is fine)
  • (AFAIR) the mcpu=970/G5 was intended to allow a restricted use of 64 b instructions (when the processor has them) in 32b binaries (i.e. between calls because the upper bits are not preserved by the call ABI). This is likely bitrotten (you do not mention which GCC version) - although it is kinda interesting it's a long way down my priority list to fix this, sorry.

@barracuda156
Copy link
Contributor Author

@iains Thank you very much! This is with gcc13, I did not test older versions. We just drop -mcpu then and leave -mtune.

P. S. By extension, we should also avoid -mcpu=native then? (Not for OpenBLAS case, but generally: Macports may have it here and there.)

@iains
Copy link

iains commented Dec 15, 2023

@iains Thank you very much! This is with gcc13, I did not test older versions. We just drop -mcpu then and leave -mtune.

P. S. By extension, we should also avoid -mcpu=native then? (Not for OpenBLAS case, but generally: Macports may have it here and there.)

on G5 boxes it might produce surprising results indeed (but, again, I have not tested what a recent compiler version actually does with this - there have been some changes in the handling of this stuff in the GCC-14 development cycle). We'd need a better bug report than "it doesn't work" ;)

@iains
Copy link

iains commented Dec 15, 2023

A quick test on my G5 box confirms:

  • that the behaviour is as I commented above (the -mcpu=970/g5/native causes 64b instructions to be available on 32b binaries). So despite that it might seem relevant to state G5 or 970 for a 64b build, that is not actually correct (64b builds are always ppc64, but you can alter the tuning). Maybe we should reject those flags with a diagnostic in 64b builds.
  • [on 13 branch] some trivial cases for 64b insn use actually work, so it's not DoA - but we'd need proper bug reports with reduced test-cases to make progress on fixing cases that do not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants