Closed barracuda156 closed 1 month ago
@CarterLi This actually should be pretty easily fixable, since the framework headers have almost everything needed, but the syntax does not work. I can't fix it rightaway though, since this is ObjC.
It looks like array creation code from here is fine: https://github.com/toy/blueutil/blob/main/blueutil.m But I still get some errors in this module.
As documented in README, We officially support macOS only, not Mac OS X, nor OS X. 10.6
is Mac OS X not macOS I guess.
I'm not a big fun of obj-c syntax already. Rewriting existing code with older obj-c standard is BIG no to me. I think there won't be these questions if I wrote this in Swift before.
Again, if you want this compiling, guard it with #ifndef
.
@CarterLi Sure, there is obligation implied whatsoever. I will see if I can fix it.
Thanks for merging other fix-ups!
@CarterLi I have kinda fixed the build of 2.12.0 (not neatly at the moment), however it fails to run:
(gdb) run
Starting program: /opt/local/bin/fastfetch
Reading symbols for shared libraries ++++++++++++++++..................................................................... done
Reading symbols for shared libraries . done
2024-05-20 09:46:40.803 fastfetch[69901:c13] *** __NSAutoreleaseNoPool(): Object 0x5c0b0b0 of class NSURL autoreleased with no pool in place - just leaking
2024-05-20 09:46:40.806 fastfetch[69901:c13] *** __NSAutoreleaseNoPool(): Object 0x5c0b3c0 of class NSCFString autoreleased with no pool in place - just leaking
2024-05-20 09:46:40.806 fastfetch[69901:c13] +[NSDictionary dictionaryWithContentsOfURL:error:]: unrecognized selector sent to class 0x3d18d0
2024-05-20 09:46:40.807 fastfetch[69901:c13] *** __NSAutoreleaseNoPool(): Object 0x5c0b400 of class NSCFString autoreleased with no pool in place - just leaking
2024-05-20 09:46:40.807 fastfetch[69901:c13] *** __NSAutoreleaseNoPool(): Object 0x5c0b4c0 of class NSException autoreleased with no pool in place - just leaking
2024-05-20 09:46:40.808 fastfetch[69901:c13] *** __NSAutoreleaseNoPool(): Object 0x5c0cbb0 of class _NSCallStackArray autoreleased with no pool in place - just leaking
2024-05-20 09:46:40.809 fastfetch[69901:c13] *** __NSAutoreleaseNoPool(): Object 0x5c0cb70 of class _NSCallStackArray autoreleased with no pool in place - just leaking
2024-05-20 09:46:40.810 fastfetch[69901:c13] *** __NSAutoreleaseNoPool(): Object 0x5c0d4a0 of class NSCFString autoreleased with no pool in place - just leaking
2024-05-20 09:46:40.810 fastfetch[69901:c13] *** __NSAutoreleaseNoPool(): Object 0x6037000 of class NSCFString autoreleased with no pool in place - just leaking
2024-05-20 09:46:40.811 fastfetch[69901:c13] *** __NSAutoreleaseNoPool(): Object 0x5c0dfa0 of class NSConcreteMutableData autoreleased with no pool in place - just leaking
2024-05-20 09:46:40.811 fastfetch[69901:c13] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSDictionary dictionaryWithContentsOfURL:error:]: unrecognized selector sent to class 0x3d18d0'
*** Call stack at first throw:
(
0 CoreFoundation 0x002e0430 __raiseError + 144
1 libobjc.A.dylib 0x009dd968 objc_exception_throw + 72
2 CoreFoundation 0x0035ba8c +[__NSPlaceholderOrderedSet immutablePlaceholder] + 0
3 CoreFoundation 0x002cfc48 ___forwarding___ + 380
4 CoreFoundation 0x002cf9f8 _CF_forwarding_prep_0 + 216
5 fastfetch 0x0006fa18 ffDetectOSImpl + 96
6 fastfetch 0x00011dd4 ffDetectOS + 132
7 fastfetch 0x00016264 logoGetBuiltinDetected + 32
8 fastfetch 0x00016814 logoPrintDetected + 16
9 fastfetch 0x0000c240 ffStart + 380
10 fastfetch 0x00103128 main + 500
11 fastfetch 0x00006b68 start + 68
12 fastfetch 0x00001000 __dso_handle + 0
)
Program received signal SIGTRAP, Trace/breakpoint trap.
0x0031b548 in ___TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION___ ()
(gdb) bt
#0 0x0031b548 in ___TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION___ ()
#1 0x009dd968 in objc_exception_throw ()
#2 0x0035ba8c in +[NSObject doesNotRecognizeSelector:] ()
#3 0x002cfc48 in ___forwarding___ ()
#4 0x002cf9f8 in __forwarding_prep_0___ ()
#5 0x0006fa18 in ffDetectOSImpl ()
#6 0x00011dd4 in ffDetectOS ()
#7 0x00016264 in logoGetBuiltinDetected ()
#8 0x00016814 in logoPrintDetected ()
#9 0x0000c240 in ffStart ()
#10 0x00103128 in main ()
I thought I have done something wrong with patching, however I have tried to build now 1.7.2 (which required no patches besides a trivial missing define for OpenGL and removal of OpenCL module, i.e. no hacking the code itself), and it gives a logo on start, but still crashes with the same error:
2024-05-20 16:52:29.873 fastfetch[19955:10b] *** __NSAutoreleaseNoPool(): Object
2024-05-20 16:52:29.876 fastfetch[19955:10b] -[NSCFData _getCString:maxLength:en
2024-05-20 16:52:29.876 fastfetch[19955:10b] *** __NSAutoreleaseNoPool(): Object
2024-05-20 16:52:29.877 fastfetch[19955:10b] *** __NSAutoreleaseNoPool(): Object
2024-05-20 16:52:29.879 fastfetch[19955:10b] *** __NSAutoreleaseNoPool(): Object
2024-05-20 16:52:29.880 fastfetch[19955:10b] *** __NSAutoreleaseNoPool(): Object
2024-05-20 16:52:29.881 fastfetch[19955:10b] *** __NSAutoreleaseNoPool(): Object
2024-05-20 16:52:29.881 fastfetch[19955:10b] *** __NSAutoreleaseNoPool(): Object
2024-05-20 16:52:29.882 fastfetch[19955:10b] *** __NSAutoreleaseNoPool(): Object
2024-05-20 16:52:29.883 fastfetch[19955:10b] *** Terminating app due to uncaught
*** Call stack at first throw:
(
0 CoreFoundation 0x002e0430 __raiseError + 144
1 libobjc.A.dylib 0x008fb968 objc_exception_throw
2 CoreFoundation 0x0035b9f0 +[NSObject doesNotRec
3 CoreFoundation 0x002cfc48 ___forwarding___ + 38
4 CoreFoundation 0x002cf9f8 _CF_forwarding_prep_0
5 CoreFoundation 0x0028f9a4 CFStringGetCString +
6 fastfetch 0x00018b2c ffDetectGPUImpl + 412
7 fastfetch 0x00012358 ffDetectGPU + 100
8 fastfetch 0x000166b8 ffPrintGPU + 108
9 fastfetch 0x0002bc40 main + 1420
10 fastfetch 0x000034a4 start + 68
11 fastfetch 0x00001000 __dso_handle + 0
)
zsh: trace trap /opt/local/bin/fastfetch
So while it is quite probable my local patches to ObjC stuff are to be improved, the segfaul seems independent of those. It is also not caused by any recent switches from C to ObjC code is Apple-related modules (those postdate 1.7.2).
Maybe you could suggest what may be failing? I am not asking to waste time fixing it, I can deal with that on my end, just give an opinion, since you know both the code and ObjC much better.
Seems one of ffCfDictGetString
crashed. I'm not sure. Since you are working on it, why not debug it locally?
Yes, I will 👍
Bluetooth code does not compile on legacy macOS:
It seems that syntax used to create an array is wrong, and then constructs like
ioDevice.something
do not work.