Jump to content

CryptoPP 8.5.0


Recommended Posts

  • Contributor

Hi, 

When I compile my game with Crypto++ 8.5.0 (current version from pkg install cryptopp) the game compiles fine but when I try to log in, the auth crash.

GDB:

Core was generated by `./auth'.
Program terminated with signal SIGILL, Illegal instruction.
Privileged opcode.
#0  KeyAgreement::~KeyAgreement (this=0x213dd780) at cipher.cpp:100
100       virtual ~KeyAgreement() {}
[Current thread is 1 (LWP 100565)]
(gdb) bt
#0  KeyAgreement::~KeyAgreement (this=0x213dd780) at cipher.cpp:100
#1  0x006024a0 in Cipher::Prepare (this=0x213cea2c, buffer=0xffbfb35d,
    length=0xffbfb354) at cipher.cpp:159
#2  0x00542329 in DESC::SendKeyAgreement (this=0x213ce700) at desc.cpp:731
#3  0x00564fc6 in CInputProcessor::Handshake (d=0x213ce700,
    c_pData=0x22023400 "\377\243*\251\300/l\002", this=<optimized out>)
    at input.cpp:212
#4  CInputHandshake::Analyze (this=0x213ce72c, d=0x213ce700,
    bHeader=255 '\377', c_pData=0x22023400 "\377\243*\251\300/l\002")
    at input.cpp:646
#5  0x00564697 in CInputProcessor::Process (this=0x213ce72c,
    lpDesc=0x213ce700, c_pvOrig=0x22023400, iBytes=13,
    r_iBytesProceed=@0xffbfb9cc: 0) at input.cpp:103
#6  0x00541c55 in DESC::ProcessInput (this=0x213ce700) at desc.cpp:313
#7  0x00633524 in io_loop (fdw=0x213be520) at main.cpp:1059
#8  0x00633229 in idle () at main.cpp:948
#9  0x00631ef5 in main (argc=<optimized out>, argv=0xffbfecbc) at main.cpp:609
(gdb)

GDB Full: https://pastebin.com/jwLNHPGn (it's long so I used pastebin)

If you want to have a look in the source files: 

This is the hidden content, please

(It's the same as https://metin2.dev/topic/27610-40250-reference-serverfile-client-src-15-available-languages/ just removed hackshield because hs lib wasen't compatible)

Any idea how to make it work?

Edit: When I install cryptopp manually from https://cryptopp.com/cryptopp850.zip it works fine. I have no clue what's happening 🙃
The file sizes are different in the lib folder when I install it via pkg and when I install it manually, but maybe just compression.

Thanks in advance,
TMP4

 

Edited by TMP4
  • Metin2 Dev 17
  • Scream 1
  • Good 1
  • Love 1
  • Love 3
Link to comment
Share on other sites

  • Contributor
12 minutes ago, Denizeri24 said:

dont use pkg.

use make install (install from ports)

pkg and the port version is the same, but I tried, same result, auth crash.

What is weird is that when I installs it manually by download it from: https://cryptopp.com/#download and gmake & gmake install it works fine, auth does not crash. There is some difference in the port version and in the cryptopp.com version. As I said the lib (libcryptopp.a) size are different, but that mostly because of compression.

To sum it up:

  • cd /usr/ports/security/cryptopp && make install clean (or via pkg) --> auth crash
  • Installing it by downloading & unzipping this: https://cryptopp.com/cryptopp850.zip and gmake and gmake install --> it works fine

The result should be the same in either way, but it's not.

Edited by TMP4
  • Metin2 Dev 6
  • Think 1
Link to comment
Share on other sites

9 minutes ago, TMP4 said:

pkg and the port version is the same, but I tried, same result, auth crash.

What is weird is that when I installs it manually by download it from: 

Hidden Content

  • Give reaction to this post to see the hidden content.

 and gmake & gmake install it works fine, auth does not crash. There is some difference in the port version and in the cryptopp.com version. As I said the lib (libcryptopp.a) size are different, but that mostly because of compression.

 

To sum it up:

  • cd /usr/ports/security/cryptopp && make install clean (or via pkg) --> auth crash
  • Installing it by downloading & unzipping this: https://cryptopp.com/cryptopp850.zip and gmake and gmake install --> it works fine

The result should be the same in either way, but it's not.

 

whats your compiler? gcc or clang? and what versions?

 

and when you compile from ports, what you using compiler?  The reason for getting errors in cryptopp is usually compiler diffs (optimizations) and c++ versions..

Link to comment
Share on other sites

  • Contributor
8 minutes ago, Denizeri24 said:

 

whats your compiler? gcc or clang? and what versions?

 

and when you compile from ports, what you using compiler?  The reason for getting errors in cryptopp is usually compiler diffs (optimizations) and c++ versions..

clang for the project (game,db) clang++-devel

"and when you compile from ports, what you using compiler?"
Can we choose? I just give cd /usr/ports/security/cryptopp && make install clean command.

Edited by TMP4
Link to comment
Share on other sites

1 minute ago, TMP4 said:

clang for the project (game,db) clang++-devel

"and when you compile from ports, what you using compiler?"
Can we choose? I just give cd /usr/ports/security/cryptopp && make install clean command.

etc/make.conf

CC = clang-devel

CXX = clang++-devel

 

Freebsd has changed default compiler (gcc to clang).

The devel version is the developer version and the devel version does not come by default in operating systems.

 

Clang-Devel --> Version 12 or 13

Clang --> Version 8

  • Love 1
Link to comment
Share on other sites

  • Contributor
22 minutes ago, Denizeri24 said:

etc/make.conf

CC = clang-devel

CXX = clang++-devel

 

Freebsd has changed default compiler (gcc to clang).

The devel version is the developer version and the devel version does not come by default in operating systems.

 

Clang-Devel --> Version 12 or 13

Clang --> Version 8

I see your point and I did it, now the port version compiled with clang++-devel too.
However it's still the same, auth crash and I getting lost my faith.

 

Link to comment
Share on other sites

38 minutes ago, TMP4 said:

I see your point and I did it, now the port version compiled with clang++-devel too.
However it's still the same, auth crash and I getting lost my faith.

 

etc/make.conf

CFLAGS += -march=x86-64

CXXFLAGS += -march=x86-64

rebuild crpytopp (pkg delete crpytopp --> make clean --> make install) and game.

 

If the error is not resolved, search this;

Program terminated with signal SIGILL, Illegal instruction. Privileged opcode.

Link to comment
Share on other sites

  • Contributor
11 minutes ago, Denizeri24 said:

etc/make.conf

CFLAGS += -march=x86-64

CXXFLAGS += -march=x86-64

rebuild crpytopp (pkg delete crpytopp --> make clean --> make install) and game.

 

If the error is not resolved, search this;

Program terminated with signal SIGILL, Illegal instruction. Privileged opcode.

Yep I rebuilt cryptopp, game, db too. When I rebuilt cryptopp I saw it was compiled with clang++-devel so that part is ok.

I have benn looked for SIGILL, Illegal instruction for hours yesterday, I know what it means but I don't know why I get that when I built crytopp from ports and not manually.

Edited by TMP4
Link to comment
Share on other sites

  • Contributor
1 hour ago, .NyanCat said:

I experienced that exact samr peoblem as well yesterday 😄

On login. Auth crashes.

Well I just went for https://cryptopp.com/cryptopp840.zip (8.5.0 works too but I have 8.4.0 in the clientside so I choose that)

Unzip it in your freebsd then cd there then gmake then gmake install or point to that directory in your MakeFIle.
(Be sure to remove cryptopp before if you have already installed via pkg or from ports)

Still don't know why the pkg and the port version not working tho, but honestly I don't care at this point,
at least the downloadable version works 🙂

Edited by TMP4
  • Love 1
Link to comment
Share on other sites

  • 1 year later...
On 11/22/2021 at 8:47 PM, TMP4 said:

Well I just went for https://cryptopp.com/cryptopp840.zip (8.5.0 works too but I have 8.4.0 in the clientside so I choose that)

Unzip it in your freebsd then cd there then gmake then gmake install or point to that directory in your MakeFIle.
(Be sure to remove cryptopp before if you have already installed via pkg or from ports)

Still don't know why the pkg and the port version not working tho, but honestly I don't care at this point,
at least the downloadable version works 🙂

How do you build the shared lib (.so)?
If i run "gmake static dynamic" i get the error 

 

"ld: error: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC"

Link to comment
Share on other sites

  • 3 weeks later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.