Skip to content

引用后运行项目需要装gcc,然后经过长时间编译后,提示 fatal error: out of memory #15

@tyler2018

Description

@tyler2018

不知道为什么需要安装 gcc,我装了mingw,然后出现下面的错误。目前无法使用

GOROOT=C:\Go #gosetup
GOPATH=D:\project\goProject;C:\Users\Administrator\go #gosetup
C:\Go\bin\go.exe build -o D:\project\goProject\IoTBackendV2\debug\go_build_IoTBackendV2.exe -gcflags "all=-N -l" IoTBackendV2 #gosetup

github.com/yanyiwu/gojieba

In file included from ..\pkg\mod\github.com\yanyiwu\gojieba@v1.1.0\deps/cppjieba/Unicode.hpp:9,
from ..\pkg\mod\github.com\yanyiwu\gojieba@v1.1.0\deps/cppjieba/DictTrie.hpp:15,
from ..\pkg\mod\github.com\yanyiwu\gojieba@v1.1.0\deps/cppjieba/QuerySegment.hpp:8,
from ..\pkg\mod\github.com\yanyiwu\gojieba@v1.1.0\deps/cppjieba/Jieba.hpp:4,
from jieba.cpp:5:
..\pkg\mod\github.com\yanyiwu\gojieba@v1.1.0\deps/limonp/LocalVector.hpp: In instantiation of 'void limonp::LocalVector::reserve(size_t) [with T = std::pair<long long unsigned int, const cppjieba::DictUnit*>; size_t = long long unsigned int]':
..\pkg\mod\github.com\yanyiwu\gojieba@v1.1.0\deps/limonp/LocalVector.hpp:83:7: required from 'void limonp::LocalVector::push_back(const T&) [with T = std::pair<long long unsigned int, const cppjieba::DictUnit*>]'
..\pkg\mod\github.com\yanyiwu\gojieba@v1.1.0\deps/cppjieba/Trie.hpp:99:81: required from here
..\pkg\mod\github.com\yanyiwu\gojieba@v1.1.0\deps/limonp/LocalVector.hpp:95:11: warning: 'void* memcpy(void*, const void*, size_t)' writing to an object of type 'struct std::pair<long long unsigned int, const cppjieba::DictUnit*>' with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
memcpy(ptr_, old, sizeof(T) * capacity_);
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/utility:70,
from C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/algorithm:60,
from ..\pkg\mod\github.com\yanyiwu\gojieba@v1.1.0\deps/cppjieba/QuerySegment.hpp:4,
from ..\pkg\mod\github.com\yanyiwu\gojieba@v1.1.0\deps/cppjieba/Jieba.hpp:4,
from jieba.cpp:5:
C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_pair.h:198:12: note: 'struct std::pair<long long unsigned int, const cppjieba::DictUnit*>' declared here
struct pair
^~~~
In file included from ..\pkg\mod\github.com\yanyiwu\gojieba@v1.1.0\deps/cppjieba/Unicode.hpp:9,
from ..\pkg\mod\github.com\yanyiwu\gojieba@v1.1.0\deps/cppjieba/DictTrie.hpp:15,
from ..\pkg\mod\github.com\yanyiwu\gojieba@v1.1.0\deps/cppjieba/QuerySegment.hpp:8,
from ..\pkg\mod\github.com\yanyiwu\gojieba@v1.1.0\deps/cppjieba/Jieba.hpp:4,
from jieba.cpp:5:
..\pkg\mod\github.com\yanyiwu\gojieba@v1.1.0\deps/limonp/LocalVector.hpp: In instantiation of 'limonp::LocalVector& limonp::LocalVector::operator=(const limonp::LocalVector&) [with T = std::pair<long long unsigned int, const cppjieba::DictUnit*>]':
..\pkg\mod\github.com\yanyiwu\gojieba@v1.1.0\deps/limonp/LocalVector.hpp:33:11: required from 'limonp::LocalVector::LocalVector(const limonp::LocalVector&) [with T = std::pair<long long unsigned int, const cppjieba::DictUnit*>]'
..\pkg\mod\github.com\yanyiwu\gojieba@v1.1.0\deps/cppjieba/Trie.hpp:28:8: required from 'void std::_Construct(_T1*, _Args&& ...) [with _T1 = cppjieba::Dag; _Args = {const cppjieba::Dag&}]'
C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_uninitialized.h:83:18: required from 'static _ForwardIterator std::__uninitialized_copy<_TrivialValueTypes>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = const cppjieba::Dag*; _ForwardIterator = cppjieba::Dag*; bool _TrivialValueTypes = false]'
C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_uninitialized.h:134:15: required from '_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = const cppjieba::Dag*; _ForwardIterator = cppjieba::Dag*]'
C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_uninitialized.h:289:37: required from '_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = const cppjieba::Dag*; _ForwardIterator = cppjieba::Dag*; _Tp = cppjieba::Dag]'
C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_uninitialized.h:311:2: required from '_ForwardIterator std::__uninitialized_move_if_noexcept_a(_InputIterator, _InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = cppjieba::Dag*; _ForwardIterator = cppjieba::Dag*; _Allocator = std::allocatorcppjieba::Dag]'
C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/vector.tcc:611:7: required from 'void std::vector<_Tp, _Alloc>::_M_default_append(std::vector<_Tp, _Alloc>::size_type) [with _Tp = cppjieba::Dag; _Alloc = std::allocatorcppjieba::Dag; std::vector<_Tp, _Alloc>::size_type = long long unsigned int]'
C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_vector.h:827:4: required from 'void std::vector<_Tp, _Alloc>::resize(std::vector<_Tp, _Alloc>::size_type) [with _Tp = cppjieba::Dag; _Alloc = std::allocatorcppjieba::Dag; std::vector<Tp, Alloc>::size_type = long long unsigned int]'
..\pkg\mod\github.com\yanyiwu\gojieba@v1.1.0\deps/cppjieba/Trie.hpp:86:27: required from here
..\pkg\mod\github.com\yanyiwu\gojieba@v1.1.0\deps/limonp/LocalVector.hpp:63:13: warning: 'void* memcpy(void*, const void*, size_t)' writing to an object of type 'struct std::pair<long long unsigned int, const cppjieba::DictUnit*>' with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
memcpy(ptr
, vec.ptr
, vec.size() * sizeof(T));
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/utility:70,
from C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/algorithm:60,
from ..\pkg\mod\github.com\yanyiwu\gojieba@v1.1.0\deps/cppjieba/QuerySegment.hpp:4,
from ..\pkg\mod\github.com\yanyiwu\gojieba@v1.1.0\deps/cppjieba/Jieba.hpp:4,
from jieba.cpp:5:
C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_pair.h:198:12: note: 'struct std::pair<long long unsigned int, const cppjieba::DictUnit*>' declared here
struct pair
^~~~

github.com/struCoder/Go-pinyin

runtime: VirtualAlloc of 245760 bytes failed with errno=1455
fatal error: out of memory

runtime stack:
runtime.throw(0xe5d4f5, 0xd)
c:/go/src/runtime/panic.go:774 +0x79
runtime.sysUsed(0xc9d6e5e000, 0x3c000)
c:/go/src/runtime/mem_windows.go:83 +0x230
runtime.(*mheap).allocSpanLocked(0x15c58c0, 0x1e, 0x15ee128, 0x20321a600000000)
c:/go/src/runtime/mheap.go:1221 +0x203
runtime.(*mheap).alloc_m(0x15c58c0, 0x1e, 0x101, 0x6c6effff)
c:/go/src/runtime/mheap.go:1015 +0xd0
runtime.(*mheap).alloc.func1()
c:/go/src/runtime/mheap.go:1086 +0x53
runtime.(*mheap).alloc(0x15c58c0, 0x1e, 0x6c000101, 0x6b919460)
c:/go/src/runtime/mheap.go:1085 +0x91
runtime.largeAlloc(0x3c000, 0x73620100, 0x6b919460)
c:/go/src/runtime/malloc.go:1138 +0x9e
runtime.mallocgc.func1()
c:/go/src/runtime/malloc.go:1033 +0x4d
runtime.systemstack(0x0)
c:/go/src/runtime/asm_amd64.s:370 +0x6b
runtime.mstart()
c:/go/src/runtime/proc.go:1146

goroutine 14 [running]:
runtime.systemstack_switch()
c:/go/src/runtime/asm_amd64.s:330 fp=0xc106ab1a70 sp=0xc106ab1a68 pc=0x45be80
runtime.mallocgc(0x3c000, 0x0, 0x26000, 0xc86985a000)
c:/go/src/runtime/malloc.go:1032 +0x8d4 fp=0xc106ab1b10 sp=0xc106ab1a70 pc=0x40c894
runtime.growslice(0xe01720, 0xc86985a000, 0x6000, 0x6000, 0x6001, 0xc86985a000, 0x4c00, 0x6000)
c:/go/src/runtime/slice.go:175 +0x155 fp=0xc106ab1b78 sp=0xc106ab1b10 pc=0x4449f5
cmd/compile/internal/ssa.(*desiredState).add(0xc0181b73e0, 0x99f17)
c:/go/src/cmd/compile/internal/ssa/regalloc.go:2575 +0x18b fp=0xc106ab1be0 sp=0xc106ab1b78 pc=0x67414b
cmd/compile/internal/ssa.(*desiredState).addList(0xc0181b73e0, 0xffffff0000099f17)
c:/go/src/cmd/compile/internal/ssa/regalloc.go:2583 +0x5c fp=0xc106ab1c08 sp=0xc106ab1be0 pc=0x6741ec
cmd/compile/internal/ssa.(*desiredState).merge(0xc0181b73e0, 0xc106ab1f20)
c:/go/src/cmd/compile/internal/ssa/regalloc.go:2638 +0x84 fp=0xc106ab1c50 sp=0xc106ab1c08 pc=0x674484
cmd/compile/internal/ssa.(*regAllocState).computeLive(0xc000039980)
c:/go/src/cmd/compile/internal/ssa/regalloc.go:2436 +0x1594 fp=0xc106ab1ff8 sp=0xc106ab1c50 pc=0x672f44
cmd/compile/internal/ssa.(*regAllocState).init(0xc000039980, 0xc0038d0580)
c:/go/src/cmd/compile/internal/ssa/regalloc.go:674 +0x6c8 fp=0xc106ab2140 sp=0xc106ab1ff8 pc=0x663be8
cmd/compile/internal/ssa.regalloc(0xc0038d0580)
c:/go/src/cmd/compile/internal/ssa/regalloc.go:145 +0x51 fp=0xc106ab2168 sp=0xc106ab2140 pc=0x6616e1
cmd/compile/internal/ssa.Compile(0xc0038d0580)
c:/go/src/cmd/compile/internal/ssa/compile.go:92 +0x99b fp=0xc106ab5d08 sp=0xc106ab2168 pc=0x617b9b
cmd/compile/internal/gc.buildssa(0xc0002b2f20, 0x3, 0x0)
c:/go/src/cmd/compile/internal/gc/ssa.go:289 +0xc15 fp=0xc106ab5eb0 sp=0xc106ab5d08 pc=0xcc2325
cmd/compile/internal/gc.compileSSA(0xc0002b2f20, 0x3)
c:/go/src/cmd/compile/internal/gc/pgen.go:298 +0x54 fp=0xc106ab5f98 sp=0xc106ab5eb0 pc=0xc8c984
cmd/compile/internal/gc.compileFunctions.func2(0xc0038d9860, 0xc003d7aa40, 0x3)
c:/go/src/cmd/compile/internal/gc/pgen.go:363 +0x50 fp=0xc106ab5fc8 sp=0xc106ab5f98 pc=0xd4f8e0
runtime.goexit()
c:/go/src/runtime/asm_amd64.s:1357 +0x1 fp=0xc106ab5fd0 sp=0xc106ab5fc8 pc=0x45de61
created by cmd/compile/internal/gc.compileFunctions
c:/go/src/cmd/compile/internal/gc/pgen.go:361 +0x12f

goroutine 1 [semacquire, 52 minutes]:
sync.runtime_Semacquire(0xc003d7aa48)
c:/go/src/runtime/sema.go:56 +0x49
sync.(*WaitGroup).Wait(0xc003d7aa40)
c:/go/src/sync/waitgroup.go:130 +0x6b
cmd/compile/internal/gc.compileFunctions()
c:/go/src/cmd/compile/internal/gc/pgen.go:373 +0x1d5
cmd/compile/internal/gc.Main(0xe7c0f8)
c:/go/src/cmd/compile/internal/gc/main.go:695 +0x32b7
main.main()
c:/go/src/cmd/compile/main.go:51 +0xb3

Compilation finished with exit code 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions