Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

navtree js output varies from ASLR #8584

Open
bmwiedemann opened this issue Jun 2, 2021 · 18 comments
Open

navtree js output varies from ASLR #8584

bmwiedemann opened this issue Jun 2, 2021 · 18 comments
Labels
needinfo reported bug is incomplete, please add additional info

Comments

@bmwiedemann
Copy link

Describe the bug
doxygen produces nondeterministic navtreedata/index.js output from certain input (see attached libzypp-min.tar.gz) unless ASLR is disabled.

Expected behavior
Output shoud be deterministic using the same doxygen binary, input and environment.

To Reproduce
in Linux with doxygen-1.9.1, do

tar xf libzypp-min.tar.gz
cd libzypp-min
for i in $(seq 1 10) ; do ./build.sh ; done|sort|uniq -c
      4 2b83f77db2e4c27380ed01f2dafd8295  -
      6 cefbad1d7e1d909b1002eea8870544b2  -

Version
doxygen-1.9.1 in openSUSE-Tumbleweed 20210525 x86_64

Additional context
similar to #8158 and #7474

@albert-github albert-github added the needinfo reported bug is incomplete, please add additional info label Jun 2, 2021
@albert-github
Copy link
Collaborator

The reproducibility issues are very inconvenient. I haven't looked at this problem specific, but recently we fixed an issue in respect so problem in the sorting in the master version.

  • could you try the master version to see whether the master version still exhibits the problem?

@albert-github
Copy link
Collaborator

albert-github commented Jun 2, 2021

I just tried the 1.9.1 on Cygwin and here the problem does not occur. I get the always ca101aafea79a3953c3da5fa911f335f (this is different from yours but can be due to paths).

  • The example is nicely small, so can you save the different html directories as well and publish them here as well?

I see that ASLR means: Address space layout randomization. I don't know whether or not Cygwin is using this (I don't think so), is there a way that I can enable it on (any) system?
Problem is probably a non initialized variable or pointer, that sometimes hit a "strange" value.

@bmwiedemann
Copy link
Author

bmwiedemann commented Jun 2, 2021

https://cygwin.com/pipermail/cygwin/2020-March/244107.html suggests to compile with g++ -Xlinker --dynamicbase options. Also it needs Vista or newer.

To experiment, you can also try the samples at https://github.com/bmwiedemann/theunreproduciblepackage/tree/master/aslr

@bmwiedemann
Copy link
Author

With master I only got order variations in the .doxytag file. I can try to trace down that one, too.
Can you link me the sorting issue fix?

@albert-github
Copy link
Collaborator

I think the fix is in doxygen.cpp (bottom of function readDir):

  if (resultList)
  {
    // sort the resulting list to make the order platform independent.
    std::sort(resultList->begin(),
              resultList->end(),
              [](const auto &f1,const auto &f2) { return qstricmp(f1.c_str(),f2.c_str())<0; });
  }

as part of commit e965e5d for the issue #8560 (see comments #8560 (comment) and #8560 (comment)).

@albert-github
Copy link
Collaborator

Could you publish the difference in the .doxytag files / the complete files that are different so that we can have a quick look and maybe give some pointers?

@albert-github
Copy link
Collaborator

@bmwiedemann

  • any progress?
  • what are the differences in the .doxytag files / where can we find them?

@bmwiedemann
Copy link
Author

https://rb.zq1.de/temp/libzypp-17.25.10-build.tar.xz (21MB) has the two versions as
a/libzypp-17.25.10/build/doc/autodoc/libzypp.doxytag
b/libzypp-17.25.10/build/doc/autodoc/libzypp.doxytag

along with the sources.
disorderfs might help to debug such issue from filesystem-readdir-order.

@albert-github
Copy link
Collaborator

Thanks for the information!
How long lasting is the xz file as it is on a temp directory? I copied the the file already, but not sure whether other developers / maintainers will still have access later on.

Looking at the both directories I see differences in the following files:

  • libzypp-17.25.10/build/CMakeCache.txt
    just a change in the name of the used node / machine
  • libzypp-17.25.10/build/CMakeFiles/3.20.2/CMakeSystem.cmake:
    signalling a.o other differences are similar
    < set(CMAKE_HOST_SYSTEM "Linux-5.3.18-lp152.50-default")
    ---
    > set(CMAKE_HOST_SYSTEM "Linux-5.3.18-lp152.66-default")
    
  • libzypp-17.25.10/build/CMakeFiles/CMakeError.log
    looks like differences is some CMake directory names like CMakeFiles/cmTC_4e123.dir versus CMakeFiles/cmTC_d3530.dir
  • libzypp-17.25.10/build/CMakeFiles/CMakeOutput.log
    see CMakeError.log above
  • libzypp-17.25.10/build/DartConfiguration.tcl
    just a change in the name of the used node / machine
  • libzypp-17.25.10/build/install_manifest.txt
    file has the same information but in a different order!
  • libzypp-17.25.10/build/doc/autodoc/libzypp.doxytag: the important files with the differences. the files contain the same information but in a different order (seen the remark at the top, so added here the both tag files again: Uploading doxytag.tar.gz…).
    It looks like to have to do with with the compound kind="file" in case the files names are the same but the paths are different we see these double files names as (from the tag file with the number of occurrences):
        2     <name>PoolImpl.cc</name>
        2     <name>PoolImpl.h</name>
        2     <name>Resolver.cc</name>
        2     <name>Resolver.h</name>
        2     <name>Types.h</name>
        3     <name>Downloader.cc</name>
        3     <name>Downloader.h</name>
    
    I saw the problem occur a.o. with Downloader.h

@doxygen might this be a sorting problem where only the file name is taken into consideration and not the full path?

@bmwiedemann
Copy link
Author

Using the full path can have its own downsides when people want to be able to get identical output from building in /home/foo and /home/bar (Debian does ; openSUSE mostly uses constant build path)
Relative paths can be a way out or content-based disambiguation.

@albert-github
Copy link
Collaborator

I didn't mean using full paths but using internally for the sorting not only the name but as a second level the path.

@doxygen
Copy link
Owner

doxygen commented Jun 15, 2021

Please verify if the commit I just pushed fixes the unpredictable ordering issue.

@bmwiedemann
Copy link
Author

My tests still show differences in the .doxytag file using master (commit 251e18b7). Also that issue is no more about ASLR, but related to filesystem-order. Maybe we should open another issue to make that clearer?

@albert-github
Copy link
Collaborator

Commit 251e18b7? I don't see this in the doxygen tree (I searched the complete git log for 251e18b7), so it is unclear, to me, which version you are using.
The doxygen commit to be used is 6fc45ba (or newer)

@bmwiedemann
Copy link
Author

Ah, indeed it was 6fc45ba ; was just looking at a file hash in the diff.

@albert-github
Copy link
Collaborator

@bmwiedemann

  • probably best again the doxytag files ...
  • when you have it, might be useful, can you also provide the console output of the erroneous runs?, i.e. the QUIET=NO output)

@doxygen
at first glance maybe in index.cpp, function writeFileIndex here something is done depending on FULL_PATH_NAMES (including sorting)

@bmwiedemann
Copy link
Author

doxytags.tar.gz

@albert-github
Copy link
Collaborator

Looks like it has to do with:

.../libzypp-17.25.10/zypp/Resolver.h
.../libzypp-17.25.10/zypp/solver/detail/Resolver.h

and

....libzypp-17.25.10/zypp/Resolver.cc
.../libzypp-17.25.10/zypp/solver/detail/Resolver.cc

@bmwiedemann any chance for the console output?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needinfo reported bug is incomplete, please add additional info
Projects
None yet
Development

No branches or pull requests

3 participants