[go-nuts] Re: How to develop with Go source code change?

2024-01-03 Thread 'TheDiveO' via golang-nuts
Maybe your output is interfering with the way the go code base does some of 
it's checks; based on the fail in cmd/vet maybe this could be involved: 
https://github.com/golang/go/blob/b25f5558c69140deb652337afaab5c1186cd0ff1/src/cmd/vet/vet_test.go#L197?

On Tuesday, January 2, 2024 at 5:45:12 PM UTC+1 Rulin Tang wrote:

> Hey, I'm trying to do some Go source code development. But I'm confused 
> about how to do the development.
>
> The Go source code is cloned from https://github.com/golang/go master 
> branch. Originally, I run `cd src &^ ./all.bash` to build the latest Go 
> 1.22 version. It works fine.
>
> Then I'm trying to do some source code development. For example, I'm 
> looking at this issue https://github.com/golang/go/issues/64824. It's 
> something about devirtualize.go. So I added two debug lines like  `// 
> fmt.Printf("rulin DevirtualizeAndInlineFunc is called\n")` to 
> `src/compile/internal/interleaved/interleaved.go`.
>
> Then I tried to build an updated Go version with the updated Go source 
> code `./all.bash`. It failed with
> ```
>
> rulin DevirtualizeAndInlineFunc is called
>
> rulin DevirtualizeAndInlineFunc is called
>
> rulin DevirtualizeAndInlineFunc is called
>
> rulin DevirtualizeAndInlineFunc is called
>
> rulin DevirtualizeAndInlineFunc is called
>
> FAIL
>
> FAIL cmd/vet 20.524s
>
> FAIL
>
> go tool dist: Failed: exit status 1
>
> ```
>
> My original development plan is to add the debug line, build the updated 
> Go version, run test code with the updated Go version, and check the debug 
> output message at Go source code. Somehow this doesn't work. At least, it 
> stops at the first step to build an updated Go version with debug message.
>
> So here're two questions: 1. What did I do wrong in above steps? 2. Do I 
> have to rebuild Go version every time I make changes to Go source code? and 
> then use the updated Go version to test other existing Go code.
>
> Thanks!
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/efa298d3-5385-423a-93bd-f492caf15574n%40googlegroups.com.


[go-nuts] <-ctx.Done() panic

2024-01-03 Thread cheng dong
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

-- 
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+unsubscr...@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.


[go-nuts] Re: <-ctx.Done() panic

2024-01-03 Thread 'Brian Candler' via 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?
https://go.dev/blog/race-detector

On Wednesday 3 January 2024 at 10:57:49 UTC cheng dong wrote:

> 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
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/1009082f-2528-4adb-b853-a2bebc5e018dn%40googlegroups.com.


[go-nuts] Re: Rendering fonts in Go

2024-01-03 Thread Egon
There's also https://github.com/go-text/typesetting 
and github.com/go-text/render.

But, I'm not sure whether it covers your needs.
On Saturday 23 December 2023 at 00:10:13 UTC+2 Howard C. Shaw III wrote:

> I think Freetype may still be your best bet - but rather than the Freetype 
> port, you would need to use a wrapper that calls the Freetype C library, 
> such as https://github.com/danielgatis/go-freetype
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/4672e97d-37eb-44c8-96c1-b7dd3d1726a7n%40googlegroups.com.


Re: [go-nuts] <-ctx.Done() panic

2024-01-03 Thread 'Sean Liao' via golang-nuts
maybe a bad custom context implementation in the chain

- sean

On Wed, Jan 3, 2024, 10:57 cheng dong  wrote:

> 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
>
> --
> 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+unsubscr...@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
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAGabyPoxNXAUO5GreyfrpHMmQGR9c9%2BWJRrERx1MKHhtU7y2hQ%40mail.gmail.com.


Re: [go-nuts] Re: A global panic handler for crash reporting

2024-01-03 Thread Johan Liebert



A global panic handler for crash reporting is a critical component in 
software development. It serves as a robust mechanism to capture, analyze, 
and respond to unexpected errors or crashes in applications. This handler 
acts as a safety net, allowing developers to receive real-time 
notifications, gather essential data, and implement timely fixes, 
contributing to improved software reliability and user experience.

The incorporation of a life2vec calculator 
into this system could further 
enhance its capabilities by providing a tool for assessing the impact of 
errors on the overall life and performance of the application. This 
innovative approach aligns with the industry's commitment to continuous 
improvement and proactive error management, ensuring smoother and more 
resilient software operation.


On Tuesday, December 26, 2023 at 11:38:29 AM UTC-8 Gergely Brautigam wrote:

> Yah, that's true, I completely forgot about that. :/
>
> I guess you could do what some others have done which is implement a Call 
> function or a framework that runs all function calls in a middleware-esk 
> style. And middleware has a recovery. So every call will have a recovery.
>
> On Tuesday 26 December 2023 at 10:15:12 UTC+1 Jan Mercl wrote:
>
>> On Tue, Dec 26, 2023 at 9:12 AM Gergely Brautigam  
>> wrote: 
>>
>> > If you have a top level recover in you main, it doesn't matter where 
>> the panic happens, you'll capture it. Even in third party library. 
>>
>> Iff the panic occurs in the same goroutine where the defer is. Every 
>> go statement starts a new goroutine that is not affected by defer 
>> statement(s) in other goroutines. 
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/58681e1b-7657-4a64-ad43-077119f160d4n%40googlegroups.com.


Re: [go-nuts] <-ctx.Done() panic

2024-01-03 Thread Johan Liebert
https://life2vecdeathcalculator.com/

On Wednesday, January 3, 2024 at 3:57:01 AM UTC-8 Sean Liao wrote:

> maybe a bad custom context implementation in the chain
>
> - sean
>
> On Wed, Jan 3, 2024, 10:57 cheng dong  wrote:
>
>> 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
>>
>> -- 
>> 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
>>  
>> 
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/eae12fbc-513b-4605-b7d1-ee25637f71d1n%40googlegroups.com.


[go-nuts] Re: How to develop with Go source code change?

2024-01-03 Thread 'Rulin Tang' via golang-nuts
Try it again. And this time it works to build the new Go version. But the 
debug message doesn't show. Not sure this is the expected result or not.

On Wednesday 3 January 2024 at 00:45:12 UTC+8 Rulin Tang wrote:

> Hey, I'm trying to do some Go source code development. But I'm confused 
> about how to do the development.
>
> The Go source code is cloned from https://github.com/golang/go master 
> branch. Originally, I run `cd src &^ ./all.bash` to build the latest Go 
> 1.22 version. It works fine.
>
> Then I'm trying to do some source code development. For example, I'm 
> looking at this issue https://github.com/golang/go/issues/64824. It's 
> something about devirtualize.go. So I added two debug lines like  `// 
> fmt.Printf("rulin DevirtualizeAndInlineFunc is called\n")` to 
> `src/compile/internal/interleaved/interleaved.go`.
>
> Then I tried to build an updated Go version with the updated Go source 
> code `./all.bash`. It failed with
> ```
>
> rulin DevirtualizeAndInlineFunc is called
>
> rulin DevirtualizeAndInlineFunc is called
>
> rulin DevirtualizeAndInlineFunc is called
>
> rulin DevirtualizeAndInlineFunc is called
>
> rulin DevirtualizeAndInlineFunc is called
>
> FAIL
>
> FAIL cmd/vet 20.524s
>
> FAIL
>
> go tool dist: Failed: exit status 1
>
> ```
>
> My original development plan is to add the debug line, build the updated 
> Go version, run test code with the updated Go version, and check the debug 
> output message at Go source code. Somehow this doesn't work. At least, it 
> stops at the first step to build an updated Go version with debug message.
>
> So here're two questions: 1. What did I do wrong in above steps? 2. Do I 
> have to rebuild Go version every time I make changes to Go source code? and 
> then use the updated Go version to test other existing Go code.
>
> Thanks!
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/59bc327a-f781-4cf1-8311-1693dad9c1d8n%40googlegroups.com.


[go-nuts] Re: <-ctx.Done() panic

2024-01-03 Thread cheng dong
yeah, i try race and found that we write/read ctx in race condition and 
solved it.
thanks for give ideas

On Wednesday, January 3, 2024 at 7:29:47 PM UTC+8 Brian Candler wrote:

> 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?
> https://go.dev/blog/race-detector
>
> On Wednesday 3 January 2024 at 10:57:49 UTC cheng dong wrote:
>
>> 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
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/43655b46-173c-46ac-bcac-b1eeb90c818dn%40googlegroups.com.