Coder Social home page Coder Social logo

lib-test test failure about liballocs HOT 3 CLOSED

stephenrkell avatar stephenrkell commented on August 19, 2024
lib-test test failure

from liballocs.

Comments (3)

stephenrkell avatar stephenrkell commented on August 19, 2024

Hmm. Interesting. That test is passing for me, but it is sensitive to things like memory placement.

The failure line (static.c:172) is testing for a NULL info pointer from dl_iterate_phdr, which should never happen. However, sometimes the optimizer merges abort() paths, so the line numbers are not reliable. Can you do

cd ~/Projects/liballocs && make -C src clean && make DEBUG=1

and generate another backtrace? That should rebuild with -O0.

For background: 'lib-test' exists for running unit tests that get baked into a special liballocs-test.so binary. The idea is that the test program dlopens that binary, and the unit tests are run in the constructor logic. This has always seemed ugly to me, but I don't know good ways of running unit tests that would work for liballocs.

from liballocs.

jryans avatar jryans commented on August 19, 2024

Thanks for the context and tips!

Curiously, the test passes when rebuilding with DEBUG=1. Looking a bit further, it appears related to LTO:

If I change the following in src/Makefile, then the optimised build allows the test to pass:

-    FAST_EXTRA_CFLAGS := -O3 -DNDEBUG -flto -ffat-lto-objects
+    FAST_EXTRA_CFLAGS := -O3 -DNDEBUG

This is with gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0.

from liballocs.

stephenrkell avatar stephenrkell commented on August 19, 2024

This is fixed as of 0f044d6... following several changes to how this test works, it is now re-enabled.

It's arguably cheating a bit, because in the new way of things, this particular test isn't run against an optimised build of the main liballocs code... it uses a special build which is always -O0 -DDEBUG -DTEST. So I can't be sure whether there is any LTO issue. But enough has changed that that would morally be a different issue. LTO of liballocs will get more testing via libcrunch, which I will get running in CI soon-ish.

from liballocs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.