René's URL Explorer Experiment


Title: Fatal Python error: GC object already tracked · Issue #11 · timogasda/python-sqlparser · GitHub

Open Graph Title: Fatal Python error: GC object already tracked · Issue #11 · timogasda/python-sqlparser

X Title: Fatal Python error: GC object already tracked · Issue #11 · timogasda/python-sqlparser

Description: When using the library by running up and down the parse tree and extracting used columns and attributes of the parsed query I frequently ran into inexplicable errors and eventually into segmentation faults that crashed my python program....

Open Graph Description: When using the library by running up and down the parse tree and extracting used columns and attributes of the parsed query I frequently ran into inexplicable errors and eventually into segmentatio...

X Description: When using the library by running up and down the parse tree and extracting used columns and attributes of the parsed query I frequently ran into inexplicable errors and eventually into segmentatio...

Opengraph URL: https://github.com/timogasda/python-sqlparser/issues/11

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Fatal Python error: GC object already tracked","articleBody":"When using the library by running up and down the parse tree and extracting used columns and attributes of the parsed query I frequently ran into inexplicable errors and eventually into segmentation faults that crashed my python program. When going for a proof of concept I ended with the following code that only works for me with iPython. However, I am pretty sure that the problem is not iPython but sqlparser as segmentation faults occurred on multiple occasions when using the library and when doing the proof of concept I was able to eliminate everything but sqlparser related code - however the overall error changed to the GC problem.\r\n\r\nI am using:\r\n- an Ubuntu 14.04\r\n- Python 2.7.6 (default, Oct 26 2016, 20:30:19)\r\n- IPython 1.2.1\r\n\r\nThe code:\r\n```\r\nimport sqlparser\r\n\r\ndef analyze_result_column_list(node):\r\n    ret = []\r\n    for subnode in node.list:\r\n        if subnode.expr.leftOperand is not None:\r\n            operand = subnode.expr.leftOperand\r\n            for item in operand.caseExpression.whenClauseItemList:\r\n                ret.append(item.comparison_expr.leftOperand.objectOperand.get_text())\r\n    return ret\r\n\r\n\r\ndef analyze_select_statement(root):\r\n    result_attributes = analyze_result_column_list(root.resultColumnList)\r\n    return [], []\r\n\r\n\r\nclass SqlQuery():\r\n    _query_string = None\r\n    _defines = None\r\n    _uses = None\r\n\r\n    def __init__(self, stmt, vendor=sqlparser.gsp_dbvendor.dbvmysql):\r\n        root = stmt.get_root()\r\n        self._uses, self._defines = analyze_select_statement(root)\r\n\r\n\r\nparser = sqlparser.Parser()\r\nquery = \"SELECT (CASE WHEN password = MD5( 'bitnami ') THEN 1 ELSE 0 END) AS zend_auth_credential_match FROM si_user WHERE (email = 'user@example.com ')\"\r\nparser.check_syntax(query)\r\nstmt = parser.get_statement(0)\r\npq = SqlQuery(stmt)\r\npq._defines\r\npq._uses\r\nprint \"This was a triump,h \\nI make a note here: \\nHUGE SUCCESS.\"\r\n```\r\nRemoving `self._uses, self._defines = analyze_select_statement(root)` leads to the error not manifesting.\r\n\r\nThe bug can be recreated using a fresh virtual environment and then installing nothing but the sqlparser ,as described in the readme. Then do the following steps:\r\n1. activate the virtenv\r\n2. start IPython\r\n3. mark and copy the above code\r\n4. type %paste\r\n```\r\nPython 2.7.6 (default, Oct 26 2016, 20:30:19) \r\nType \"copyright\", \"credits\" or \"license\" for more information.\r\n\r\nIPython 1.2.1 -- An enhanced Interactive Python.\r\n?         -\u003e Introduction and overview of IPython's features.\r\n%quickref -\u003e Quick reference.\r\nhelp      -\u003e Python's own help system.\r\nobject?   -\u003e Details about 'object', use 'object??' for extra details.\r\n\r\nIn [1]: %paste\r\nimport sqlparser\r\n\r\ndef analyze_result_column_list(node):\r\n    ret = []\r\n    for subnode in node.list:\r\n        if subnode.expr.leftOperand is not None:\r\n            operand = subnode.expr.leftOperand\r\n            for item in operand.caseExpression.whenClauseItemList:\r\n                ret.append(item.comparison_expr.leftOperand.objectOperand.get_text())\r\n    return ret\r\n\r\n\r\ndef analyze_select_statement(root):\r\n    result_attributes = analyze_result_column_list(root.resultColumnList)\r\n    return [], []\r\n\r\n\r\nclass SqlQuery():\r\n    _query_string = None\r\n    _defines = None\r\n    _uses = None\r\n\r\n    def __init__(self, stmt, vendor=sqlparser.gsp_dbvendor.dbvmysql):\r\n        root = stmt.get_root()\r\n        self._uses, self._defines = analyze_select_statement(root)\r\n\r\n\r\nparser = sqlparser.Parser()\r\nquery = \"SELECT (CASE WHEN password = MD5( 'bitnami ') THEN 1 ELSE 0 END) AS zend_auth_credential_match FROM si_user WHERE (email = 'user@example.com ')\"\r\nparser.check_syntax(query)\r\nstmt = parser.get_statement(0)\r\npq = SqlQuery(stmt)\r\npq._defines\r\npq._uses\r\n\r\n## -- End pasted text --\r\nFatal Python error: GC object already tracked\r\nAborted (core dumped)\r\n```\r\n\r\nIf any additional feedback/versions/etc. are needed please notify me as I am happy to help in any way possible to get to the root of this issue.","author":{"url":"https://github.com/simkoc","@type":"Person","name":"simkoc"},"datePublished":"2017-05-30T18:46:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/11/python-sqlparser/issues/11"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:cfff142b-2f7b-8523-dec3-5547d49147ae
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA0CC:B8295:131523D:1800B43:697ED7A4
html-safe-noncecf1043f89ddeeabac3fa34eb1ff53f42ee10dc39d97a8be0b16c13d3c98154e1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMENDOkI4Mjk1OjEzMTUyM0Q6MTgwMEI0Mzo2OTdFRDdBNCIsInZpc2l0b3JfaWQiOiI3MjU5OTg2NjE4OTY0OTU3MDkyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac455240edf34cc41bce212a52a95903d5bb511c3d440d1ad302dce576c7febde1
hovercard-subject-tagissue:232345694
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/timogasda/python-sqlparser/11/issue_layout
twitter:imagehttps://opengraph.githubassets.com/7c63073c2b6da7fec7b87ff2ef85a147c48ddb800a0d0b520ad791f7310a6647/timogasda/python-sqlparser/issues/11
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/7c63073c2b6da7fec7b87ff2ef85a147c48ddb800a0d0b520ad791f7310a6647/timogasda/python-sqlparser/issues/11
og:image:altWhen using the library by running up and down the parse tree and extracting used columns and attributes of the parsed query I frequently ran into inexplicable errors and eventually into segmentatio...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesimkoc
hostnamegithub.com
expected-hostnamegithub.com
None60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6
turbo-cache-controlno-preview
go-importgithub.com/timogasda/python-sqlparser git https://github.com/timogasda/python-sqlparser.git
octolytics-dimension-user_id2446349
octolytics-dimension-user_logintimogasda
octolytics-dimension-repository_id20052915
octolytics-dimension-repository_nwotimogasda/python-sqlparser
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20052915
octolytics-dimension-repository_network_root_nwotimogasda/python-sqlparser
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7c85641c598ad130c74f7bcc27f58575cac69551
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/timogasda/python-sqlparser/issues/11#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftimogasda%2Fpython-sqlparser%2Fissues%2F11
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftimogasda%2Fpython-sqlparser%2Fissues%2F11
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=timogasda%2Fpython-sqlparser
Reloadhttps://patch-diff.githubusercontent.com/timogasda/python-sqlparser/issues/11
Reloadhttps://patch-diff.githubusercontent.com/timogasda/python-sqlparser/issues/11
Reloadhttps://patch-diff.githubusercontent.com/timogasda/python-sqlparser/issues/11
timogasda https://patch-diff.githubusercontent.com/timogasda
python-sqlparserhttps://patch-diff.githubusercontent.com/timogasda/python-sqlparser
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Ftimogasda%2Fpython-sqlparser
Fork 20 https://patch-diff.githubusercontent.com/login?return_to=%2Ftimogasda%2Fpython-sqlparser
Star 75 https://patch-diff.githubusercontent.com/login?return_to=%2Ftimogasda%2Fpython-sqlparser
Code https://patch-diff.githubusercontent.com/timogasda/python-sqlparser
Issues 10 https://patch-diff.githubusercontent.com/timogasda/python-sqlparser/issues
Pull requests 1 https://patch-diff.githubusercontent.com/timogasda/python-sqlparser/pulls
Actions https://patch-diff.githubusercontent.com/timogasda/python-sqlparser/actions
Projects 0 https://patch-diff.githubusercontent.com/timogasda/python-sqlparser/projects
Wiki https://patch-diff.githubusercontent.com/timogasda/python-sqlparser/wiki
Security 0 https://patch-diff.githubusercontent.com/timogasda/python-sqlparser/security
Insights https://patch-diff.githubusercontent.com/timogasda/python-sqlparser/pulse
Code https://patch-diff.githubusercontent.com/timogasda/python-sqlparser
Issues https://patch-diff.githubusercontent.com/timogasda/python-sqlparser/issues
Pull requests https://patch-diff.githubusercontent.com/timogasda/python-sqlparser/pulls
Actions https://patch-diff.githubusercontent.com/timogasda/python-sqlparser/actions
Projects https://patch-diff.githubusercontent.com/timogasda/python-sqlparser/projects
Wiki https://patch-diff.githubusercontent.com/timogasda/python-sqlparser/wiki
Security https://patch-diff.githubusercontent.com/timogasda/python-sqlparser/security
Insights https://patch-diff.githubusercontent.com/timogasda/python-sqlparser/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/timogasda/python-sqlparser/issues/11
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/timogasda/python-sqlparser/issues/11
Fatal Python error: GC object already trackedhttps://patch-diff.githubusercontent.com/timogasda/python-sqlparser/issues/11#top
https://github.com/simkoc
https://github.com/simkoc
simkochttps://github.com/simkoc
on May 30, 2017https://github.com/timogasda/python-sqlparser/issues/11#issue-232345694
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.