Author Topic: FPC 3.2.0 or Higher on OpenBSD and Solaris  (Read 13925 times)

Xor-el

  • Sr. Member
  • ****
  • Posts: 421
Re: FPC 3.2.0 or Higher on OpenBSD and Solaris
« Reply #15 on: July 09, 2019, 10:36:52 am »
Compiler output after pull.
Code: Text  [Select][+][-]
  1. Compiling /root/bench/CryptoLib4Pascal/CryptoLib.Tests/src/CryptoLibTestBase.pas
  2. CryptoLibTestBase.pas(23,24) Error: Identifier not found "class"
  3. CryptoLibTestBase.pas(23,30) Error: Error in type definition
  4. CryptoLibTestBase.pas(23,30) Fatal: Syntax error, ";" expected but "identifier ABSTRACT" found
  5. Fatal: Compilation aborted
  6. Error: /usr/local/bin/ppcx64 returned an error exitcode
  7.  

Will look into the error you are getting now but can you please confirm that the CryptoLib4PascalPackage.lpk compiles fine?

Meanwhile I have added {$mode Delphi} (although mine compiled fine without it) in the latest commit I just made now.
Can you pull again please.
« Last Edit: July 09, 2019, 10:48:05 am by Xor-el »

julkas

  • Guest
Re: FPC 3.2.0 or Higher on OpenBSD and Solaris
« Reply #16 on: July 09, 2019, 12:52:11 pm »
Result -
Code: Text  [Select][+][-]
  1. root@freebsd:~/bench/CryptoLib4Pascal/CryptoLib.Tests/FreePascal.Tests# ./CryptoLibConsole --all --format=plain --progress
  2. Segmentation fault (core dumped)
  3.  

BTW I tested HashLib also. Output from ./HashLibConsole --format=plain --all > results.txt attached.

Xor-el

  • Sr. Member
  • ****
  • Posts: 421
Re: FPC 3.2.0 or Higher on OpenBSD and Solaris
« Reply #17 on: July 09, 2019, 12:59:29 pm »
Result -
Code: Text  [Select][+][-]
  1. root@freebsd:~/bench/CryptoLib4Pascal/CryptoLib.Tests/FreePascal.Tests# ./CryptoLibConsole --all --format=plain --progress
  2. Segmentation fault (core dumped)
  3.  

BTW I tested HashLib also. Output from ./HashLibConsole --format=plain --all > results.txt attached.

Thanks for the results, at least now I know HashLib4Pascal works on FreeBSD.
As regards CryptoLib4Pascal, can you do me a favour?
Can you debug the test project and see where it crashes?
I suspect here https://github.com/Xor-el/CryptoLib4Pascal/blob/master/CryptoLib/src/Utils/Randoms/ClpOSRandom.pas#L650

Can you set a breakpoint there and see if it successfully passes?

Thanks.
« Last Edit: August 23, 2019, 07:06:07 pm by Xor-el »

Xor-el

  • Sr. Member
  • ****
  • Posts: 421
Re: FPC 3.2.0 or Higher on OpenBSD and Solaris
« Reply #18 on: July 09, 2019, 01:44:11 pm »
@julkas, if it fails on the line I pointed out above, can you try changing that line from

Code: Pascal  [Select][+][-]
  1. arc4random_buf(data, LongWord(len));
to
Code: Pascal  [Select][+][-]
  1. arc4random_buf(data^, LongWord(len));

Recompile and see if it now works.

Thanks.

julkas

  • Guest
Re: FPC 3.2.0 or Higher on OpenBSD and Solaris
« Reply #19 on: July 09, 2019, 06:03:30 pm »
It's very strange and bad Seg fault. It occurs very early. May be in unit init part. May be even earlier. Can you give me FPC default command line project options for Linux? I use only FPC.
 

Xor-el

  • Sr. Member
  • ****
  • Posts: 421
Re: FPC 3.2.0 or Higher on OpenBSD and Solaris
« Reply #20 on: July 09, 2019, 06:07:29 pm »
It's very strange and bad Seg fault. It occurs very early. May be in unit init part. May be even earlier. Can you give me FPC default command line project options for Linux? I use only FPC.


Sorry but I don't understand, Which options?
Also did you try the change I suggested?

julkas

  • Guest
Re: FPC 3.2.0 or Higher on OpenBSD and Solaris
« Reply #21 on: July 09, 2019, 06:20:16 pm »
It's very strange and bad Seg fault. It occurs very early. May be in unit init part. May be even earlier. Can you give me FPC default command line project options for Linux? I use only FPC.
Sorry but I don't understand, Which options?
Also did you try the change I suggested?
Your change gives compilation error.
How you compile CryptoLibConsole project on Linux OS?

Xor-el

  • Sr. Member
  • ****
  • Posts: 421
Re: FPC 3.2.0 or Higher on OpenBSD and Solaris
« Reply #22 on: July 09, 2019, 06:23:00 pm »
It's very strange and bad Seg fault. It occurs very early. May be in unit init part. May be even earlier. Can you give me FPC default command line project options for Linux? I use only FPC.
Sorry but I don't understand, Which options?
Also did you try the change I suggested?
Your change gives compilation error.
How you compile CryptoLibConsole project on Linux OS?

Well I pretty much use the Lazarus IDE to compile it on Linux OS, but I guess it should be similar to the commands you use on OpenBSD.

julkas

  • Guest
Re: FPC 3.2.0 or Higher on OpenBSD and Solaris
« Reply #23 on: July 09, 2019, 08:41:09 pm »
I will try backtrace with GDB tommorow.

Xor-el

  • Sr. Member
  • ****
  • Posts: 421
Re: FPC 3.2.0 or Higher on OpenBSD and Solaris
« Reply #24 on: July 09, 2019, 09:58:41 pm »
I will try backtrace with GDB tommorow.

ok, thanks for everything.

Xor-el

  • Sr. Member
  • ****
  • Posts: 421
Re: FPC 3.2.0 or Higher on OpenBSD and Solaris
« Reply #25 on: July 10, 2019, 04:54:04 am »
@julkas,

so I was finally able to run the tests on an OpenBSD OS.
surprising enough, I didn't experience any segmentation fault, weird I must say taking into consideration you encountered such.

well, attached are screenshots of the test results on OpenBSD OS.

Thanks for everything once again.

do you by chance have a Solaris OS lying around?  :D


julkas

  • Guest
Re: FPC 3.2.0 or Higher on OpenBSD and Solaris
« Reply #26 on: July 10, 2019, 09:11:10 am »
so I was finally able to run the tests on an OpenBSD OS.

It's good news| :beer: !

surprising enough, I didn't experience any segmentation fault, weird I must say taking into consideration you encountered such.

OK. We are on different OS's. I am testing on FreeBSD 12.0 and your results are from OpenBSD 6.5.

do you by chance have a Solaris OS lying around?  :D

I can help you only with *BSD OS's.

See you later.
Regards.

Xor-el

  • Sr. Member
  • ****
  • Posts: 421
Re: FPC 3.2.0 or Higher on OpenBSD and Solaris
« Reply #27 on: July 10, 2019, 09:37:20 am »
Oh sorry, I guess I mixed things up.
Please keep me up to date with the gdb backtrace as you indicated.

Thanks.

Maybe you can try installing the Lazarus IDE on your FreeBSD OS.
It will help with debugging the issue with the test.
« Last Edit: July 10, 2019, 09:39:56 am by Xor-el »

Xor-el

  • Sr. Member
  • ****
  • Posts: 421
Re: FPC 3.2.0 or Higher on OpenBSD and Solaris
« Reply #28 on: July 11, 2019, 03:31:24 am »
Solaris test results attached below


julkas

  • Guest
Re: FPC 3.2.0 or Higher on OpenBSD and Solaris
« Reply #29 on: July 11, 2019, 11:41:09 am »
1. I found dirty workaround for Seg Fault on FreeBSD 12.0
Change - https://github.com/Xor-el/CryptoLib4Pascal/blob/3bddc632988503bf9fb6fe6e3b5cb62940c985a1/CryptoLib/src/Utils/Randoms/ClpOSRandom.pas#L329 to
Code: Pascal  [Select][+][-]
  1. {$IFDEF CRYPTOLIB_GENERIC_BSD}
  2. procedure arc4random_buf(bytes: PByte; count: LongWord); cdecl;
  3.   external 'libc.so.7' name 'arc4random_buf';
  4. {$ENDIF}
  5.  

2. Now output gives -
Code: Text  [Select][+][-]
  1. root@freebsd:~/bench/CryptoLib4Pascal/CryptoLib.Tests/FreePascal.Tests# ./CryptoLibConsole --all --format=plain --progress
  2. An unhandled exception occurred at $000000000028EF8B:
  3. EAccessViolation: Access violation
  4.   $000000000028EF8B  SIGNALTORUNERROR,  line 55 of x86_64/sighnd.inc
  5.   $0000000000521766  GETBYTES,  line 693 of ../../CryptoLib/src/Utils/Randoms/ClpOSRandom.pas
  6.   $0000000000521FAB  CREATE,  line 189 of ../../CryptoLib/src/Utils/Randoms/ClpAESPRNGRandom.pas
  7.   $000000000052194F  BOOT,  line 129 of ../../CryptoLib/src/Utils/Randoms/ClpAESPRNGRandom.pas
  8.   $00000000005223F5  createaesprngrandom,  line 257 of ../../CryptoLib/src/Utils/Randoms/ClpAESPRNGRandom.pas
  9.   $00000000005225C9  CLPAESPRNGRANDOM_$$_init_implicit$
  10.  
  11. Heap dump by heaptrc unit of ./CryptoLibConsole
  12. 1124 memory blocks allocated : 239088/239648
  13. 1121 memory blocks freed     : 238896/239456
  14. 3 unfreed memory blocks : 192
  15. True heap size : 1245184 (64 used in System startup)
  16. True free heap : 1244256
  17. Should be : 1244352
  18. Call trace for block $00000008008E2EC0 size 128
  19.   $0000000000280201  fpc_raiseexception,  line 165 of ../inc/except.inc
  20.   $000000000028EF8B  SIGNALTORUNERROR,  line 55 of x86_64/sighnd.inc
  21.   $0000000000521766  GETBYTES,  line 693 of ../../CryptoLib/src/Utils/Randoms/ClpOSRandom.pas
  22.   $0000000000521FAB  CREATE,  line 189 of ../../CryptoLib/src/Utils/Randoms/ClpAESPRNGRandom.pas
  23.   $000000000052194F  BOOT,  line 129 of ../../CryptoLib/src/Utils/Randoms/ClpAESPRNGRandom.pas
  24.   $00000000005223F5  createaesprngrandom,  line 257 of ../../CryptoLib/src/Utils/Randoms/ClpAESPRNGRandom.pas
  25. Call trace for block $0000000800903700 size 40
  26.   $0000000000280201  fpc_raiseexception,  line 165 of ../inc/except.inc
  27.   $000000000028EF8B  SIGNALTORUNERROR,  line 55 of x86_64/sighnd.inc
  28.   $0000000000521766  GETBYTES,  line 693 of ../../CryptoLib/src/Utils/Randoms/ClpOSRandom.pas
  29.   $0000000000521FAB  CREATE,  line 189 of ../../CryptoLib/src/Utils/Randoms/ClpAESPRNGRandom.pas
  30.   $000000000052194F  BOOT,  line 129 of ../../CryptoLib/src/Utils/Randoms/ClpAESPRNGRandom.pas
  31.   $00000000005223F5  createaesprngrandom,  line 257 of ../../CryptoLib/src/Utils/Randoms/ClpAESPRNGRandom.pas
  32. Call trace for block $0000000800903600 size 24
  33.   $000000000028EF8B  SIGNALTORUNERROR,  line 55 of x86_64/sighnd.inc
  34.   $0000000000521766  GETBYTES,  line 693 of ../../CryptoLib/src/Utils/Randoms/ClpOSRandom.pas
  35.   $0000000000521FAB  CREATE,  line 189 of ../../CryptoLib/src/Utils/Randoms/ClpAESPRNGRandom.pas
  36.   $000000000052194F  BOOT,  line 129 of ../../CryptoLib/src/Utils/Randoms/ClpAESPRNGRandom.pas
  37.   $00000000005223F5  createaesprngrandom,  line 257 of ../../CryptoLib/src/Utils/Randoms/ClpAESPRNGRandom.pas
  38.  

Compiler options -  -B -gl -gh -dDEBUG -Tfreebsd -Mdelphi



 

TinyPortal © 2005-2018