Coder Social home page Coder Social logo

gcc options craches binaries about k2 HOT 10 CLOSED

serg-meus avatar serg-meus commented on September 28, 2024
gcc options craches binaries

from k2.

Comments (10)

serg-meus avatar serg-meus commented on September 28, 2024

I suppose, you forgot the -pthread option.

from k2.

d3vv avatar d3vv commented on September 28, 2024

-pthread not needed for msys2 mingw... in this case we used Windows threads, otherwise POSIX
but with -pthread binary crashed too with -flto:

$ g++ -v
Using built-in specs.
COLLECT_GCC=C:\msys64\mingw64\bin\g++.exe
COLLECT_LTO_WRAPPER=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-7.3.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --enable-bootstrap --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-time=yes --enable-libstdcxx-filesystem-ts=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev1, Built by MSYS2 project' --with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ld
Thread model: posix
gcc version 7.3.0 (Rev1, Built by MSYS2 project)

P.S. а варнинги не красивые с кастами и перекрытием(зетемнением в стеке) аргументов...

from k2.

serg-meus avatar serg-meus commented on September 28, 2024

Hello!
Could you also add the '-g' option, compile, run and send me a crash dump?
P.S. Yes, there are many ugly things in the code. I'm a hobbyist developer so thank you for pointing them out.

from k2.

d3vv avatar d3vv commented on September 28, 2024

I've got it about hobby... But where i can get a dump(core-dump)?

dew@asus MINGW64 ~/k2
$ cat Makefile.FLTO
all:

    g++ -g main.cpp engine.cpp eval.cpp hash.cpp movegen.cpp chess.cpp Timer.cpp -std=c++0x -O3 -DNDEBUG=1 -pthread -o ./bin/Release/k2

dew@asus MINGW64 ~/k2
$ make -f Makefile.FLTO
g++ -g main.cpp engine.cpp eval.cpp hash.cpp movegen.cpp chess.cpp Timer.cpp -std=c++0x -O3 -DNDEBUG=1 -pthread -o ./bin/Release/k2

dew@asus MINGW64 ~/k2
$ ./k2.exe
uci
Segmentation fault

from k2.

d3vv avatar d3vv commented on September 28, 2024

sorry about previous post

from k2.

d3vv avatar d3vv commented on September 28, 2024

dew@asus MINGW64 ~/k2
$ cat Makefile.FLTO
all:

    g++ -g -flto -static main.cpp engine.cpp eval.cpp hash.cpp movegen.cpp chess.cpp Timer.cpp -std=c++0x -O3 -DNDEBUG=1 -pthread -o ./bin/Release/k2

dew@asus MINGW64 ~/k2
$ make -f Makefile.FLTO
g++ -g -flto -static main.cpp engine.cpp eval.cpp hash.cpp movegen.cpp chess.cpp Timer.cpp -std=c++0x -O3 -DNDEBUG=1 -pthread -o ./bin/Release/k2

dew@asus MINGW64 ~/k2
$ bin/Release/k2.exe
uci
Segmentation fault

dew@asus MINGW64 ~/k2

There is a problem with -static + -flto options

from k2.

d3vv avatar d3vv commented on September 28, 2024

k2.exe.15136.zip

from k2.

d3vv avatar d3vv commented on September 28, 2024

k2.exe.12116.zip

from k2.

d3vv avatar d3vv commented on September 28, 2024

crush dumps above from %LOCALAPPDATA%\CrashDumps

from k2.

serg-meus avatar serg-meus commented on September 28, 2024

Can't reproduce the issue

from k2.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.