Re: [go-nuts] Unable to use net/http/pprof to profile live webserver

2016-12-22 Thread Shawn Milochik
Have you tried just running a separate `ListenAndServe` on another port on localhost, such as "localhost:6060"? That is what's done in the documentation and I've copied that with success many times. // should do the trick go http.ListenAndServe("localhost:6060", nil) Then (from within th

Re: [go-nuts] Re: Secure Go binaries

2016-12-22 Thread Ian Lance Taylor
On Thu, Dec 22, 2016 at 2:39 PM, Aaron Wood wrote: > > There must be other rare, obscure ways to exploit > overflows in code generated from Go, no? I sure hope not. If there are any, they are bugs that should be fixed. Ian -- You received this message because you are subscribed to the Google

[go-nuts] Unable to use net/http/pprof to profile live webserver

2016-12-22 Thread 569234
Hello, I have a webserver application written in Golang that runs on a dedicated server. It serves a popular website and uses almost 100% CPU and 100GB of memory. It's in production but I'd like to profile it as it is: live. It's on a remote webserver, which I have access too via HTTP and SSH (

[go-nuts] Re: howto: compile template against well-known structure ?

2016-12-22 Thread mhhcbon
I could not understand, at all, the prolog, but you left a cool link to learn more about it, thanks! I was referring to https://en.wikipedia.org/wiki/Edge_Side_Includes Where instead of calling for a `template "a" params...` instruction, i imagine an `esi_template "a" params...`, which would aut

[go-nuts] Re: howto: compile template against well-known structure ?

2016-12-22 Thread Egon
On Friday, 23 December 2016 01:00:29 UTC+2, mhh...@gmail.com wrote: > > Not sure i quiet get your meaning about symbolic evaluation, > It just reminded me how you can do expression simplification in Prolog and LISP. * http://stackoverflow.com/a/3516781/192220 * https://mitpress.mit.edu/sicp/

[go-nuts] Re: howto: compile template against well-known structure ?

2016-12-22 Thread mhhcbon
Not sure i quiet get your meaning about symbolic evaluation, or it s just what i did :x Anyways, for whoever else interested https://github.com/mh-cbon/template-tree-simplifier I was wondering if you have any thoughts regarding the idea to generate the go code not via string manipulation but vi

Re: [go-nuts] Re: Secure Go binaries

2016-12-22 Thread Aaron Wood
Interesting, thanks for the info Ian. Other than the OS and distro requirements, is there any real benefit from generating PIE binaries with Go? There must be some vector that it protects again, even though most things are already bounds-checked. The only situation I can think of is if you're c

Re: [go-nuts] Re: Secure Go binaries

2016-12-22 Thread Ian Lance Taylor
On Thu, Dec 22, 2016 at 2:09 PM, Aaron Wood wrote: > > This is a rather old comment of yours but I was curious about a few things > you said. I agree that Go does take care of a lot of these problems (and > most other high-level languages try to too) so I'm curious as to why Go has > exposed a bui

Re: [go-nuts] Re: Secure Go binaries

2016-12-22 Thread Aaron Wood
Hi Russ, This is a rather old comment of yours but I was curious about a few things you said. I agree that Go does take care of a lot of these problems (and most other high-level languages try to too) so I'm curious as to why Go has exposed a build option for generating position independent exe

Re: [go-nuts] Golang periodically executing a go routine

2016-12-22 Thread DM
Thanks :) . On Wednesday, 21 December 2016 15:42:55 UTC+5:30, Axel Wagner wrote: > > You need to pass the WaitGroup as a pointer. This way, connectionsCount > creates a WaitGroup, increments it's counts, passes a copy of it to count > and then waits on the original; count, however, only Done()s

[go-nuts] Re: Simple Go program that doesn't seem to free memory as it should...

2016-12-22 Thread drew
I finally took a look at the assembly, and unsurprisingly, a lot of pointers are being kept in registers. I'm not sure how registers interact with the GC, but I figured the memory might be free-able once function returns. Sure enough: https://play.golang.org/p/zpmVYSyKvX. Thanks for the help in

Re: [go-nuts] Simple Go program that doesn't seem to free memory as it should...

2016-12-22 Thread drew
Actually, the new version I just posted is even worse: uncommenting the y[0] = nil line no longer allows memory to be freed. It really does seem like compiler optimizations are making this hard to reason about. On Thursday, December 22, 2016 at 1:08:13 PM UTC-5, dr...@pendo.io wrote: > > You may

Re: [go-nuts] Simple Go program that doesn't seem to free memory as it should...

2016-12-22 Thread drew
Actually, the above version makes it even worse, as uncommenting the y[0] = nil line no longer causes memory to be freed. It really does look like compiler optimizations are making this hard to reason about. On Thursday, December 22, 2016 at 1:08:13 PM UTC-5, dr...@pendo.io wrote: > > You may be

Re: [go-nuts] Simple Go program that doesn't seem to free memory as it should...

2016-12-22 Thread drew
You may be on to something about compiler optimizations, but unfortunately it doesn't seem that simple: https://play.golang.org/p/Qa-i5eiRZ_. It looks like using _ was confusing matters, so I switched to using a Println to force actual use of those variables. The issue still occurs with global

[go-nuts] Re: install go compiler without sudo right

2016-12-22 Thread bill . hathaway
Do you want to use Go version 1.4 specifically for some reason? If not, I'd recommend going with the most recent stable release (1.7.4). Besides the git clone/build process Dave Cheney mentioned, you can download a binary build of the compiler/tools for Linux at: https://storage.googleapis.co

Re: [go-nuts] Simple Go program that doesn't seem to free memory as it should...

2016-12-22 Thread Ian Lance Taylor
On Thu, Dec 22, 2016 at 9:16 AM, wrote: > It should be clear from the source code, but I'm using two calls to > runtime.GC() followed by runtime.ReadMemStats(). Oh, I see, sorry. My guess is that you are effectively testing the compiler's statement ordering. The compiler knows that calling All

Re: [go-nuts] Simple Go program that doesn't seem to free memory as it should...

2016-12-22 Thread drew
It should be clear from the source code, but I'm using two calls to runtime.GC() followed by runtime.ReadMemStats(). On Thursday, December 22, 2016 at 12:06:13 PM UTC-5, Ian Lance Taylor wrote: > > On Thu, Dec 22, 2016 at 8:16 AM, > wrote: > > > > I was just toying around with pointers to slic

Re: [go-nuts] Simple Go program that doesn't seem to free memory as it should...

2016-12-22 Thread Ian Lance Taylor
On Thu, Dec 22, 2016 at 8:16 AM, wrote: > > I was just toying around with pointers to slice elements, and I ended up > with this Go program: https://play.golang.org/p/D6e2SHEW1f. By the end of > the program, all references to memory in the main function are dropped, but > memory isn't freed after

[go-nuts] Re: Json-ifying map[bson.ObjectId] is not as expected

2016-12-22 Thread Vincent Jouglard
Hi Jon, Thanks for the explanation ; i already used strings as indexes to make this work; but I was wondering if I was doing something wrong :) Still, I wonder if this behavior is wanted and if so, why that ? Regards, -- You received this message because you are subscribed to the Google Group

[go-nuts] Simple Go program that doesn't seem to free memory as it should...

2016-12-22 Thread drew
Hi all, I was just toying around with pointers to slice elements, and I ended up with this Go program: https://play.golang.org/p/D6e2SHEW1f. By the end of the program, all references to memory in the main function are dropped, but memory isn't freed after a call to runtime.GC(). This happens bo

[go-nuts] mobile database with sync

2016-12-22 Thread Joe Blue
Hey everyone, Have been using couchbase and couchdb. It works, but its a bit lacking and hamstrung, heavy and hidden complexities. Basically it has gotten too big for be adaptive for me at least. I knwo its works for business apps with simple needs though - and thats great.. I am thinking that

[go-nuts] Re: TCP DialTimeout Not Working Stuck for Hours.

2016-12-22 Thread Dave Cheney
Please try to produce a runnable piece of code that demonstrates the problem. My suspicion is this is not related to net.DialTimeout but the only way to prove or disprove this is for you to build a simple example program which I and others can run to confirm the issue. Thanks Dave -- You rec

[go-nuts] Re: TCP DialTimeout Not Working Stuck for Hours.

2016-12-22 Thread kumargv
> Hi , > > I am getting this issue in production device but not in all. > I also applied same IP and PORT to one my Test servers (centos 7) But I am > not able to reproduce the issue. > Below is the exact code I am using In production. > > https://play.golang.org/p/5xUcyCG-05 > > > Thanks For your