Skip to content

mmap crashes just on boundary. #49542

Closed
Closed

Description

@ocean-city
BPO 5292
Files
  • fix_segfault_on_boundary.patch
  • 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 2009-02-17.10:13:42.160>
    created_at = <Date 2009-02-17.09:35:55.773>
    labels = ['extension-modules', 'type-crash']
    title = 'mmap crashes just on boundary.'
    updated_at = <Date 2009-02-17.10:13:42.158>
    user = 'https://bugs.python.org/ocean-city'

    bugs.python.org fields:

    activity = <Date 2009-02-17.10:13:42.158>
    actor = 'ocean-city'
    assignee = 'none'
    closed = True
    closed_date = <Date 2009-02-17.10:13:42.160>
    closer = 'ocean-city'
    components = ['Extension Modules']
    creation = <Date 2009-02-17.09:35:55.773>
    creator = 'ocean-city'
    dependencies = []
    files = ['13115']
    hgrepos = []
    issue_num = 5292
    keywords = ['patch']
    message_count = 3.0
    messages = ['82307', '82308', '82314']
    nosy_count = 1.0
    nosy_names = ['ocean-city']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue5292'
    versions = ['Python 2.6', 'Python 3.0', 'Python 3.1', 'Python 2.7']

    Activity

    1. ocean-city commented on Feb 17, 2009

      ocean-citymannequin
      MannequinAuthor

      I noticed following code crashes. I'll post fix soon.

      import mmap
      import os
      
      def main():
      	align = mmap.ALLOCATIONGRANULARITY
      	path = os.path.splitext(__file__)[0] + ".txt"
      	with open(path, "w") as f:
      		f.write("0" * align)
      		f.write("1" * align)
      		f.write("2" * align)
      	with open(path, "r+") as f:
      		m = mmap.mmap(f.fileno(), align)
      	m[align] # crash
              m[align] = '1' # crash too
      
      if __name__ == '__main__':
      	main()
    2. added
      type-crashA hard crash of the interpreter, possibly with a core dump
      on Feb 17, 2009
    3. ocean-city commented on Feb 17, 2009

      ocean-citymannequin
      MannequinAuthor

      Here is a patch.

    4. ocean-city commented on Feb 17, 2009

      ocean-citymannequin
      MannequinAuthor

      This is obvious bug (and fix is obvious too), so I've commited in r69714.

    5. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      extension-modulesC modules in the Modules dirtype-crashA hard crash of the interpreter, possibly with a core dump

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions