gointellij-ideagoland

Intellij Go debugger - how to use locally generated binary


Hi I'm using intellij ultimate with Go plugin and when I try to debug our project I get: internal compiler error: NewBulk too big: nbit=32315 count=546028 nword=1010 size=551488280 from the command /usr/local/go/bin/go test -c -o /private/var/folders/yx/klmlchmn643_5kxzshhvzm2nvp_fkd/T/___1<test_name>.test

Somebody suggested I build the test binary by using go test -c <test file>. I have done this but have no idea how to use this in the intellij debug configuration to modify the above test command to use the binary instead - can anyone help? I'm on intellij ultimate 2021.1.3 with Go plugin. Thanks


Solution

  • This is a known compiler issue caused by files that create large maps. bvbulkalloc was renamed to NewBulk, that's why the message is different. (open issue about this issue for tracking, new issue)

    A workaround would be to “use a slice as the underlying data structure and copy it into a map in an init function.”