Segmentation Fault when porting GO binary

681 views
Skip to first unread message

and...@gherghel.com

unread,
Jun 13, 2018, 8:38:11 AM6/13/18
to golang-nuts

I'm a GO newbie and just finished my first project. Its developed on an debian 8 amd64 machine. Running "go build project" creates the binary as it should. The binary runs fine on the machine it was developed on. Since I'm still in the learning phase I copied the binary to another debian 8 amd64 machine but when I run it I only get "Segmentation Fault". I also did a build for windows which runs ok on a windows 10 machine.

I also tried with "env GOOS=linux GOARCH=amd64 go build project" but I get the same results.


Developing machine

root@laptop-acer:~# uname -m
x86_64
root@laptop-acer:~# uname -a
Linux laptop-acer 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2 (2017-04-30) x86_64 GNU/Linux


Second Debian machine

root@server:~# uname -m
x86_64
root@server:~# uname -a
Linux server 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08) x86_64 GNU/Linux


I get the same "Segmentation Fault" on a CentOS machine

[root@ns536702 ~]# uname -m
x86_64
[root@ns536702 ~]# uname -a
Linux *hostname hidden* 3.14.32-xxxx-grs-ipv6-64 #9 SMP Thu Oct 20 14:53:52 CEST 2016 x86_64 x86_64 x86_64 GNU/Linux


Go version

root@laptop-acer:~# go version
go version go1.10.3 linux/amd64


I have the feeling that I'm missing something since I also couldn't find information on this error on google.


Thanks 

Ian Lance Taylor

unread,
Jun 13, 2018, 9:28:36 AM6/13/18
to and...@gherghel.com, golang-nuts
On Wed, Jun 13, 2018 at 2:48 AM, <and...@gherghel.com> wrote:
>
> I'm a GO newbie and just finished my first project. Its developed on an
> debian 8 amd64 machine. Running "go build project" creates the binary as it
> should. The binary runs fine on the machine it was developed on. Since I'm
> still in the learning phase I copied the binary to another debian 8 amd64
> machine but when I run it I only get "Segmentation Fault". I also did a
> build for windows which runs ok on a windows 10 machine.

The program prints only "Segmentation Fault" and nothing else? That
is very strange. I have no explanation but it's hard to see how it
could be Go related.

Ian

and...@gherghel.com

unread,
Jun 13, 2018, 9:52:15 AM6/13/18
to golang-nuts
Hi Ian, 
Thats the only output

root@server:./main
Segmentation fault
Message has been deleted

peterGo

unread,
Jun 14, 2018, 7:29:28 AM6/14/18
to golang-nuts
Ian,

This issue was cross-posted on StackOverflow.

Segmentation Fault when porting Go binary
https://stackoverflow.com/questions/50833105/segmentation-fault-when-porting-go-binary

The error was posted in the comments:

"I finally found the issue. I was transfering the binary with filezilla and transfer type was set to ASCII and not to binary."

Peter

Ian Lance Taylor

unread,
Jun 15, 2018, 2:36:17 AM6/15/18
to peterGo, golang-nuts
On Thu, Jun 14, 2018 at 4:29 AM, peterGo <go.pe...@gmail.com> wrote:
>
> This issue was cross-posted on StackOverflow.
>
> Segmentation Fault when porting Go binary
> https://stackoverflow.com/questions/50833105/segmentation-fault-when-porting-go-binary
>
> The error was posted in the comments:
>
> "I finally found the issue. I was transfering the binary with filezilla and
> transfer type was set to ASCII and not to binary."

Thanks for letting us know.

Ian



> On Wednesday, June 13, 2018 at 9:28:36 AM UTC-4, Ian Lance Taylor wrote:
>>
>> On Wed, Jun 13, 2018 at 2:48 AM, <and...@gherghel.com> wrote:
>> >
>> > I'm a GO newbie and just finished my first project. Its developed on an
>> > debian 8 amd64 machine. Running "go build project" creates the binary as
>> > it
>> > should. The binary runs fine on the machine it was developed on. Since
>> > I'm
>> > still in the learning phase I copied the binary to another debian 8
>> > amd64
>> > machine but when I run it I only get "Segmentation Fault". I also did a
>> > build for windows which runs ok on a windows 10 machine.
>>
>> The program prints only "Segmentation Fault" and nothing else? That
>> is very strange. I have no explanation but it's hard to see how it
>> could be Go related.
>>
>> 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...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages