Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: can't compile Camlistore with Go 1.3 on Windows #8240

Closed
bradfitz opened this issue Jun 19, 2014 · 11 comments
Closed

cmd/compile: can't compile Camlistore with Go 1.3 on Windows #8240

bradfitz opened this issue Jun 19, 2014 · 11 comments

Comments

@bradfitz
Copy link
Contributor

From Camlistore bug report here:
https://code.google.com/p/camlistore/issues/detail?id=460

"""
I just upgraded to Go 1.3 and it seems the files in the react.js folder can't be
compiled (as well as the web ui). This is what I get on my second run of "go run
make.go":

camlistore.org/server/camlistored/ui
camlistore.org/third_party/react
go build camlistore.org/third_party/react: exit status 3221225725
go build camlistore.org/server/camlistored/ui: exit status 3221225725
Error building main binaries: exit status 1
exit status 1

In regards to
http://www.febooti.com/products/automation-workshop/online-help/events/run-dos-cmd-command/exit-codes/
this seems to be a stack overflow problem.
"""
@alexbrainman
Copy link
Member

Comment 1:

The problem is 6g is running out of stack and Windows kills it.
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: c:\go\root\pkg\tool\windows_amd64\6g.exe -o C:\\Users\\brainma
n\\AppData\\Local\\Temp\\go-build191430499\\camlistore.org\\tmp\\build-gopath-no
sqlite\\src\\camlistore.org\\third_party\\fontawesome.a -trimpath C:\\Users\\bra
inman\\AppData\\Local\\Temp\\go-build191430499 -p camlistore.org/tmp/build-gopat
h-nosqlite/src/camlistore.org/third_party/fontawesome -complete -D _/c_/go/path/
src/camlistore.org/tmp/build-gopath-nosqlite/src/camlistore.org/third_party/font
awesome -I C:\\Users\\brainman\\AppData\\Local\\Temp\\go-build191430499 -I c:\\g
o\\path\\pkg\\windows_amd64 -pack c:\\go\\path\\src\\camlistore.org\\tmp\\build-
gopath-nosqlite\\src\\camlistore.org\\third_party\\fontawesome\\fileembed.go c:\
\go\\path\\src\\camlistore.org\\tmp\\build-gopath-nosqlite\\src\\camlistore.org\
\third_party\\fontawesome\\zembed_css_font-awesome.css.go c:\\go\\path\\src\\cam
listore.org\\tmp\\build-gopath-nosqlite\\src\\camlistore.org\\third_party\\fonta
wesome\\zembed_css_font-awesome.min.css.go c:\\go\\path\\src\\camlistore.org\\tm
p\\build-gopath-nosqlite\\src\\camlistore.org\\third_party\\fontawesome\\zembed_
fonts_FontAwesome.otf.go c:\\go\\path\\src\\camlistore.org\\tmp\\build-gopath-no
sqlite\\src\\camlistore.org\\third_party\\fontawesome\\zembed_fonts_fontawesome-
webfont.eot.go c:\\go\\path\\src\\camlistore.org\\tmp\\build-gopath-nosqlite\\sr
c\\camlistore.org\\third_party\\fontawesome\\zembed_fonts_fontawesome-webfont.sv
g.go c:\\go\\path\\src\\camlistore.org\\tmp\\build-gopath-nosqlite\\src\\camlist
ore.org\\third_party\\fontawesome\\zembed_fonts_fontawesome-webfont.ttf.go c:\\g
o\\path\\src\\camlistore.org\\tmp\\build-gopath-nosqlite\\src\\camlistore.org\\t
hird_party\\fontawesome\\zembed_fonts_fontawesome-webfont.woff.go
[New Thread 5220.0x10f4]
Program received signal SIGSEGV, Segmentation fault.
0x0000000000438809 in typecheck (np=np@entry=0x22b21a0, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:156
156             lno = setlineno(n);
(gdb) p n
$1 = (Node *) 0x22b1e60
(gdb) bt
#0  0x0000000000438809 in typecheck (np=np@entry=0x22b21a0, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:156
#1  0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#2  typecheck (np=np@entry=0x22b2540, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#3  0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#4  typecheck (np=np@entry=0x22b28a0, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#5  0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#6  typecheck (np=np@entry=0x22b2c00, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#7  0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#8  typecheck (np=np@entry=0x22b2f60, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#9  0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#10 typecheck (np=np@entry=0x22b32c0, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#11 0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#12 typecheck (np=np@entry=0x22b3620, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#13 0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#14 typecheck (np=np@entry=0x22b3950, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#15 0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#16 typecheck (np=np@entry=0x22b3c90, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#17 0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#18 typecheck (np=np@entry=0x22b4030, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#19 0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#20 typecheck (np=np@entry=0x22b4390, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#21 0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#22 typecheck (np=np@entry=0x22b46f0, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#23 0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#24 typecheck (np=np@entry=0x22b4a50, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#25 0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#26 typecheck (np=np@entry=0x22b4db0, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#27 0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#28 typecheck (np=np@entry=0x22b5110, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#29 0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#30 typecheck (np=np@entry=0x22b5440, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#31 0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#32 typecheck (np=np@entry=0x22b5780, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#33 0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#34 typecheck (np=np@entry=0x22b5ac0, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#35 0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#36 typecheck (np=np@entry=0x22b5e20, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#37 0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#38 typecheck (np=np@entry=0x22b6160, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#39 0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#40 typecheck (np=np@entry=0x22b64a0, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#41 0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#42 typecheck (np=np@entry=0x22b67e0, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#43 0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#44 typecheck (np=np@entry=0x22b6b40, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#45 0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#46 typecheck (np=np@entry=0x22b6e70, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#47 0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#48 typecheck (np=np@entry=0x22b71b0, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#49 0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
#50 typecheck (np=np@entry=0x22b74f0, top=top@entry=4)
    at c:\go\root\src\cmd\gc\typecheck.c:221
#51 0x000000000043a2ac in typecheck1 (top=4, np=<synthetic pointer>)
    at c:\go\root\src\cmd\gc\typecheck.c:571
...
...
...
Some kind of infinite recursion.
Better someone who knows how 6g works to investigate.
Alex

@bradfitz
Copy link
Contributor Author

Comment 2:

It's from files with lots of concatenated string literals. "a" + "b" + "c" + .... (tons)

@alexbrainman
Copy link
Member

Comment 3:

Did I say, "go run make.go" runs to successful completion on windows-386?
Alex

@bradfitz
Copy link
Contributor Author

Comment 4:

Well, I worked around it in Camlistore tip by never concatenating more than 50 string
literals (an arbitrary number I picked).  After that I strings.Join them at runtime.
So it might also be broken on windows-386 if you just tested at tip recently.

@alexbrainman
Copy link
Member

Comment 5:

I've updated to the tip (maybe I'm mistaken - I am no good with git). But it still fails:
C:\go\path\src\camlistore.org>git show
commit 488f1b4481ab49b6331f1d2da463b8c2e74a5607
Merge: d59ce13 0c772ef
Author: Brad Fitzpatrick <brad@danga.com>
Date:   Sat Jun 21 16:52:29 2014 +0000
    Merge "ui: fix permanode page"
C:\go\path\src\camlistore.org>git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
C:\go\path\src\camlistore.org>go run make.go
camlistore.org/server/camlistored/ui
go build camlistore.org/server/camlistored/ui: exit status 3221225725
camlistore.org/third_party/fontawesome
go build camlistore.org/third_party/fontawesome: exit status 3221225725
camlistore.org/third_party/react
go build camlistore.org/third_party/react: exit status 3221225725
Error building main binaries: exit status 1
exit status 1
C:\go\path\src\camlistore.org>

@bradfitz
Copy link
Contributor Author

Comment 6:

You have to delete your C:\go\path\src\camlistore.org\tmp directory before running
make.go again because I forgot to add my generator's *.go file to the list of sources
whose modtimes are compared when I worked around it the other day.

@alexbrainman
Copy link
Member

Comment 7:

Yes, deleting tmp directory fixes the problem.
But, like I said earlier, the bug is only present on amd64. On windows/amd64 it fails:
c:\go\path\src\camlistore.org>go run make.go
camlistore.org/server/camlistored/ui
go build camlistore.org/server/camlistored/ui: exit status 3221225725
camlistore.org/third_party/fontawesome
go build camlistore.org/third_party/fontawesome: exit status 3221225725
camlistore.org/third_party/react
go build camlistore.org/third_party/react: exit status 3221225725
Error building main binaries: exit status 1
exit status 1
c:\go\path\src\camlistore.org>git status
HEAD detached at 736648c
nothing to commit, working directory clean
while same version 736648c builds with no problems on windows/386. Perhaps it is not
important ...
Alex

@rsc
Copy link
Contributor

rsc commented Aug 5, 2014

Comment 8:

This looks like a valid recursive traversal of the parse tree - Windows just has too
small a stack. Converting to Go will fix this. Since this only happens for very complex
expressions, I think it can wait.

Labels changed: added release-none, removed release-go1.3.1.

@rsc rsc removed the os-windows label Apr 10, 2015
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title cmd/gc: can't compile Camlistore with Go 1.3 on Windows cmd/compile: can't compile Camlistore with Go 1.3 on Windows Jun 8, 2015
@ThePiachu
Copy link

I'm having a similar issue compiling https://github.com/FactomProject/FactomCode

go build github.com/FactomProject/factoid/block: C:\Go\pkg\tool\windows_amd64\6g.exe: exit status 3221225725

It looks like this file might be the reason behind the exit status:

https://github.com/FactomProject/factoid/blob/master/block/genesisBlockNew.go

However, I only got this error after commit FactomProject/factoid@5857476#diff-672e0d9aef89d3f75c8d1bf8a06edce3 - beforehand, it compiled just fine.

What are the solutions to this issue? Aim to have less string concatenations?

@bradfitz
Copy link
Contributor Author

bradfitz commented Sep 2, 2015

This is now fixed in Go 1.5, where the compiler is written in Go instead of C.

@bradfitz bradfitz closed this as completed Sep 2, 2015
@minux
Copy link
Member

minux commented Sep 2, 2015 via email

@golang golang locked and limited conversation to collaborators Sep 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants