<-ctx.Done() panic

507 views
Skip to first unread message

cheng dong

unread,
Jan 3, 2024, 5:57:49 AM1/3/24
to golang-nuts
i have a program paniced with 

```
runtime.deferCallSave(0xc0313d56d8, 0xc0401839e8?)
        /home/ubuntu/go/go1.19.5/src/runtime/panic.go:796 +0x88 fp=0xc0313d5618 sp=0xc0313d5608 pc=0x43b248
runtime.runOpenDeferFrame(0xc02349b860?, 0xc0300967d0)
        /home/ubuntu/go/go1.19.5/src/runtime/panic.go:769 +0x1a5 fp=0xc0313d5660 sp=0xc0313d5618 pc=0x43b065
panic({0x344a800, 0xc03352c8d0})
        /home/ubuntu/go/go1.19.5/src/runtime/panic.go:884 +0x212 fp=0xc0313d5720 sp=0xc0313d5660 pc=0x43b4b2
runtime.panicdottypeE(0x6648f00, 0x32b77a0, 0x33adc40)
        /home/ubuntu/go/go1.19.5/src/runtime/iface.go:262 +0x6a fp=0xc0313d5740 sp=0xc0313d5720 pc=0x40cb2a
context.(*cancelCtx).Done(0xc040183824?)
        /home/ubuntu/go/go1.19.5/src/context/context.go:361 +0x1d4 fp=0xc0313d57c0 sp=0xc0313d5740 pc=0x512554
```

however, this code just not match with go1.19.5 context/context.go:361. so i cant figure out what happened

Brian Candler

unread,
Jan 3, 2024, 6:29:47 AM1/3/24
to golang-nuts
Panics can be caused by all sorts of things, but concurrency issues are a big one. Have you tried running your code under the race detector?

Sean Liao

unread,
Jan 3, 2024, 6:57:01 AM1/3/24
to golang-nuts
maybe a bad custom context implementation in the chain

- sean

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/a1a18ea2-d2a2-4fe7-b906-ea4f8ea6cae7n%40googlegroups.com.

Johan Liebert

unread,
Jan 3, 2024, 7:32:41 AM1/3/24
to golang-nuts

cheng dong

unread,
Jan 3, 2024, 9:02:54 PM1/3/24
to golang-nuts
yeah, i try race and found that we write/read ctx in race condition and solved it.
thanks for give ideas
Message has been deleted

Johan Liebert

unread,
Mar 29, 2024, 8:07:53 AM3/29/24
to golang-nuts
Encountering a panic due to <-ctx.Done() typically indicates that a context cancellation has occurred unexpectedly. This error often arises when a Go routine continues execution after its associated context has been canceled. To resolve this issue, ensure proper handling of context cancellation to avoid panics and maintain code stability. Considering options like " CGPA to Percentage Conversion Online" could offer a potential solution for addressing health-related issues in the United Kingdom.

Johan Liebert

unread,
Mar 29, 2024, 8:10:54 AM3/29/24
to golang-nuts

While there isn't a specific library named "xgo" for mocking in Go, developers can explore existing options like "gomock" or "testify/mock" for their testing needs. However, for individuals looking to sell my house fast fairport, utilizing local real estate agents or online platforms can facilitate a quick and efficient sale process. It's essential to research and engage with reputable professionals to ensure a smooth transaction and fair market value for your property.

Johan Liebert

unread,
Mar 29, 2024, 8:11:52 AM3/29/24
to golang-nuts

XGo is a promising addition to the Go programming language ecosystem, offering developers a powerful mocking library for writing effective unit tests. With its intuitive syntax and robust features, XGo simplifies the process of creating and managing mock objects, making testing more efficient and reliable. Developers can leverage XGo to ensure the quality and reliability of their codebase, without the need for extensive manual mocking. Plus, it's versatile enough to handle complex scenarios, much like the features found in the "mini militia mega mod apk" for gaming enthusiasts.

On Friday, March 29, 2024 at 5:07:53 AM UTC-7 Johan Liebert wrote:

Steven Hartland

unread,
Mar 30, 2024, 6:21:18 AM3/30/24
to Johan Liebert, golang-nuts
Johans account looks like a bot designed to inject links, possibly malicious, is there an admin who can investigate and take the appropriate action?


On Fri, 29 Mar 2024 at 12:11, Johan Liebert <johanli...@gmail.com> wrote:

Brian Candler

unread,
Mar 30, 2024, 6:43:57 AM3/30/24
to golang-nuts
I clicked the "Report message" button for each of them, selecting type of abuse "Spam". Whether anyone reads these is doubtful though.

The first spam was on 3 Jan 2024 and I reported it straight away; it hasn't stopped the new ones coming through.

Steven Hartland

unread,
Mar 30, 2024, 6:37:22 PM3/30/24
to Brian Candler, golang-nuts
Ah in the web UI, just did the same, hopeful more reports will cause it to be actioned.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.

Ian Lance Taylor

unread,
Apr 1, 2024, 2:17:12 PM4/1/24
to Steven Hartland, Johan Liebert, golang-nuts
On Sat, Mar 30, 2024 at 3:21 AM Steven Hartland
<stevenm...@gmail.com> wrote:
>
> Johans account looks like a bot designed to inject links, possibly malicious, is there an admin who can investigate and take the appropriate action?

Thanks for pointing that out. I think I've banned them.

Ian
Reply all
Reply to author
Forward
0 new messages