This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
http://sourceware.org/bugzilla/show_bug.cgi?id=13882 - contains a patch.
In fact it contains pointers to archives of this list, where Jeff posted patches.
Last time we discussed the bugs on the mailing list, Roland mentioned that he wanted to review this later. Roland, could you do this now, please? Or anybody else volunteering to review this bug in the dynamic linker?
I don't recall saying that and I don't think I have especially great context on this stuff. I think Jeff should just restart the review by posting the minimal patch he wants to get in.
When sorting objects to ensure proper initialization order we terminate the sort too early resulting in incorrect initialization order for DSOs.
Additionally, the sorting code is limited in the number of DSOs it can properly handle because it using an array of chars for counts.
"seen" is actually a misnomer. It actually represents the number of times we have looked at an object to see if there's an object later in the list for which the current one is a dependency.
1 depends on 2 2 depends on 3 3 depends on 4 4 depends on 5 5 depends on 6
At the start of the code to reorder the list and detect cycles, assume the objects arrive in the following order
At this point the code (erroneously) believes it's hit a cycle as it's already marked object 6 as being seen twice.
However, there clearly isn't a cycle if you review the dependencies. Thus, the check for an object already being seen twice is wrong.
5 6 4 3 2 1 6 4 5 3 2 1 4 5 6 3 2 1 5 6 3 4 2 1 6 3 4 5 2 1 3 4 5 6 2 1 4 5 6 2 3 1 5 6 2 3 4 1 6 2 3 4 5 1 2 3 4 5 6 1 3 4 5 6 1 2 4 5 6 1 2 3 5 6 1 2 3 4 6 1 2 3 4 5 1 2 3 4 5 6
Object #6 is moved 5 times. It's fairly simple to show that for any given number of objects the worst case scenario is N - 1 moves.
Attachment:
patch
Description: Text document
Attachment:
test.tar
Description: Unix tar archive
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |