[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/3/ - 3DCG


View post   

File: 383 KB, 891x902, xrctfy_xcity.jpg [View same] [iqdb] [saucenao] [google]
906841 No.906841 [Reply] [Original]

The old OSX build runs fine (built in 2012).
The new one, where the code is pretty much the same, compiles and runs, but when it gets to a strlcpy invocation; the OSX kernel decides some memory was used incorrectly and terminates the process.

If I "fix" (ie hack around with a check) the first strlcpy "situation" ("does this pointer have the same contents as the other thing we're copying too allready? If so don't bother"), then the error just migrates to the next sorta similar code (and this time a blatant "you're not allowed to do that" error).

This code runs fine under the most memory secure stringent grsecurity-linux kernel. So it isn't like we're using the stack for execution of data-only stuff.
It also runs fine under regular linux and windows.
The code has not changed in these instances in 15 years, and the rest of the engine code is almost all the same as the 2012 working OSX version that it was branched off of a decade ago.

And yet when we compile today, on a recent OSX (High Sierra, but installed a few days ago); "you're not allowed to do that" and then the OSX kernel Aborts the process explicitly when we simply copy the name of a shader to the name field of a texture. This has worked fine for 15 years, maybe 20 or 30.

This code originates from John Carmack and Id software or Lord "Forest Hale" havoc. They're both good programmers and Forest Hale is very careful.

How do I fix this.
It's not the code: it's the build environment, or maybe OSX now needs some sort of hacks etc which it didn't have.

In the code, strlncpy etc from OpenBSD is provided in darkplaces/common.h and common.c. For BSDs it's Idefe'd out as they allready have the function and there would be a conflict.

Remeber this code worked for 30 years straight, and 15 years without any tampering at all: up till now trying to compile it on "modern" OSX. And yes we are doing it on a mac-mini; not crosscompiling.

Please help.
たすけて

>> No.906842
File: 539 KB, 1600x900, xc.jpg [View same] [iqdb] [saucenao] [google]
906842

Yes I asked on stackexchange: they told me to fuck off. /g/ just deletes my post for "opposing trannyism" and "pedo"

>> No.906843
File: 151 KB, 892x321, Untitled222222222222222222222.jpg [View same] [iqdb] [saucenao] [google]
906843

These are some backtraces and stuff we've done (Chris, my mac friend, came over the house to try to figure it out too; but he was unable to)

https://pastebin.com/YYpjt71d GDB of Sig Abort once asked to load a
map from OSX kernel

https://pastebin.com/z2Q3mKAd printfs to standard out were commented
out, but still sig abort from kernel
https://pastebin.com/hPnkBFai
https://pastebin.com/1bxkY3x8
https://pastebin.com/YaxNT0ea
https://pastebin.com/naVBCMb6


=https://pastebin.com/xjUEBfcb
https://pastebin.com/JZLN9GXC

https://pastebin.com/UJk8ufqz

https://pastebin.com/yN3NfQxx
https://pastebin.com/2Bb0RXnq


(lldb) print texture->name
(char [64]) $0 = "textures/common/caulk"
(lldb) print name
(const char *) $1 = 0x0000000107c770c8 "textures/common/caulk"
(lldb)

(That is correct: that's what is supposed to be in those variables; no error here)

>> No.906844
File: 115 KB, 874x336, Untitled2222222222222.jpg [View same] [iqdb] [saucenao] [google]
906844

This is all from model_shared.c in darkplaces.
If one "defeats" the first strlcpy (ie by putting a hack that avoids the copy if the contents of both are at that point allready the same): the error just migrates down the code to the conditional at like 3161 or so:

>else if (!(texture->backgroundskinframes[j] = R_SkinFrame_LoadExternal(backgroundlayer->texturename[j], (backgroundlayer->texflags & texflagsmask) | texflagsor, false)))
> {
> Con_Printf("^1%s:^7 could not load texture ^3\"%s\"^7 (background frame %i) for shader ^2\"%s\"\n", loadmodel->name, backgroundlayer->texturename[j], j, texture->name);
>texture->backgroundskinframes[j] = R_SkinFrame_LoadMissing();
> }


The copyright line for this file is:
>/*
>Copyright (C) 1996-1997 Id Software, Inc.

>This program is free software; you can redistribute it and/or
>modify it under the terms of the GNU General Public License

Does this look familiar to you?
(Why or why not)


Id software didn't write
>shit code
Nor did the good Sir Lord Forest Hale Havoc.

It is not their code that is at fault.
And no code has been added in the interm regarding these functions. Infact they are the same in current darkplaces aswell.

The error doesn't show up until one tries to load a texture in a 3d map: so just running the binary and seeing that it loads doesn't help (which is what everyone does to see if the OSX build "works" (no one games on a Mac))

>> No.906846
File: 1.72 MB, 6016x4000, DSC_0575.jpg [View same] [iqdb] [saucenao] [google]
906846

>>>/g/87614456
>Not helping you because you dont like Madoka from Madoka magica.

Incorrect, see pic related

>> No.906847
File: 380 KB, 1286x660, 3rf33vr.png [View same] [iqdb] [saucenao] [google]
906847

This is my 3d work

>> No.906848
File: 171 KB, 852x666, Untitledwww2www.png [View same] [iqdb] [saucenao] [google]
906848

More 3d work.
It is all opensource
Just trying to fit in here.
Because I want build help with OSX build of the code.
Which I know you know people in your 3d jobs know how to do.
I want you to use company time to have them give advice.

>> No.906854
File: 123 KB, 1022x1022, m249parassforblendswap2.png [View same] [iqdb] [saucenao] [google]
906854

>> No.906855
File: 72 KB, 720x604, 9xqy0s04r3jz.jpg [View same] [iqdb] [saucenao] [google]
906855

>> No.906856
File: 164 KB, 850x677, fse.jpg [View same] [iqdb] [saucenao] [google]
906856

>> No.906857
File: 7 KB, 300x168, stya.jpg [View same] [iqdb] [saucenao] [google]
906857

>> No.906858
File: 120 KB, 923x923, m249parassforblendswap.png [View same] [iqdb] [saucenao] [google]
906858

>.

>> No.906863 [DELETED] 
File: 74 KB, 731x600, Luna.jpg [View same] [iqdb] [saucenao] [google]
906863

Not helping you because you won't tell me your favorite pastel horse

>> No.906896
File: 638 KB, 1920x1080, Dat quality render anon.jpg [View same] [iqdb] [saucenao] [google]
906896

>>906841
>How do I fix this Macintosh (Mac) (Apple Computer)
By buying a PC.