Skip to content

fatal error: sync: unlock of unlocked mutex #57798

Description

@tiancaiamao

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

2. What did you expect to see? (Required)

3. What did you see instead (Required)

fatal error: sync: unlock of unlocked mutex

goroutine 7349387639 [running]:
sync.fatal({0x5a4e38e?, 0x30?})
	/usr/local/go/src/runtime/panic.go:1061 +0x18
sync.(*Mutex).unlockSlow(0xc09de4f2d0, 0xffffffff)
	/usr/local/go/src/sync/mutex.go:229 +0x35
sync.(*Mutex).Unlock(0x0?)
	/usr/local/go/src/sync/mutex.go:223 +0x25
github.com/pingcap/tidb/pkg/sessionctx/variable.(*SessionVars).GetRelatedTableForMDL(0xc15716a000)
	/workspace/source/tidb/pkg/sessionctx/variable/session.go:3558 +0x106
github.com/pingcap/tidb/pkg/session.(*session).TxnInfo(0xc05925d180)
	/workspace/source/tidb/pkg/session/session.go:528 +0x209
github.com/pingcap/tidb/pkg/server.(*Server).ShowTxnList(0xc002603100)
	/workspace/source/tidb/pkg/server/server.go:849 +0x1a8
github.com/pingcap/tidb/pkg/executor.(*tidbTrxTableRetriever).retrieve(0xc09e604d20, {0x63a0500?, 0xc06dc9a570}, {0x6419780?, 0xc098691680})
	/workspace/source/tidb/pkg/executor/infoschema_reader.go:2492 +0xee
github.com/pingcap/tidb/pkg/executor.(*MemTableReaderExec).Next(0xc09e6106e0, {0x63a0500, 0xc06dc9a570}, 0xc0a2d0fc20)
	/workspace/source/tidb/pkg/executor/memtable_reader.go:119 +0x2a6
github.com/pingcap/tidb/pkg/executor/internal/exec.Next({0x63a0500, 0xc06dc9a570}, {0x63b5a40, 0xc09e6106e0}, 0xc0a2d0fc20)
	/workspace/source/tidb/pkg/executor/internal/exec/executor.go:283 +0x2fa
github.com/pingcap/tidb/pkg/executor.(*SelectionExec).Next(0xc09e6140e0, {0x63a0500, 0xc06dc9a570}, 0xc0a2d0fc70)
	/workspace/source/tidb/pkg/executor/executor.go:1598 +0xde
github.com/pingcap/tidb/pkg/executor/internal/exec.Next({0x63a0500, 0xc06dc9a570}, {0x63b6d80, 0xc09e6140e0}, 0xc0a2d0fc70)
	/workspace/source/tidb/pkg/executor/internal/exec/executor.go:283 +0x2fa
github.com/pingcap/tidb/pkg/executor.(*CoprocessorDAGHandler).HandleRequest(0xc09e65d8f0, {0x63a0500?, 0xc06dc9a150?}, 0xc000f75900?)
	/workspace/source/tidb/pkg/executor/coprocessor.go:90 +0x2b7
github.com/pingcap/tidb/pkg/server.(*rpcServer).handleCopRequest(0x1c19d5a?, {0x63a0500, 0xc06dc9a150}, 0x0?)
	/workspace/source/tidb/pkg/server/rpc_server.go:214 +0x216
github.com/pingcap/tidb/pkg/server.(*rpcServer).Coprocessor(0x589fa20?, {0x63a0500, 0xc06dc9a150}, 0x0?)
	/workspace/source/tidb/pkg/server/rpc_server.go:103 +0xa5
github.com/pingcap/kvproto/pkg/tikvpb._Tikv_Coprocessor_Handler({0x59b3e80?, 0xc01413f0e0}, {0x63a0500, 0xc06dc9a150}, 0xc1b33c4c00, 0x0)
	/root/go/pkg/mod/github.com/pingcap/kvproto@v0.0.0-20240208102409-a554af8ee11f/pkg/tikvpb/tikvpb.pb.go:3512 +0x169
google.golang.org/grpc.(*Server).processUnaryRPC(0xc013fde780, {0x63a0500, 0xc06dc9a090}, {0x63bf7e0, 0xc00f1bd1e0}, 0xc09dcec7e0, 0xc01413f200, 0x8b6c0b0, 0x0)
	/root/go/pkg/mod/google.golang.org/grpc@v1.59.0/server.go:1343 +0xe03
google.golang.org/grpc.(*Server).handleStream(0xc013fde780, {0x63bf7e0, 0xc00f1bd1e0}, 0xc09dcec7e0)
	/root/go/pkg/mod/google.golang.org/grpc@v1.59.0/server.go:1737 +0xc4c
google.golang.org/grpc.(*Server).serveStreams.func1.1()
	/root/go/pkg/mod/google.golang.org/grpc@v1.59.0/server.go:986 +0x86
created by google.golang.org/grpc.(*Server).serveStreams.func1 in goroutine 52285
	/root/go/pkg/mod/google.golang.org/grpc@v1.59.0/server.go:997 +0x145

4. What is your TiDB version? (Required)

v7.5.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-5.4This bug affects the 5.4.x(LTS) versions.affects-6.1This bug affects the 6.1.x(LTS) versions.affects-6.5This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.affects-8.5This bug affects the 8.5.x(LTS) versions.report/customerCustomers have encountered this bug.severity/majorsig/sql-infraSIG: SQL Infratype/bugThe issue is confirmed as a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions