Git Product home page Git Product logo

Comments (8)

plq avatar plq commented on May 26, 2024 2

https://bugs.chromium.org/p/crashpad/issues/detail?id=339

from sentry-native.

bjorn avatar bjorn commented on May 26, 2024

So in particular, this is about the following code in crashpad, which has a comment about why it can't check the GLIBC version:

https://github.com/getsentry/crashpad/blob/2fb4e9e6a4328ed49b15eec0a848fcc646208840/compat/linux/sys/mman.h#L22-L38

Rather than checking the version, it seems to be enough to actually add the throw() bit in the .cc file, to get it to compile at least (I haven't tested the resulting binary).

from sentry-native.

mitsuhiko avatar mitsuhiko commented on May 26, 2024

I think the right fix here would be to make sure the throw specified is on there for C++. I'm just not sure if all glibc versions have that or if that then breaks it for other setups.

from sentry-native.

Swatinem avatar Swatinem commented on May 26, 2024

I will close this for now, as this is specific to crashpad on linux, which we do not yet support. We will revisit this in a few weeks after we have breakpad support ready.

from sentry-native.

plq avatar plq commented on May 26, 2024

This is only a problem with a recent clang in c++17 mode as both clang -std=c++14 and GCC (I only tried c++17) seem to work fine.

The workaround thus is the following:

if (LINUX AND CLANG)  # <- pseudocode
    set_property(
        SOURCE /path/to/crashpad/compat/linux/sys/mman.cc
        APPEND PROPERTY COMPILE_FLAGS "-std=c++14"
    )
endif()

I'm using cmake files generated by a slightly modified version of gn_to_cmake.py on windows, darwin and linux without any problems. The above should come right after include()'ing the generated CMakeFiles.ext file.

from sentry-native.

Swatinem avatar Swatinem commented on May 26, 2024

gn_to_cmake.py

oh nice! I wish I knew about that one before

from sentry-native.

plq avatar plq commented on May 26, 2024

I dug a bit more: glibc-2.26 does not have this function. glibc-2.27 and later has it, always with __THROW in the declaration. __THROW is a glibc macro which compiles to nothing for gcc and select (very old) g++ versions.

If it's desired to avoid preprocessor checks, one can check with cmake (or gn) to see whether this function exists and compile mman.cc selectively.

from sentry-native.

plq avatar plq commented on May 26, 2024

The right thing to do is to patch crashpad to have __THROW in both declaration and definition of the said function as that's what it's trying to imitate here. Checking for glibc version is the wrong approach imo.

from sentry-native.

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.