GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Segfaults and wrong parse errors when using object_hook · Issue #48 · python-rapidjson/python-rapidjson

Segfaults and wrong parse errors when using object_hook #48

New issue
Copy link
New issue
Copy link
Closed
Closed
Segfaults and wrong parse errors when using object_hook#48
Copy link

Description

@lightblu
lightblu
opened on Nov 21, 2016
Issue body actions

First, I am not really sure about my diagnosis because it is not easy to reproduce, but I have ran tests often and long enough to be quite sure. It seems like I'm seeing segfaults or irreproducible (i.e. when feeding the json again, it parses just fine) parse errors ("ValueError: Parse error at offset 2881568: Terminate parsing due to Handler error.") when using rapidjson.loads with an object_hook callback.

Using Python's faulthandler, the segfaults come from no definite place. The offset the parse error happens is always on the "}," between two records (so after the object_hook callback has been called?).

I tried this with Alpine Linux 3.4.4 and their Python 3.5 apks, a freshly compiled Python 3.5.2, and also a freshly compiled Python 3.5.2 on latest Debian. python-rapidjson is 0.0.6 from PyPI.

My application is a AWS Kinesis client app, which just parses jsons from the incoming stream and writes these to S3. I cannot reproduce without writing to S3, so it seems like boto3/urllib3/socket interaction is required for this to happen. Chances to see this increase when under load (continuously parsing ~9MB jsons) and using multiple threads, although I experienced these faults also completely single threaded.

Activity

  1. lelit commented on Jan 26, 2017

    @lelit
    lelit
    on Jan 26, 2017
    Contributor
    More actions

    Is there any chance you can try out current version? In version 0.0.8 we upgraded to latest 1.1 version of RapidJSON, that maybe makes a difference.

  2. lelit
    added a commit that references this issue on Mar 4, 2017

    Fix a refcount error when passing object_hook to loads()

    d415bc7
  3. lelit commented on Mar 5, 2017

    @lelit
    lelit
    on Mar 5, 2017
    Contributor
    More actions

    I think that the refcount problems I identified and fixed in 0.0.11 are by any chance what originated this issue.
    Please reopen the issue should that not be true.
    Thank you!

  4. lelit
    closed this as completedon Mar 5, 2017
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.