Re: [go-nuts] Tools or debug options for debugging 'Error in `bin/main': double free or corruption (fasttop)' in cgo

2019-07-14 Thread Nitish Saboo
Thanks Kurtis.Will try these options. Yes, now I remember you had given the same options on a different thread. It just skipped my mind because of the mail conversation. Thanks, Nitish On Mon, Jul 15, 2019 at 10:55 AM Kurtis Rader wrote: > As I wrote in a reply on a different thread that has

Re: [go-nuts] Tools or debug options for debugging 'Error in `bin/main': double free or corruption (fasttop)' in cgo

2019-07-14 Thread Kurtis Rader
As I wrote in a reply on a different thread that has the same purpose as this one... When debugging memory management problems in C/C++ code there are many tools to assist in understanding the problem. The first, and usually easiest to use is to enable your platform "debug" version of the malloc

Re: [go-nuts] Tools or debug options for debugging 'Error in `bin/main': double free or corruption (fasttop)' in cgo

2019-07-14 Thread Nitish Saboo
Hi Jan, I am a beginner with GO and cgo, and have never dealt with C corruption issues. Do you have commands or a blog post or something else where I can read about it and follow the steps. Being a beginner, I have to read and understand the stuff before applying it. Thanks, Nitish On Sun, Jul

Re: [go-nuts] How to make a package with cgo "go gettable"

2019-07-14 Thread xiang liu
I have the same situaction,Unlikely, go does not have a better way to handle this. Miki Tebeka 于2019年7月15日周一 下午12:14写道: > Hi, > > I have a packge with cgo that require some external headers & libraries to > build (Apache arrow). > What's the best practice for making this packge easy to "go

[go-nuts] How to make a package with cgo "go gettable"

2019-07-14 Thread Miki Tebeka
Hi, I have a packge with cgo that require some external headers & libraries to build (Apache arrow). What's the best practice for making this packge easy to "go get"? To make things more interesting, Arrow is a C++ library. Currently I build a static library and link with it, however it's very

Re: [go-nuts] Go NaCl and C NaCl/libsodium

2019-07-14 Thread W. Michael Petullo
> Does anyone have any sample code which shows interoperability between Go's > golang.org/x/crypto/nacl/box and C's NaCl or libsodium? I have been having > trouble boxing with Go and opening with NaCl (and vice versa). I have used > NaCl from C a lot, but the Go NaCl packages are new to me. I

Re: [go-nuts] The "leave "if err != nil" alone?" anti-proposal

2019-07-14 Thread Sam Whited
On Sun, Jul 14, 2019, at 06:53, roger peppe wrote: > As far as I can tell, that's almost identical to the scheme that I > suggested here: > https://github.com/golang/go/issues/19412#issuecomment-288485048 I hadn't seen that issue, I'll have to read through it. Thanks for the link! —Sam -- Sam

Re: [go-nuts] How to store the address of C struct on Go side in an array (cgo)

2019-07-14 Thread Nitish Saboo
Hi, Apologies to the experts who have been kind enough to help me on this issue. I will try to come up with a small, complete reproducible test case for this issue. Thanks, Nitish On Sun, Jul 14, 2019 at 6:36 PM Nitish Saboo wrote: > HI Ian, > > func (obj SyslogParser) LoadPatternDB(opts

Re: [go-nuts] Tools or debug options for debugging 'Error in `bin/main': double free or corruption (fasttop)' in cgo

2019-07-14 Thread Jan Mercl
On Sun, Jul 14, 2019 at 5:03 PM Nitish Saboo wrote: > Can some please share the details of tools or Debug options to debug the > following error in cgo: Log allocations, log frees. From the log you'll know at which line of code the error was triggered. 'Log' can be as simple as printing to

[go-nuts] Tools or debug options for debugging 'Error in `bin/main': double free or corruption (fasttop)' in cgo

2019-07-14 Thread Nitish Saboo
Hi, Can some please share the details of tools or Debug options to debug the following error in cgo: Error in `bin/main': double free or corruption (fasttop) Thanks, Ntish -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

Re: [go-nuts] How to store the address of C struct on Go side in an array (cgo)

2019-07-14 Thread Nitish Saboo
HI Ian, func (obj SyslogParser) LoadPatternDB(opts Syslog, workerId int) { log.Info("Loading pattern db with path:", opts.Patterndb) > patterndbpath := C.CString(opts.Patterndb) . <<< . STEP 1 > defer C.free(unsafe.Pointer(patterndbpath)) . STEP 2 > InitStruct :=

Re: [go-nuts] The "leave "if err != nil" alone?" anti-proposal

2019-07-14 Thread roger peppe
On Fri, 12 Jul 2019, 07:22 Sam Whited, wrote: > > > On July 12, 2019 4:35:54 AM UTC, Andrey Tcherepanov < > xnow4fippy...@sneakemail.com> wrote: > >What these guys are proposing in that paper would be closer to > >(Go-style) > >func f() (v value | e error) { ... } > > > >(where "|" could be read