View Issue Details

IDProjectCategoryView StatusLast Update
0000094tcshGeneralpublic2019-08-01 14:18
Reporterswagstafff Assigned Tochristos  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
PlatformMacOSmacOSOS Version10.14
Product Version6.21.00 
Fixed in Version6.22.00 
Summary0000094: Apple patches not applied
DescriptionApple has patched its Mac OS X/macOS tcsh installations [1] since c. 2007 [2]. These patches have never propagated upstream and lead to bugs when not applied on a Mac. Bugs include incorrect HOSTTYPE, OSTYPE, MACHTYPE; and crash with segmentation fault.

[1] https://opensource.apple.com/source/tcsh/
[2] https://opensource.apple.com/source/tcsh/tcsh-60/patches/

Steps To Reproducehost.defs.patch
Unpatched:
> echo $HOSTTYPE $OSTYPE $MACHTYPE
unknown bsd44 unknown

After patch (and expected):
> echo $HOSTTYPE $OSTYPE $MACHTYPE
intel-mac darwin x86_64

Before config_f.h.patch:
> nonexistent > /dev/null
nonexistent: Command not found.
Segmentation fault
Additional InformationThe uploaded files incorporate Apple's latest patches ("tcsh-67") [3], with some adaptation for application to tcsh 6.21.00 and corrections for correct hosttype on Intel Macs. The patches have been tested on macOS 10.12.6 and 10.14.5.

[3] https://opensource.apple.com/source/tcsh/tcsh-67/patches/
TagsNo tags attached.

Activities

swagstafff

2019-07-26 21:38

reporter  

config_f.h.patch (279 bytes)   
--- config_f-dist.h	2019-05-08 14:39:28.000000000 -0400
+++ config_f.h	2019-07-15 16:41:39.000000000 -0400
@@ -73,7 +73,7 @@
 /*
  * KAI          use "bye" command and rename "log" to "watchlog"
  */
-#undef KAI
+#define KAI
 
 /*
  * TESLA	drops DTR on logout. Historical note:
config_f.h.patch (279 bytes)   
host.defs.patch (678 bytes)   
--- host-dist.defs	2019-05-08 14:39:28.000000000 -0400
+++ host.defs	2019-07-15 17:52:05.000000000 -0400
@@ -851,15 +851,15 @@
 enddef	:
 
 
-newdef	: defined(APPLE) && defined(MACH)
+newdef	: defined(APPLE) && defined(__MACH__)
 comment : OS X
 vendor	:						: "apple"
-hosttype: defined(i386)					: "intel-pc"
+hosttype: defined(i386)					: "intel-mac"
 hosttype: defined(ppc)					: "powermac"
-hosttype: defined(M_amd64)				: "amd"
+hosttype: defined(x86_64)				: "intel-mac"
 ostype	:						: "darwin"
 machtype: defined(i386)					: "i386"
-machtype: defined(M_amd64)				: "x86_64"
+machtype: defined(x86_64)				: "x86_64"
 machtype: defined(ppc)					: "powerpc"
 enddef	:
 
host.defs.patch (678 bytes)   
tc.sig.h.patch (456 bytes)   
--- tc.sig-dist.h	2019-05-08 14:39:28.000000000 -0400
+++ tc.sig.h	2019-07-15 16:47:32.000000000 -0400
@@ -42,7 +42,7 @@
 # include <sys/signal.h>
 #endif /* SYSVREL > 0 */
 
-#if defined(__APPLE__) || defined(SUNOS4) || defined(DGUX) || defined(hp800) || (SYSVREL > 3 && defined(VFORK))
+#if defined(SUNOS4) || defined(DGUX) || defined(hp800) || (SYSVREL > 3 && defined(VFORK))
 # define SAVESIGVEC
 #endif /* SUNOS4 || DGUX || hp800 || SVR4 & VFORK */
 
tc.sig.h.patch (456 bytes)   

christos

2019-08-01 14:18

manager   ~0003273

Applied (except the KAI one, which is not appropriate).

Issue History

Date Modified Username Field Change
2019-07-26 21:38 swagstafff New Issue
2019-07-26 21:38 swagstafff File Added: config_f.h.patch
2019-07-26 21:38 swagstafff File Added: host.defs.patch
2019-07-26 21:38 swagstafff File Added: tc.sig.h.patch
2019-08-01 14:17 christos Assigned To => christos
2019-08-01 14:17 christos Status new => assigned
2019-08-01 14:18 christos Status assigned => resolved
2019-08-01 14:18 christos Resolution open => fixed
2019-08-01 14:18 christos Fixed in Version => 6.22.00
2019-08-01 14:18 christos Note Added: 0003273