Re: [go-nuts] smtp.SendMail not using the from argument

2021-09-10 Thread Brian Candler
If you are using Google's SMTP servers, then it validates the From: header 
and restricts it to those which you have registered against that account.

You can register additional addresses (including non-Google ones):  
Settings > See all settings > Accounts and Import > Send Mail As (Use Gmail 
to send from your other email addresses) > Add another email address

It will send a verification mail so that you can prove you own that E-mail 
address.


On Thursday, 9 September 2021 at 22:03:32 UTC+1 dean.w@gmail.com wrote:

> It could be that I'm not using smtp.SendMail() correctly, which is why I 
> posted it here.  Thanks for your guess, though.
>
> On Thursday, September 9, 2021 at 2:31:11 PM UTC-6 rol...@gmail.com wrote:
>
>> Hello,
>>
>> Am Do., 9. Sept. 2021 um 20:19 Uhr schrieb Dean Schulze <
>> dean.w@gmail.com>:
>>
>>> I'm sending emails with smtp.SendMail() via gmail.  I set the from 
>>> argument to smtp.SendMail() to a different email address than my gmail 
>>> username, but the emails still get sent with the From: as my gmail address.
>>>
>>> Do I need to do something else to change the From: in the emails, or is 
>>> gmail always going to use my gmail address?
>>>
>>> I guess gmail uses the address bound to the used account, which would be 
>> in my opinion quite reasonable behavior.
>>
>> BTW this question is a bit OT here since not related to Go rather than 
>> mailing policy of Google accounts.
>>
>> BR,
>> Roland
>>
>> 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...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/golang-nuts/04eb41bd-9002-443b-8921-c3ddcd833c87n%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/542dd81b-2cad-4d5f-8f46-c308302a3c1en%40googlegroups.com.


[go-nuts] Why is my package doc too long on pkg.go.dev?

2021-09-10 Thread Amit Lavon
In my repo overview page , I 
would like the doc column to only show the first sentence. Here 
specifically "Package fasta handles fasta I/O". See screenshots below.

How can I achieve that?
Is there documentation regarding how package docs get rendered on 
pkg.go.dev?
Is it possible to run pkg.go.dev locally to test my doc changes (like we 
could with godoc)?

Amit

[image: pkg.PNG]
[image: doc.PNG]

-- 
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/917091b3-6c9f-4489-876a-47b30e38088fn%40googlegroups.com.


[go-nuts] Re: [security] Go 1.17.1 and Go 1.16.8 are released

2021-09-10 Thread Jérôme LAFORGE
Hello all,
For testing purpose, how can I install Go 1.16.8 with Go 1.17?

```
$go version
go version go1.17 linux/amd64

$go get golang.org/dl/go1.16.8 
go get: installing executables with 'go get' in module mode is deprecated. 
   Use 'go install pkg@version' instead. 
   For more information, see 
https://golang.org/doc/go-get-install-deprecation 
   or run 'go help get' or 'go help install'.

$go install golang.org/dl/go@1.16.8 
go install: golang.org/dl/go@1.16.8: unrecognized import path 
"golang.org/dl/go": reading https://golang.org/dl/go?go-get=1: 404 Not 
Found 
   server response: 404 page not found
```

Regards
Jérôme
Le jeudi 9 septembre 2021 à 21:29:18 UTC+2, th...@google.com a écrit :

> Hello gophers,
>
> We have just released Go versions 1.17.1 and 1.16.8 minor point releases.
>
> These minor releases include a security fix according to the new security 
> policy (#44918 ).
>
> The fix for CVE-2021-33196 can be bypassed by crafted inputs. As a result, 
> the NewReader and OpenReader functions in archive/zip 
>  can still cause a panic or an 
> unrecoverable fatal error when reading an archive that claims to contain a 
> large number of files, regardless of its actual size.
>
> This is issue #47801  and 
> CVE-2021-39293.
>
> Thanks to the OSS-Fuzz project for discovering this issue and to Emmanuel 
> Odeke for reporting it.
>
> View the release notes for more information:
>
> https://golang.org/doc/devel/release.html#go1.17.minor 
> 
>
> You can download binary and source distributions from the Go web site:
>
> https://golang.org/dl/
>
> To compile from source using a Git clone, update to the release with
>
> "git checkout go1.17.1" and build as usual.
>
> Thanks to everyone who contributed to the releases.
>
> Cheers,
>
> Than, Cherry, and Alex for the Go team
>
>

-- 
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/ae5b03ae-d847-418d-9447-e49e24520d5an%40googlegroups.com.


Re: [go-nuts] Re: [security] Go 1.17.1 and Go 1.16.8 are released

2021-09-10 Thread Ian Davis
On Fri, 10 Sep 2021, at 11:11 AM, Jérôme LAFORGE wrote:
> Hello all,
> For testing purpose, how can I install Go 1.16.8 with Go 1.17?
> 
> ```
> $go version
> go version go1.17 linux/amd64
> 
> $go get golang.org/dl/go1.16.8 
> go get: installing executables with 'go get' in module mode is deprecated. 
>Use 'go install pkg@version' instead. 
>For more information, see 
> https://golang.org/doc/go-get-install-deprecation 
>or run 'go help get' or 'go help install'.
> 
> $go install golang.org/dl/go@1.16.8 
> go install: golang.org/dl/go@1.16.8: unrecognized import path 
> "golang.org/dl/go": reading https://golang.org/dl/go?go-get=1: 404 Not Found 
>server response: 404 page not found
> ```


Try go install golang.org/dl/go1.16.8@latest which is documented here 
https://golang.org/doc/manage-install


-- 
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/2139ee47-d705-4308-b714-d7c76654252d%40www.fastmail.com.


[go-nuts] Type Parameters Proposal, few unimportant questions

2021-09-10 Thread Kamil Ziemian
Hello,

I try to work my way through "Type Parameters Proposal" 
(https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md).
 
With my speed, I maybe and reading this very well written document before 
type parameters will be implemented in Go. xD Jokes aside, when I read it I 
found few sentences that sounds odd to me. Maybe some good soul would 
explain to me, am I right, or this is my bad, not good English?

At the beginning of the section (?) "Using a constraint" 
(https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#using-a-constraint)
 
there is sentence "As shown above, constraints appear in the type parameter 
list as the meta-type of a type parameter." But I think that is should read 
"shown below".

In the second paragraph (?) of the section "Operations based on type sets" 
(https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#operations-based-on-type-sets)
 
we read "For special purpose operators like range loops, we permit their 
use of the type parameter has a structural constraint". Meaning of it is 
clear to me (at least it is), but it sound odd when I read it. Maybe is 
should be something like "the type parameter that has a structural 
constraint"?

At the end totally pedantic hair splitting. At the end of the "Type sets" 
(https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#type-sets)
 
we have code snippet "interface{ E1; E2}". I feel that more consistent with 
the rest of the code would be with one more space: "interface{ E1; E2 }".

Best,
Kamil

-- 
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/de7fe316-ce69-48cd-8684-1c500cd058f6n%40googlegroups.com.


Re: [go-nuts] Simplifying LLVM bitcode from gollvm

2021-09-10 Thread 'Than McIntosh' via golang-nuts
Hi,

The "module asm" at the start of your bitcode dump is actually the export
data for the package, so it plays a pretty crucial role.

Deleting the export data from the "main" package may work in some cases
(since nobody imports main), but it will certainly cause problems if you
delete the export data from some other non-main package.

Export data tends to be substantial because it is based on the transitive
closure of the imported packages (e.g. "fmt" imports "io", then "io"
imports "sync", then "sync" imports "runtime", and so on).

On the other hand, Go export data is *way* smaller than the volume of
header information that would have to be consumed by a C++ compiler when
building your average C++ source file.

Than

On Thu, Sep 9, 2021 at 6:31 AM Khanh TN  wrote:

> A Helloworld written in C++ is around 75 lines in LLVM IR.
> However, a Helloworld written in Golang compiled with gollvm is around
> 900/1000 lines of .ll file. I produced the LLVM IR with instructions from
> https://go.googlesource.com/gollvm/
> I'm using LLVM11, so, older compatible commit of gollvm, not sure newer
> versions are different.
>
> How can I produce shorter/simplified LLVM IR?
> Thanks!
>
> Cheers,
> Khanh
>
>
> P/S:
> An LLVM IR file has a lot of  module asm at the start, like:
> module asm "\09.section \22.go_export\22,\22e\22,@progbits"
> module asm "\09.ascii \22v3;\\n\22"
> module asm "\09.ascii \22package \22"
> module asm "\09.ascii \22main\22"
> module asm "\09.ascii \22\\n\22"
> module asm "\09.ascii \22pkgpath \22"
> module asm "\09.ascii \22main\22"
>
> I figure I can delete all the module asm line and my program still  runs
> correctly (I only tested 2 times on simple programs). Is this a legit
> optimization?
>
> --
> 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/8ee91024-b270-4d1e-99b9-dbcd3e25d4c4n%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/CA%2BUr55FiSx-NmjuM1ub6czS68Dr30ybJFbYt3QSC_4%2BOt3Jp0w%40mail.gmail.com.


Re: [go-nuts] Re: [security] Go 1.17.1 and Go 1.16.8 are released

2021-09-10 Thread Jérôme LAFORGE
Thanks, that works.

Le vendredi 10 septembre 2021 à 13:15:18 UTC+2, Ian Davis a écrit :

> On Fri, 10 Sep 2021, at 11:11 AM, Jérôme LAFORGE wrote:
>
> Hello all,
> For testing purpose, how can I install Go 1.16.8 with Go 1.17?
>
> ```
> $go version
> go version go1.17 linux/amd64
>
> $go get golang.org/dl/go1.16.8 
> go get: installing executables with 'go get' in module mode is deprecated. 
>Use 'go install pkg@version' instead. 
>For more information, see 
> https://golang.org/doc/go-get-install-deprecation 
>or run 'go help get' or 'go help install'.
>
> $go install golang.org/dl/g...@1.16.8  
> go install: golang.org/dl/g...@1.16.8 : 
> unrecognized import path "golang.org/dl/go": reading 
> https://golang.org/dl/go?go-get=1: 404 Not Found 
>server response: 404 page not found
> ```
>
>
>
> Try go install golang.org/dl/go1.16.8@latest which is documented here 
> https://golang.org/doc/manage-install
>
>
>
>

-- 
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/f71c7b29-b9ac-47f7-86c0-5fd52e402a0en%40googlegroups.com.


Re: [go-nuts] Go serial port package

2021-09-10 Thread arvinsa...@gmail.com
Hello,

Can I ask for the  best Go package for AT commands to communicate with GSM 
modem. 

Arvin
On Tuesday, June 25, 2019 at 2:11:15 PM UTC+8 maranatha wrote:

>
> I have been trying to use both Tarmigan's and Jacob's packages on Windows 
> and Linux. For basic serial reading they both seem to work just fine. 
> However, they both seem to break with higher baud rate and continues 
> streaming of data. In my case I was streaming sensor data at baud rate 
> 921600, that comes every few seconds. The expected byte size vary a bit 
> depending on the sensor readings from the physical environment, so I have 
> now added one extra character ("#") to be able to return the read out when 
> this character arrives. But this does not seem to be supported in any of 
> the available libraries that I have seen so far. Any idea how I could meet 
> my goal?
>
> On Friday, October 21, 2011 at 8:28:41 AM UTC+3, Tarmigan wrote:
>>
>> Nice!
>>
>> I also made a serial port package here:
>> http://github.com/tarm/goserial
>>
>> I think you and I arrived at about the same API!  I some commits from
>> a couple months ago that add timeouts, parity, etc, but have not yet
>> needed those and so have not yet tested them and so have not yet
>> pushed them out to github.
>>
>> The package I made uses cgo+termios.h instead of syscalls for OSX, and
>> it should also work on Linux, though I have not tested that either.
>> One thing you might think about since you're doing syscalls anyway is
>> using the IOSSIOSPEED ioctl which I think will let you set
>> non-standard baud rates on OSX.
>>
>> One difference (for now) is my package also works on windows and you
>> can cross compile from OSX (or linux presumably) to windows, which can
>> be handy.
>>
>> -Tarmigan
>>
>> On Thu, Oct 20, 2011 at 6:59 PM, Aaron Jacobs  wrote:
>> > Following an idea from Ostsol in an [earlier post] [1], I've created a 
>> package
>> > for easily reading from and writing to serial ports in Go. You can find 
>> it
>> > here:
>> >
>> >https://github.com/jacobsa/go-serial
>> >
>> > Currently it only works on OS X, but that's mostly just because I don't 
>> have
>> > any Linux hardware to test on. I think making it work on Linux would be 
>> a
>> > matter of updating some constants (and am happy to take pull requests). 
>> Even
>> > so, it might be useful to somebody as-is. Let me know if you have any
>> > feedback.
>> >
>> > Aaron
>> >
>> > [1]: 
>> http://groups.google.com/group/golang-nuts/browse_thread/thread/f28f5fc4f69e16ef
>> >
>>
>>

-- 
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/f28b5149-cd72-4086-8095-5d66522e5eb6n%40googlegroups.com.


Re: [go-nuts] Type Parameters Proposal, few unimportant questions

2021-09-10 Thread Ian Lance Taylor
On Fri, Sep 10, 2021 at 5:28 AM Kamil Ziemian  wrote:
>
> I try to work my way through "Type Parameters Proposal" 
> (https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md).
>  With my speed, I maybe and reading this very well written document before 
> type parameters will be implemented in Go. xD Jokes aside, when I read it I 
> found few sentences that sounds odd to me. Maybe some good soul would explain 
> to me, am I right, or this is my bad, not good English?
>
> At the beginning of the section (?) "Using a constraint" 
> (https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#using-a-constraint)
>  there is sentence "As shown above, constraints appear in the type parameter 
> list as the meta-type of a type parameter." But I think that is should read 
> "shown below".

I think "shown above" is correct.  The document has already shown
using the constraint "any".


> In the second paragraph (?) of the section "Operations based on type sets" 
> (https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#operations-based-on-type-sets)
>  we read "For special purpose operators like range loops, we permit their use 
> of the type parameter has a structural constraint". Meaning of it is clear to 
> me (at least it is), but it sound odd when I read it. Maybe is should be 
> something like "the type parameter that has a structural constraint"?

Thanks, it should be "if" rather than "of".  I'll fix it.


> At the end totally pedantic hair splitting. At the end of the "Type sets" 
> (https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#type-sets)
>  we have code snippet "interface{ E1; E2}". I feel that more consistent with 
> the rest of the code would be with one more space: "interface{ E1; E2 }".

Thanks, I'll fix that too.

Ian

-- 
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/CAOyqgcVeFANeFmSMw-reQA4wp5RJF%2B9yU-9y61mPhGeNJV_9Yw%40mail.gmail.com.


Re: [go-nuts] Type Parameters Proposal, few unimportant questions

2021-09-10 Thread Kamil Ziemian
Thank you very much, now this sentence about type parameters with
structural constraint is clear and I know that I basically get it right.

Best
Kamil


pt., 10 wrz 2021 o 19:07 Ian Lance Taylor  napisał(a):

> On Fri, Sep 10, 2021 at 5:28 AM Kamil Ziemian 
> wrote:
> >
> > I try to work my way through "Type Parameters Proposal" (
> https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md).
> With my speed, I maybe and reading this very well written document before
> type parameters will be implemented in Go. xD Jokes aside, when I read it I
> found few sentences that sounds odd to me. Maybe some good soul would
> explain to me, am I right, or this is my bad, not good English?
> >
> > At the beginning of the section (?) "Using a constraint" (
> https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#using-a-constraint)
> there is sentence "As shown above, constraints appear in the type parameter
> list as the meta-type of a type parameter." But I think that is should read
> "shown below".
>
> I think "shown above" is correct.  The document has already shown
> using the constraint "any".
>
>
> > In the second paragraph (?) of the section "Operations based on type
> sets" (
> https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#operations-based-on-type-sets)
> we read "For special purpose operators like range loops, we permit their
> use of the type parameter has a structural constraint". Meaning of it is
> clear to me (at least it is), but it sound odd when I read it. Maybe is
> should be something like "the type parameter that has a structural
> constraint"?
>
> Thanks, it should be "if" rather than "of".  I'll fix it.
>
>
> > At the end totally pedantic hair splitting. At the end of the "Type
> sets" (
> https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#type-sets)
> we have code snippet "interface{ E1; E2}". I feel that more consistent with
> the rest of the code would be with one more space: "interface{ E1; E2 }".
>
> Thanks, I'll fix that too.
>
> Ian
>

-- 
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/CAB3gO8rsqFvXGLDfbaqfCq2dY1L44R_3dgDb4uBF5mHn7z3FYA%40mail.gmail.com.


Re: [go-nuts] How to set default signal handler in golang

2021-09-10 Thread Ian Lance Taylor
On Mon, Aug 30, 2021 at 6:52 PM 'Vina C.' via golang-nuts
 wrote:
>
> We have a java web application calling C program which in turn using go 
> program as a library. The go library was build with --buildmode= c-shared. 
> Now we got a crash with the application, but there is no call stack for go 
> program. We are thinking that it might be that java signal handler handles 
> SIGSEGV differently from golang's. So we would like to see if we could reset 
> signal handler in golang's to default. I have read package signal, and looks 
> to me that Reset function only "undoes the effect of any prior calls to 
> Notify".  And how to set the signal handler to default without calling Notify 
> before?

When the shared library is initialized, the Go runtime will install a
signal handler for SIGSEGV.  There is no way to tell the library to
reinstall the signal handler.  Go programs won't work correctly in all
cases if the Go signal handler is not installed (although they will
mostly work, they just won't correctly handles things like nil pointer
dereferences).

With -buildmode=c-shared, if a SIGSEGV handler was already installed
at the time that the shared library was initialized, and if the Go
SIGSEGV handler sees a signal that occurred in non-Go code, the Go
signal handler will pass the signal on to the previously installed
signal handler.

Hope this helps.  Cross-language signal handling can get complicated.

Ian

-- 
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/CAOyqgcVfn7BO0fn-QqrtMced4K8YnRmjRBX9YiXzXfSt0NNt3g%40mail.gmail.com.


Re: [go-nuts] How to calculate CFA from go dwarf

2021-09-10 Thread Ian Lance Taylor
On Tue, Aug 31, 2021 at 4:30 AM Poonai  wrote:
>
> I'm trying to learn how debugger works. With the help of this blog 
> https://eli.thegreenplace.net/2011/01/27/how-debuggers-work-part-2-breakpoints
> I'm able to set breakpoint and continue.
>
> In the next step of learning, I wanted to learn how to extract values of 
> variables.
>
> But, the dwarf output says the frame base addrs as: 1 byte block: 9c 
> (DW_OP_call_frame_cfa)
>
>  <0><48a28>: Abbrev Number: 1 (DW_TAG_compile_unit)
> <48a29>   DW_AT_name: main
> <48a2e>   DW_AT_language: 22 (Go)
> <48a2f>   DW_AT_stmt_list   : 0x26b2c
> <48a33>   DW_AT_low_pc  : 0x498200
> <48a3b>   DW_AT_ranges  : 0x28a70
> <48a3f>   DW_AT_comp_dir: .
> <48a41>   DW_AT_producer: Go cmd/compile go1.16.6; -N -l
> <48a60>   Unknown AT value: 2905: main
>  <1><48a65>: Abbrev Number: 3 (DW_TAG_subprogram)
> <48a66>   DW_AT_name: main.main
> <48a70>   DW_AT_low_pc  : 0x498200
> <48a78>   DW_AT_high_pc : 0x4982e5
> <48a80>   DW_AT_frame_base  : 1 byte block: 9c (DW_OP_call_frame_cfa)
> <48a82>   DW_AT_decl_file   : 0x2
> <48a86>   DW_AT_external: 1
>  <2><48a87>: Abbrev Number: 21 (DW_TAG_lexical_block)
> <48a88>   DW_AT_low_pc  : 0x498223
> <48a90>   DW_AT_high_pc : 0x4982d9
>  <3><48a98>: Abbrev Number: 10 (DW_TAG_variable)
> <48a99>   DW_AT_name: variableToTrace
> <48aa9>   DW_AT_decl_line   : 11
> <48aaa>   DW_AT_type: <0x4ab9f>
> <48aae>   DW_AT_location: 3 byte block: 91 b0 7f (DW_OP_fbreg: -80)
>
> I wanted to readt variableToTrace. to my understanding, I can read the 
> variable from CFA-80
>
> But don't know how to calculate CFA.
>
> Can anyone help me with this?

You are looking at the debug_info information, which describes a lot
of things but doesn't describe the call frame.  To see the call frame
information use "readelf --debug=frames" or "readelf
--debug=frames-interp".

Ian

-- 
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/CAOyqgcWGHNy%3DbEgEZ7nqSwGidgcTPrFC-R_cfoCjxpEGXLRdQg%40mail.gmail.com.


Re: [go-nuts] cgo and fatal: morestack on g0

2021-09-10 Thread Ian Lance Taylor
On Thu, Aug 26, 2021 at 4:56 AM Miha Vrhovnik  wrote:
>
> we are using a library via CGO that is the emulator for a real device.
> That library also contains a javascript engine which calls to Go for 
> communication to the outside world. The problem we are facing is that we are 
> getting more and more crashes with "morestack on g0".
> I have found tickets on the go github (for windows) that show that this 
> occurs where go is out of stack. When looking at the gdb bt, the callstack 
> doesn't seem so deep.
> And before anyone asks, yes the call stack looks like this  
> go->c->c->.->c->go (crash).
>
> The main is locked to the Os thread with runtime.LockOSThread() however 
> removing this doesn't help.
>
> Is there any chance of upping up the available stack in CGO cases.
>
> The behavior is the same on 1.16.7 and newly released 1.17.

You didn't mention what kind of system you are using.  When a Go
program uses cgo, the C threads will be created with the default stack
size for that system.  Many systems have a way to configure this value
independently of the program.  For example, on Linux, use ulimit -s.

Ian

-- 
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/CAOyqgcV_LRYMwbW7-tasp3zt05Z24h_w3ExEEjb6EZOf5LoAkQ%40mail.gmail.com.