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

[YSQL] Apply non-zero offset after checking against NULL pointer #11236

Closed
tedyu opened this issue Jan 26, 2022 · 0 comments
Closed

[YSQL] Apply non-zero offset after checking against NULL pointer #11236

tedyu opened this issue Jan 26, 2022 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL)

Comments

@tedyu
Copy link
Contributor

tedyu commented Jan 26, 2022

Description

In ASAN test run, we can see the following:

ts1|pid72520|:24791 ../../../../../src/postgres/contrib/pg_trgm/trgm_gist.c:691:40: runtime error: applying non-zero offset 16 to null pointer
ts1|pid72520|:24791     #0 0x7f876a014577 in gtrgm_penalty /nfusr/alma8-gcp-cloud/jenkins-worker-r0jtg3/jenkins/jenkins-github-yugabyte-db-phabricator-158083/src/postgres/contrib/pg_trgm/../../../../../src/postgres/contrib/pg_trgm/trgm_gist.c:691:40
ts1|pid72520|:24791     #1 0x13d8ae5 in FunctionCall3Coll /nfusr/alma8-gcp-cloud/jenkins-worker-r0jtg3/jenkins/jenkins-github-yugabyte-db-phabricator-158083/src/postgres/src/backend/utils/fmgr/../../../../../../../src/postgres/src/backend/utils/fmgr/fmgr.c:1182:11

This revision delays the application of non-zero offset after checking that cache is not NULL.

@tedyu tedyu added the area/ysql Yugabyte SQL (YSQL) label Jan 26, 2022
@tedyu tedyu self-assigned this Jan 26, 2022
tedyu added a commit that referenced this issue Feb 16, 2022
Summary:
In ASAN test run, we can see the following:
```
ts1|pid72520|:24791 ../../../../../src/postgres/contrib/pg_trgm/trgm_gist.c:691:40: runtime error: applying non-zero offset 16 to null pointer
ts1|pid72520|:24791     #0 0x7f876a014577 in gtrgm_penalty /nfusr/alma8-gcp-cloud/jenkins-worker-r0jtg3/jenkins/jenkins-github-yugabyte-db-phabricator-158083/src/postgres/contrib/pg_trgm/../../../../../src/postgres/contrib/pg_trgm/trgm_gist.c:691:40
ts1|pid72520|:24791     #1 0x13d8ae5 in FunctionCall3Coll /nfusr/alma8-gcp-cloud/jenkins-worker-r0jtg3/jenkins/jenkins-github-yugabyte-db-phabricator-158083/src/postgres/src/backend/utils/fmgr/../../../../../../../src/postgres/src/backend/utils/fmgr/fmgr.c:1182:11
```

This revision delays the application of non-zero offset after checking that cache is not NULL.

Test Plan: mvn test -Dtest=org.yb.pgsql.TestPgRegressContribPgTrgm

Reviewers: amartsinchyk, myang

Reviewed By: myang

Subscribers: yql

Differential Revision: https://phabricator.dev.yugabyte.com/D15021
@tedyu tedyu closed this as completed Feb 16, 2022
jayant07-yb pushed a commit to jayant07-yb/yugabyte-db that referenced this issue Mar 8, 2022
…ULL pointer

Summary:
In ASAN test run, we can see the following:
```
ts1|pid72520|:24791 ../../../../../src/postgres/contrib/pg_trgm/trgm_gist.c:691:40: runtime error: applying non-zero offset 16 to null pointer
ts1|pid72520|:24791     #0 0x7f876a014577 in gtrgm_penalty /nfusr/alma8-gcp-cloud/jenkins-worker-r0jtg3/jenkins/jenkins-github-yugabyte-db-phabricator-158083/src/postgres/contrib/pg_trgm/../../../../../src/postgres/contrib/pg_trgm/trgm_gist.c:691:40
ts1|pid72520|:24791     #1 0x13d8ae5 in FunctionCall3Coll /nfusr/alma8-gcp-cloud/jenkins-worker-r0jtg3/jenkins/jenkins-github-yugabyte-db-phabricator-158083/src/postgres/src/backend/utils/fmgr/../../../../../../../src/postgres/src/backend/utils/fmgr/fmgr.c:1182:11
```

This revision delays the application of non-zero offset after checking that cache is not NULL.

Test Plan: mvn test -Dtest=org.yb.pgsql.TestPgRegressContribPgTrgm

Reviewers: amartsinchyk, myang

Reviewed By: myang

Subscribers: yql

Differential Revision: https://phabricator.dev.yugabyte.com/D15021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL)
Projects
None yet
Development

No branches or pull requests

1 participant