Skip to content

Instantly share code, notes, and snippets.

View NattyNarwhal's full-sized avatar
🐪
ML stands for metalanguage, not machine learning

Calvin Buckley NattyNarwhal

🐪
ML stands for metalanguage, not machine learning
View GitHub Profile
@NattyNarwhal
NattyNarwhal / diff.patch
Created March 6, 2018 00:22
another broken trampoline
diff --git a/mono/mini/mini-ppc.c b/mono/mini/mini-ppc.c
index 8a32046..5cfca95 100644
--- a/mono/mini/mini-ppc.c
+++ b/mono/mini/mini-ppc.c
@@ -800,6 +800,7 @@ mono_arch_flush_icache (guint8 *code, gint size)
if (!(cpu_hw_caps & PPC_ISA_2X))
asm ("sync");
asm ("isync");
+ __builtin___clear_cache (start, endp);
#endif
@NattyNarwhal
NattyNarwhal / diff.patch
Created March 6, 2018 01:59
more songs about trampolines and food
diff --git a/mono/mini/mini-ppc.c b/mono/mini/mini-ppc.c
index 8a32046..5cfca95 100644
--- a/mono/mini/mini-ppc.c
+++ b/mono/mini/mini-ppc.c
@@ -800,6 +800,7 @@ mono_arch_flush_icache (guint8 *code, gint size)
if (!(cpu_hw_caps & PPC_ISA_2X))
asm ("sync");
asm ("isync");
+ __builtin___clear_cache (start, endp);
#endif
-- drop table MirrorContentsTempCopy; --uncomment if exists somehow
create temporary table MirrorContentsTempCopy engine=memory select * from MirrorContents where MirrorUUID = 0x00000000000000000000000000000000;
update MirrorContentsTempCopy set MirrorUUID = 0x00000000000000000000000000000038;
insert into MirrorContents select * from MirrorContentsTempCopy;
drop table MirrorContentsTempCopy;
select * from MirrorContents where MirrorUUID = 0x00000000000000000000000000000038;
Unhandled Exception:
System.Net.WebException: Error: SecureChannelFailure (A call to SSPI failed, see inner exception.) ---> System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> Mono.Btls.MonoBtlsException: Ssl error:10000410:SSL routines:OPENSSL_internal:SSLV3_ALERT_HANDSHAKE_FAILURE
at /home/calvin/mono/external/boringssl/ssl/tls_record.c:462
at Mono.Btls.MonoBtlsContext.ProcessHandshake () [0x00054] in <697f158bf0a84348a1ef6ca3914dfe6b>:0
at Mono.Net.Security.MobileAuthenticatedStream.ProcessHandshake (Mono.Net.Security.AsyncOperationStatus status) [0x0004a] in <697f158bf0a84348a1ef6ca3914dfe6b>:0
at (wrapper remoting-invoke-with-check) Mono.Net.Security.MobileAuthenticatedStream.ProcessHandshake(Mono.Net.Security.AsyncOperationStatus)
at Mono.Net.Security.AsyncHandshakeRequest.Run (Mono.Net.Security.AsyncOperationStatus status) [0x00006] in <697f158bf0a84348a1ef6ca3914dfe6b>:0
at Mono.Net.Security.AsyncProtocolRequest+<ProcessOperation>c__asy
*** The runtime 'mono' doesn't appear to be usable.
*** Trying the 'monolite-linux/1051500005' directory.
mono_thread_internal_set_priority: pthread_setschedparam failed, error: "Operation not permitted." (1)
buli/docmmnob/sacip-orifelc-ehkcc.(s,1)0 :reor rSC5152 :nUxeeptcdes myob lu`nsiyS'
buli/docmmnob/sacip-orifelc-ehkcc.(s813,:)e rrroC 0S85:9I tnrean locpmliree rrrod runi gapsrniSgsyet.moFmrtaxEectpoi:nI pntus rtni gaw son tnia c roertcf roam.t
a tyStsmeN.mueb.raPsrDeuolb eS(syet.mtSirgnv laeu ,yStsmeG.olabilazitnoN.muebSrytel spoitno,sS syet.mlGbolazitaoi.nuNbmreoFmrtanIofn mumf)t[ x00080]fi nd<262689a09849cfa360cb9320ceeb26>e0:
taS syet.moDbuelP.raes( yStsmeS.rtni g,sS syet.mlGbolazitaoi.nuNbmretSlyses ytel ,yStsmeG.olabilazitnoN.muebFrroamItfn oniof )0[0x0000 ]ni< 6d6292088a99f43c0ab63c09e2bc6ee2:> 0
a tyStsmeD.uolb.eaPsr eS(syet.mtSirgns ,yStsmeG.olabilazitnoN.muebSrytel stsly,eS syet.mFIroamPtorived rrpvodire )0[0x00e0 ]ni< 6d6292088a99f43c0ab63c09e2bc6ee2:> 0
a toMonC.hSra.poTekinez.rdaujtsr
diff --git a/src/Native/Unix/System.Native/pal_errno.c b/src/Native/Unix/System.Native/pal_errno.c
index 3a7972369..4cff18a 100644
--- a/src/Native/Unix/System.Native/pal_errno.c
+++ b/src/Native/Unix/System.Native/pal_errno.c
@@ -130,8 +130,10 @@ int32_t SystemNative_ConvertErrorPlatformToPal(int32_t platformErrno)
return Error_ENOTCONN;
case ENOTDIR:
return Error_ENOTDIR;
+#if !defined(_AIX)
case ENOTEMPTY:
diff --git a/src/Native/Unix/System.Native/pal_errno.c b/src/Native/Unix/System.Native/pal_errno.c
index 3a7972369..4cff18a 100644
--- a/src/Native/Unix/System.Native/pal_errno.c
+++ b/src/Native/Unix/System.Native/pal_errno.c
@@ -130,8 +130,10 @@ int32_t SystemNative_ConvertErrorPlatformToPal(int32_t platformErrno)
return Error_ENOTCONN;
case ENOTDIR:
return Error_ENOTDIR;
+#if !defined(_AIX)
case ENOTEMPTY:
@NattyNarwhal
NattyNarwhal / test.c
Last active June 1, 2018 20:47
Fragment: SIOCGIFCONF based fallback for pal_networking.c
#elif HAVE_SIOCGIFCONF
// Adapted from Mono's networking-posix.c.
packetInfo->InterfaceIndex = 0;
int fd;
struct ifconf ifc;
struct ifreq *ifr;
int32_t if_count = 0;
fd = socket (AF_INET, SOCK_STREAM, 0);
@NattyNarwhal
NattyNarwhal / siocgifconf.frag.c
Created June 6, 2018 18:50
Try 3 of PAL networking hack
// Works on AIX, but doesn't on i because ifr_name is NOT THE DEVICE NAME ON i!
// On i, ifr_name returns the IP address; if_nameindex returns the real OS/400
// names, but SIOCGIFCONF won't, and thus we need a new way to enumerate...
#elif HAVE_SIOCGIFCONF
// Adapted from Mono's networking-posix.c.
packetInfo->InterfaceIndex = 0;
struct ifconf ifc;
struct ifreq *ifr;
int fd;
@NattyNarwhal
NattyNarwhal / index.c
Created June 6, 2018 19:27
Attempt at if_nameindex and SIOCGIFADDR based enumeration, standalone
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <stdlib.h>
#include <unistd.h>