Re: [go-nuts] Possible reasons for a segmentation fault inside mallocgc during package importing

2020-08-24 Thread Yonatan Gizachew
Thank you for the reply! *How exactly did you create the .so file?* $ go build -o libgotest.so -buildmode=c-shared -compiler=gccgo test.go *How exactly are you running it?* I used the .so file as a plugin in my simulator. After loading the library using dlmopen, we get the symbol of the 'm

Re: [go-nuts] Go routines stuck in runtime_pollwait

2020-08-24 Thread Siddhesh Divekar
Robert, We will do the profiling next time we hit the issue again & see what is happening. This was the first time we saw the issue & don't want to get rid of http2 advantages without making sure it's the actual culprit. Do you think in the meanwhile we should do what the discussion below suggest

Re: [go-nuts] Possible reasons for a segmentation fault inside mallocgc during package importing

2020-08-24 Thread Ian Lance Taylor
On Mon, Aug 24, 2020 at 7:05 PM Yonatan Gizachew wrote: > > We were trying to run a go c-shared library on a emulator (Written in C/C++). > We use gccgo compiler to create .so file from test.go file, so that the > runtime could be liked dynamically. Currently we are facing a problem while > pac

[go-nuts] Possible reasons for a segmentation fault inside mallocgc during package importing

2020-08-24 Thread Yonatan Gizachew
We were trying to run a go c-shared library on a emulator (Written in C/C++). We use gccgo compiler to create .so file from test.go file, so that the runtime could be liked dynamically. Currently we are facing a problem while packages

Re: [go-nuts] Generics - type inference - which type parameters?

2020-08-24 Thread Patrick Smith
Perhaps near the end of the type inference section, before "Note: type inference is a convenience feature"? And perhaps something like this? When discussing type inference, the term "type parameter" refers only to the type parameters in a specific use of a generic function or type. For example, f

Re: [go-nuts] Go routines stuck in runtime_pollwait

2020-08-24 Thread Robert Engels
I think it is too hard to tell with the limited information. It could be exhausted connections or it could be thrashing (the claim of high cpu) I think you want to run profiling capture prior to hitting the stick state - you should be able to detect what is happening. If the referenced issue i

Re: [go-nuts] Generics - type inference - which type parameters?

2020-08-24 Thread Ian Lance Taylor
On Mon, Aug 24, 2020 at 4:34 PM Patrick Smith wrote: > > I may be missing something, but it seems to me that one point in the draft's > discussion of type inference could usefully be clarified > (https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md#type-inf

[go-nuts] Re: what is empty block mean in ssa.Block?

2020-08-24 Thread keith . randall
Empty here means has-only-dead-values. All the values still in s0 and s1 are known to be dead. On Monday, August 24, 2020 at 8:24:06 AM UTC-7, xie cui wrote: > > > https://github.com/golang/go/blob/master/src/cmd/compile/internal/ssa/fuse.go#L130 > it mention empty block here. in my knowledge, em

[go-nuts] Generics - type inference - which type parameters?

2020-08-24 Thread Patrick Smith
I may be missing something, but it seems to me that one point in the draft's discussion of type inference could usefully be clarified ( https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md#type-inference ). The term "type parameter" there should be restricted

Re: [go-nuts] Go routines stuck in runtime_pollwait

2020-08-24 Thread Siddhesh Divekar
Hi Robert, Sorry I missed your earlier response. >From what we saw our UI was blocked and since everything was unresponsive we had to recover the system by sending sig abort. On Mon, Aug 24, 2020 at 4:11 PM Siddhesh Divekar wrote: > Looking at the no. of go routines we have does this apply to

Re: [go-nuts] Go routines stuck in runtime_pollwait

2020-08-24 Thread Siddhesh Divekar
Looking at the no. of go routines we have does this apply to this issue ? https://github.com/golang/go/issues/27044 On Mon, Aug 24, 2020 at 12:54 PM Robert Engels wrote: > Go routines in a waiting state should not be consuming CPU. Are you > certain they are not in constant transition from waiti

Re: [go-nuts] [ generics] Moving forward with the generics design draft

2020-08-24 Thread Ian Lance Taylor
On Thu, Aug 20, 2020 at 9:54 PM Ian Lance Taylor wrote: > > Our intent here is that "any" will be available for all code. Yes, we > wouldn't do it if it weren't for its use as a type constraint. But if > we are going to do it for type constraints, there seems to be little > benefit to restrictin

Re: [go-nuts] Mysterious RSS memory spike

2020-08-24 Thread Manish R Jain
Thanks to Kale in darkarts Slack channel, we were able to identify the issue. The default C Calloc has major memory fragmentation issues due to Go's multi-threaded execution (or so is our theory). Switching Cgo to use jemalloc instead fixed the issue. The RSS now goes down to (close to) 1GB on e

Re: [go-nuts] Go routines stuck in runtime_pollwait

2020-08-24 Thread Robert Engels
Go routines in a waiting state should not be consuming CPU. Are you certain they are not in constant transition from waiting to processing - this could show up as high CPU usage while everything looks blocks. I would use pprof - github.com/robaho/goanalyzer might be of assistance here to see t

[go-nuts] I've build a proof-of-concept that allows running Go WASM in IE11

2020-08-24 Thread Ad van der Veer
Hey there, This weekend i've finally got around to an idea i've had for a while. I wanted to see if it was possible to compile Go wasm to javascript and run it in all browsers that support ES5, even IE11. Turns out it is possible, i've setup a small repo over here: https://github.com/advanderv

[go-nuts] Re: Mysterious RSS memory spike

2020-08-24 Thread Miha Vrhovnik
Hey, Vlad, it's not that. we have a similar or rather the exactly the same problem... where the OS doesn't claim the memory back.. this is also annoying to the point we had to disable memory under pressure notifications for that specific host. Also valgrind doesn't report any leaks... simulatin

[go-nuts] Re: [ generics] Moving forward with the generics design draft

2020-08-24 Thread adonovan via golang-nuts
On Thursday, 20 August 2020 20:28:23 UTC-4, Ian Lance Taylor wrote: > We’re going to settle on square brackets for the generics syntax. FWIW, the same square-bracket syntax was used by Barbara Liskov's CLU in the mid-1970s, and was, as far as I can tell, the first syntax used for parametric po

[go-nuts] what is empty block mean in ssa.Block?

2020-08-24 Thread xie cui
https://github.com/golang/go/blob/master/src/cmd/compile/internal/ssa/fuse.go#L130 it mention empty block here. in my knowledge, empty block would be len(b.Values) == 0, but it's not. so what 's empty block means here. -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] Re: [ generics] Moving forward with the generics design draft

2020-08-24 Thread roger peppe
On Mon, 24 Aug 2020 at 12:57, 'Richard Oudkerk' via golang-nuts < golang-nuts@googlegroups.com> wrote: > > Applying the same rule to type lists and type switches you should be able > to write > > type Comparer[T any] interface { > Compare(T) int > } > > type CompareConstraints

[go-nuts] Re: Mysterious RSS memory spike

2020-08-24 Thread jake...@gmail.com
If it helps any, I do not see this in Windows 10. After 5,000 iterations the "low memory" mark, as reported by windows, is still just 1,101MB. On Monday, August 24, 2020 at 5:05:00 AM UTC-4 vlad...@varank.in wrote: > Hey, > > I haven't looked deep but I recall there had been a note about runtim

Re: [go-nuts] Re: [ generics] Moving forward with the generics design draft

2020-08-24 Thread 'Richard Oudkerk' via golang-nuts
The current proposal says *The rule is that if a type contraint has a single type parameter, and it is used in a function's type parameter list witho

Re: [go-nuts] Unique GO language features

2020-08-24 Thread Jesper Louis Andersen
On Fri, Aug 21, 2020 at 7:16 PM joseph.p...@gmail.com < joseph.p.mcguc...@gmail.com> wrote: > > > The feature where GO performs escape analysis and promotes stack variables > to the heap: Did that originate with GO or was it first implemented > elsewhere? > > As Ian says, this is a "rather old" tr

Re: [go-nuts] Re: [ generics] Moving forward with the generics design draft

2020-08-24 Thread Juliusz Chroboczek
>> Could you please give an example of the proposed syntax? > func F[T constraints.Integer]() { > switch T { > case int: > case int8: > } > } Makes perfect sense, thanks. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubs

[go-nuts] Re: Mysterious RSS memory spike

2020-08-24 Thread Vladimir Varankin
Hey, I haven't looked deep but I recall there had been a note about runtime change in Go 1.13's https://golang.org/doc/go1.13#runtime That is > The runtime is now more aggressive at returning memory to the operating system to make it available to co-tenant applications [..] However, on many OS

Re: [go-nuts] Re: [ generics] Moving forward with the generics design draft

2020-08-24 Thread Anderson Queiroz
I liked the 'any' idea. It always felt to me a bit odd/not so clear interface{} means anything. Still, interfaces with type parameters for non generic code seems a mix of behaviour and implementation description. In all, looking forward to see these changes implemented to try them out :) On Mo

Re: [go-nuts] Golang Custom Application Context

2020-08-24 Thread Gregor Best
Templates aren't really request scoped  though, right? I read the term "request scoped" as "things like request IDs, timing information and maybe user authentication". What I usually do in situations like this is to make the handler functions methods of a `RequestHandler` type which in your ca