Originally posted by Weasel
View Post
How many times do I have to link to it before you pull you head out ass. This is a symbol problem. The fact that you have multi symbols leading to multi functions performing allocations. That is the problem here.
Originally posted by Weasel
View Post
Originally posted by Weasel
View Post
You can have a program that has loaded 3 libraries that contains gcc malloc due to that being global only 1 function in fact gets used. If the wrong default is picked that what LD_PRELOAD allows you to change. Load the library first the application should use for the default symbols.
libcapsule is also duplicating this behaviour where it looks at the steam runtime and the host runtime and choose the newest glibc to be assigned as default for your memory allocation, syscall cache, locking functions.... Application using libcapsule may not be using the glibc it loaded but in fact using the one libcapsule loaded and swapped the defaults in.
This is a mirror problem.
The problem you are referring to is where two symbols in two different libraries the loader merges them into 1 function and the application has a issue because both functions have different behaviours to what is expected leading to a crash because program expect them to be different. This first form of Symbol Conflict.
The problem I am referring to again you start off with two symbols in two different libraries except this time they fail to be made into 1 function and both functions get used one from each library. This causes a conflict to happen in like memory allocation issues because you end up using 2 incompatible methods when you should have only been using 1 method. This is the second form of Symbol Conflict this one is known for causing data corruptions and other strange issues.
Both problems are symbol conflicts where you have 2 symbols and behaviour is not want developer expected.
The second one is way more evil its like this bit of code is doing an allocate this should be shareable as it an allocate done with malloc right then it explodes because one bit of program was built with 1 version of visual studio runtime and another bit was built with a different visual studio runtime. You rebuild the program with the same visual studio runtime across the board and it behaves it self again.
Notice they are exact mirrors. Dammed if you merge the symbol so they 1 function dammed if you don't merge the symbols so they are 2 functions.
Now comes the question how do you mark what symbols should be processed globally and what symbols should come from a particular dll/so. Dll you don't have any way to declare functions as global. ELF you do have means to declare functions global and in full ELF as SUN designed you have means using versioned to say these functions must come from X library using filter don't use the global resolve here. In fact versioned design allows pulling functions in as filtered as hidden so not entered into the global resolve table.
DLL design only deals with the the first issue that you are tunnel visioned in on. ELF fully implemented allows dealing with both cases but requires developer to provide direction like with versioned declaring filter.
Comment