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

./configure failing when --with-memory-sanitizer specified #86434

Closed
JaonHax mannequin opened this issue Nov 5, 2020 · 6 comments
Closed

./configure failing when --with-memory-sanitizer specified #86434

JaonHax mannequin opened this issue Nov 5, 2020 · 6 comments
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes build The build process and cross-build type-bug An unexpected behavior, bug, or error

Comments

@JaonHax
Copy link
Mannequin

JaonHax mannequin commented Nov 5, 2020

BPO 42268
Nosy @pablogsal, @erlend-aasland, @JaonHax
PRs
  • bpo-42268: Fail the configure step if the selected compiler doesn't support memory sanitizer #29806
  • [3.10] bpo-42268: Fail the configure step if the selected compiler doesn't support memory sanitizer (GH-29806) #29815
  • Files
  • configure-out.txt: ./configure failed output
  • configure-out-1.txt: ./configure successful output
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-11-28.21:24:58.253>
    created_at = <Date 2020-11-05.00:37:06.343>
    labels = ['3.10', 'type-bug', '3.9', 'build', '3.11']
    title = './configure failing when --with-memory-sanitizer specified'
    updated_at = <Date 2021-11-28.21:24:58.252>
    user = 'https://github.com/JaonHax'

    bugs.python.org fields:

    activity = <Date 2021-11-28.21:24:58.252>
    actor = 'pablogsal'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-11-28.21:24:58.253>
    closer = 'pablogsal'
    components = ['Build']
    creation = <Date 2020-11-05.00:37:06.343>
    creator = 'JaonHax'
    dependencies = []
    files = ['49569', '49570']
    hgrepos = []
    issue_num = 42268
    keywords = ['patch']
    message_count = 6.0
    messages = ['380386', '380389', '380392', '406739', '407159', '407232']
    nosy_count = 3.0
    nosy_names = ['pablogsal', 'erlendaasland', 'JaonHax']
    pr_nums = ['29806', '29815']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue42268'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    @JaonHax JaonHax mannequin added 3.9 only security fixes build The build process and cross-build type-bug An unexpected behavior, bug, or error labels Nov 5, 2020
    @JaonHax
    Copy link
    Mannequin Author

    JaonHax mannequin commented Nov 5, 2020

    Exact command run is as follows:
    sudo ./configure --with-pymalloc --with-assertions --enable-optimizations --enable-loadable-sqlite-extensions --enable-shared --with-address-sanitizer --with-undefined-behavior-sanitizer --with-memory-sanitizer -C

    (ran with root because it seemed to make more things succeed in the checks without those flags)

    The command's output is attached in configure-out.txt

    @JaonHax
    Copy link
    Mannequin Author

    JaonHax mannequin commented Nov 5, 2020

    Additional note, since I forgot it in the initial message: I'm building Python 3.9.0 from source on Debian v10, specifically the Debian VM on Chromebooks (which I believe is called Crostini).

    I've made sure to install all the proper dependencies, as far as I know, and I'm 99% sure that I can successfully build it if I remove the --with-memory-sanitizer flag. Running the command again without it to double-check.

    @JaonHax
    Copy link
    Mannequin Author

    JaonHax mannequin commented Nov 5, 2020

    Yeah, exactly as I thought, ran the exact same command except without --with-memory-sanitizer and the configuration was successful. The successful output has been attached in configure-out-1.txt for cross-comparison, if it's necessary.

    @erlend-aasland
    Copy link
    Contributor

    Reproducible on 3.9, 3.10, and on main.

    The --with-memory-sanitizer option adds "-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer" to CFLAGS, and "-fsanitize=memory -fsanitize-memory-track-origins=2" to LDFLAGS. The MemorySanitizer is a clang specific feature, AFAIK. You're using GCC, so what happens is that these (GCC incompatible) flags are added and the following compile check (getaddrinfo) fails.

    IMO, adding a compiler check and printing a warning if --with-memory-sanitizer is used with GCC should be an ok solution. Alternatively, we inform the user that we're switching to using the leak sanitiser, if we're on GCC.

    +pablo

    See also:

    @erlend-aasland erlend-aasland added 3.10 only security fixes 3.11 only security fixes labels Nov 21, 2021
    @pablogsal
    Copy link
    Member

    New changeset e71c12e by Pablo Galindo Salgado in branch 'main':
    bpo-42268: Fail the configure step if the selected compiler doesn't support memory sanitizer (GH-29806)
    e71c12e

    @pablogsal
    Copy link
    Member

    New changeset 8d1a580 by Pablo Galindo Salgado in branch '3.10':
    [3.10] bpo-42268: Fail the configure step if the selected compiler doesn't support memory sanitizer (GH-29806) (GH-29815)
    8d1a580

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes 3.10 only security fixes 3.11 only security fixes build The build process and cross-build type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants