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

tools/check: make ut retry on special 'segmentation fault' error (#33566) #33619

Closed

Conversation

ti-srebot
Copy link
Contributor

@ti-srebot ti-srebot commented Mar 31, 2022

cherry-pick #33566 to release-6.0
You can switch your code base to this Pull Request by using git-extras:

# In tidb repo:
git pr https://github.com/pingcap/tidb/pull/33619

After apply modifications, you can push your change to this PR via:

git push [email protected]:ti-srebot/tidb.git pr/33619:release-6.0-09b73186f883

What problem does this PR solve?

Issue Number: close #32690 #32392

Problem Summary:

The 'segmentation fault' panic is weird, there is no more information, just this error message:

[2022-03-29T10:34:30.137Z] [FAIL]  planner/core TestIssue16837
[2022-03-29T10:34:30.137Z] err=signal: segmentation fault (core dumped)

https://ci.pingcap.net/blue/organizations/jenkins/tidb_ghpr_unit_test/detail/tidb_ghpr_unit_test/43086/artifacts/

I try to debug the panic stack but there is nothing interesting.

(gdb) bt
#0  runtime.lock2 (l=0x5e937f8 <runtime.sched+24>) at /usr/local/go/src/runtime/lock_futex.go:53
#1  0x000000000129dfa5 in runtime.lockWithRank (l=<optimized out>, rank=<optimized out>) at /usr/local/go/src/runtime/lockrank_off.go:22
#2  runtime.lock (l=<optimized out>) at /usr/local/go/src/runtime/lock_futex.go:47
#3  runtime.mexit (osStack=true) at /usr/local/go/src/runtime/proc.go:1535
#4  0x000000000129dc69 in runtime.mstart0 () at /usr/local/go/src/runtime/proc.go:1385
#5  0x00000000012ca6c5 in runtime.mstart () at /usr/local/go/src/runtime/asm_amd64.s:367
#6  0x00000000032c77d2 in crosscall_amd64 () at gcc_amd64.S:40
#7  0x00007f126d7fa700 in ?? ()
#8  0x0000000000000000 in ?? ()
(gdb) l
47              lockWithRank(l, getLockRank(l))
48      }
49
50      func lock2(l *mutex) {
51              gp := getg()
52
53              if gp.m.locks < 0 {
54                      throw("runtime·lock: lock count")
55              }
56              gp.m.locks++
(gdb) p gp
$1 = (runtime.g *) 0xc0007269c0
(gdb) p *gp
$2 = {stack = {lo = 47068350255, hi = 824644297264}, stackguard0 = 12, stackguard1 = 824644297296, _panic = 0xb, _defer = 0xc000a16290, m = 0xe, sched = {sp = 824644297376, pc = 14, g = 824644297392, ctxt = 0x10, ret = 0, lr = 0, bp = 0}, syscallsp = 0, syscallpc = 0,
  stktopsp = 0, param = 0xc000858a20, atomicstatus = 8751792, stackLock = 192, goid = 824642472768, schedlink = 824642472816, waitsince = 824642472864, waitreason = 0 '\000', preempt = false, preemptStop = false, preemptShrink = false, asyncSafePoint = false,
  paniconfault = false, gcscandone = false, throwsplit = false, activeStackChans = false, parkingOnChan = 0 '\000', raceignore = 0 '\000', sysblocktraced = false, tracking = false, trackingSeq = 0 '\000', runnableStamp = 0, runnableTime = 0,
  sysexitticks = 56542958808569567, traceseq = 824644297184, tracelastp = 9, lockedm = 824644297248, sig = 8, writebuf = {array = 0xc000a16240 "event_namesourcetimer_start", len = 10, cap = 824644297290}, sigcode0 = 6, sigcode1 = 824644297328, sigpc = 9,
  gopc = 824644297344, ancestors = 0xa, startpc = 824646320296, racectx = 18, waiting = 0x0, cgoCtxt = {array = 0x0, len = 824642472384, cap = 824642472432}, labels = 0xc000858a50, timer = 0xc000858a80, selectDone = 8751840, gcAssistBytes = 824642472720}
(gdb) p *gp.m
Cannot access memory at address 0xe

It panic on line 53, gp.m.locks , the value of gp.m is 0xe which is wrong.

What is changed and how it works?

I don't know to fix it, so let's just retry in this case to make the CI more stable.
Maybe it's related to DATA RACE, but I'm not sure.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 31, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • hawkingrei
  • wjhuang2016

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-chi-bot ti-chi-bot added the release-note-none Denotes a PR that doesn't merit a release note. label Mar 31, 2022
@ti-srebot ti-srebot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/6.0-cherry-pick labels Mar 31, 2022
@ti-srebot
Copy link
Contributor Author

@tiancaiamao you're already a collaborator in bot's repo.

@sre-bot
Copy link
Contributor

sre-bot commented Mar 31, 2022

@VelocityLight VelocityLight added cherry-pick-approved Cherry pick PR approved by release team. do-not-merge/cherry-pick-not-approved and removed cherry-pick-approved Cherry pick PR approved by release team. do-not-merge/cherry-pick-not-approved labels Mar 31, 2022
@tiancaiamao
Copy link
Contributor

PTAL @hawkingrei @wjhuang2016

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Apr 2, 2022
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Apr 2, 2022
@VelocityLight VelocityLight added cherry-pick-approved Cherry pick PR approved by release team. do-not-merge/cherry-pick-not-approved and removed do-not-merge/cherry-pick-not-approved cherry-pick-approved Cherry pick PR approved by release team. labels Apr 6, 2022
@xhebox
Copy link
Contributor

xhebox commented Aug 11, 2022

DMR version, closed

@xhebox xhebox closed this Aug 11, 2022
@xhebox xhebox deleted the release-6.0-09b73186f883 branch August 11, 2022 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/cherry-pick-not-approved release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/LGT2 Indicates that a PR has LGTM 2. type/6.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants