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

Duplicate symbol _BUFFER_BLOCK_SIZE when statically linking multiple modules #88624

Closed
freakboy3742 mannequin opened this issue Jun 19, 2021 · 4 comments
Closed

Duplicate symbol _BUFFER_BLOCK_SIZE when statically linking multiple modules #88624

freakboy3742 mannequin opened this issue Jun 19, 2021 · 4 comments
Assignees
Labels
3.10 only security fixes 3.11 only security fixes build The build process and cross-build extension-modules C modules in the Modules dir

Comments

@freakboy3742
Copy link
Mannequin

freakboy3742 mannequin commented Jun 19, 2021

BPO 44458
Nosy @gpshead, @freakboy3742, @animalize, @miss-islington
PRs
  • bpo-44458: Ensure BUFFER_BLOCK_SIZE symbol is statically allocated. #26808
  • [3.10] bpo-44458: Ensure BUFFER_BLOCK_SIZE symbol is statically allocated. (GH-26808) #26844
  • 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 = 'https://github.com/gpshead'
    closed_at = <Date 2021-06-22.07:12:19.493>
    created_at = <Date 2021-06-19.03:24:49.696>
    labels = ['extension-modules', 'build', '3.10', '3.11']
    title = 'Duplicate symbol _BUFFER_BLOCK_SIZE when statically linking multiple modules'
    updated_at = <Date 2021-06-22.07:12:19.492>
    user = 'https://github.com/freakboy3742'

    bugs.python.org fields:

    activity = <Date 2021-06-22.07:12:19.492>
    actor = 'gregory.p.smith'
    assignee = 'gregory.p.smith'
    closed = True
    closed_date = <Date 2021-06-22.07:12:19.493>
    closer = 'gregory.p.smith'
    components = ['Extension Modules']
    creation = <Date 2021-06-19.03:24:49.696>
    creator = 'freakboy3742'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44458
    keywords = ['patch']
    message_count = 4.0
    messages = ['396114', '396308', '396310', '396311']
    nosy_count = 4.0
    nosy_names = ['gregory.p.smith', 'freakboy3742', 'malin', 'miss-islington']
    pr_nums = ['26808', '26844']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue44458'
    versions = ['Python 3.10', 'Python 3.11']

    @freakboy3742
    Copy link
    Mannequin Author

    freakboy3742 mannequin commented Jun 19, 2021

    BPO-41486 added _BlocksOutputBuffer for the bz2, lzma and zlib module.

    Part of this patch included a new header file, pycore_blocks_output_buffer.h, which defines a BUFFER_BLOCK_SIZE constant.

    If two or more of the bz2, lzma or zlib modules are compiled as statically linked modules (i.e., added to Lib/Setup.local), this results in a duplicate symbol error when the Python executable is linked:

    duplicate symbol '_BUFFER_BLOCK_SIZE' in:
        libpython3.10.a(_bz2module.o)
        libpython3.10.a(_lzmamodule.o)
    duplicate symbol '_BUFFER_BLOCK_SIZE' in:
        libpython3.10.a(_bz2module.o)
        libpython3.10.a(zlibmodule.o)
    

    @freakboy3742 freakboy3742 mannequin added 3.10 only security fixes 3.11 only security fixes extension-modules C modules in the Modules dir build The build process and cross-build labels Jun 19, 2021
    @gpshead gpshead self-assigned this Jun 19, 2021
    @gpshead
    Copy link
    Member

    gpshead commented Jun 22, 2021

    New changeset 92c2e91 by Russell Keith-Magee in branch 'main':
    bpo-44458: Ensure BUFFER_BLOCK_SIZE symbol is statically allocated. (GH-26808)
    92c2e91

    @gpshead
    Copy link
    Member

    gpshead commented Jun 22, 2021

    New changeset cf73933 by Miss Islington (bot) in branch '3.10':
    bpo-44458: Ensure BUFFER_BLOCK_SIZE symbol is statically allocated. (GH-26808) (GH-26844)
    cf73933

    @gpshead
    Copy link
    Member

    gpshead commented Jun 22, 2021

    Good catch. We don't have buildbots statically linking the modules in these days, that'd be useful to prevent things like this from happening.

    @gpshead gpshead closed this as completed Jun 22, 2021
    @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.10 only security fixes 3.11 only security fixes build The build process and cross-build extension-modules C modules in the Modules dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant