We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Start a TiDB server with 'skip-grant-table' mode enabled:
(only the root user of the operating system can start the TiDB process with this mode) sudo $RUN_TIDB ...
Try to connect to TiDB:
$ mysql -u ...
Everything is OK.
A panic is noticed:
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x261b08a] goroutine 757 [running]: github.com/pingcap/tidb/privilege/privileges.(*Handle).Get(...) /home/bb7133/Projects/gopath/src/github.com/pingcap/tidb/privilege/privileges/cache.go:1485 github.com/pingcap/tidb/privilege/privileges.(*UserPrivileges).GetAuthPlugin(0xc010b16900, 0xc010b3c004, 0x4, 0x0, 0x0, 0x1, 0x3855880, 0x4065c00000000001, 0xc010b2e0a0) /home/bb7133/Projects/gopath/src/github.com/pingcap/tidb/privilege/privileges/privileges.go:224 +0x2a github.com/pingcap/tidb/session.(*session).AuthPluginForUser(0xc010337000, 0xc010b2e0a0, 0x0, 0x200, 0xae, 0xc0006b7380) /home/bb7133/Projects/gopath/src/github.com/pingcap/tidb/session/session.go:2302 +0xb8 github.com/pingcap/tidb/server.(*clientConn).checkAuthPlugin(0xc010b22000, 0x3fa0270, 0xc010b16090, 0xc0006b7878, 0xae, 0xae, 0x3c, 0x0, 0x0) /home/bb7133/Projects/gopath/src/github.com/pingcap/tidb/server/conn.go:810 +0xab github.com/pingcap/tidb/server.(*clientConn).readOptionalSSLRequestAndHandshakeResponse(0xc010b22000, 0x3fa0270, 0xc010b16090, 0x0, 0x0) /home/bb7133/Projects/gopath/src/github.com/pingcap/tidb/server/conn.go:682 +0x289 github.com/pingcap/tidb/server.(*clientConn).handshake(0xc010b22000, 0x3fa0270, 0xc010b16090, 0x3fa0270, 0xc010b16090) /home/bb7133/Projects/gopath/src/github.com/pingcap/tidb/server/conn.go:254 +0x41a github.com/pingcap/tidb/server.(*Server).onConn(0xc0009e3ee0, 0xc010b22000) /home/bb7133/Projects/gopath/src/github.com/pingcap/tidb/server/server.go:453 +0xa9 created by github.com/pingcap/tidb/server.(*Server).startNetworkListener /home/bb7133/Projects/gopath/src/github.com/pingcap/tidb/server/server.go:404 +0x8fc
Release Version: v5.2.0-alpha-582-g3d88be834 Edition: Community Git Commit Hash: 3d88be8344c3dbc6a344efbc69bee3d2297339cb Git Branch: release-5.2 UTC Build Time: 2021-08-
When skip-grant-table is enabled, the load of privilege is skipped:
skip-grant-table
tidb/session/session.go
Lines 2600 to 2609 in 4be6821
So p.Handle is nil, and TiDB will panic here:
p.Handle
nil
tidb/privilege/privileges/privileges.go
Line 224 in 723e2bc
A simple check like this can be used to solve this issue.
(BTW I think it's a bad idea to leave p.Handle == nil for skip-grant-table)
p.Handle == nil
The text was updated successfully, but these errors were encountered:
/assign @dveeden
Sorry, something went wrong.
Note: Make Sure that 'component', and 'severity' labels are added Example for how to fill out the template: #20100
dveeden
Successfully merging a pull request may close this issue.
Bug Report
1. Minimal reproduce step (Required)
Start a TiDB server with 'skip-grant-table' mode enabled:
Try to connect to TiDB:
2. What did you expect to see? (Required)
Everything is OK.
3. What did you see instead (Required)
A panic is noticed:
4. What is your TiDB version? (Required)
5. Comments
When
skip-grant-table
is enabled, the load of privilege is skipped:tidb/session/session.go
Lines 2600 to 2609 in 4be6821
So
p.Handle
isnil
, and TiDB will panic here:tidb/privilege/privileges/privileges.go
Line 224 in 723e2bc
A simple check like this can be used to solve this issue.
(BTW I think it's a bad idea to leave
p.Handle == nil
for skip-grant-table)The text was updated successfully, but these errors were encountered: