1.1.1 pre1 tests failing on Solaris SPARC

classic Classic list List threaded Threaded
60 messages Options
123
Reply | Threaded
Open this post in threaded view
|

1.1.1 pre1 tests failing on Solaris SPARC

Norm Green
Not sure if this is expected on this platform?

Test Summary Report
-------------------
../test/recipes/04-test_asn1_encode.t            (Wstat: 256 Tests: 1
Failed: 1)
   Failed test:  1
   Non-zero exit status: 1
../test/recipes/90-test_secmem.t                 (Wstat: 256 Tests: 1
Failed: 1)
   Failed test:  1
   Non-zero exit status: 1
Files=141, Tests=1313, 370 wallclock secs ( 3.42 usr  0.94 sys + 266.48
cusr 40.30 csys = 311.14 CPU)
Result: FAIL
Makefile:169: recipe for target '_tests' failed


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: 1.1.1 pre1 tests failing on Solaris SPARC

OpenSSL - User mailing list
On 02/19/2018 02:06 PM, Norm Green wrote:

> Not sure if this is expected on this platform?
>
> Test Summary Report
> -------------------
> ../test/recipes/04-test_asn1_encode.t            (Wstat: 256 Tests: 1
> Failed: 1)
>   Failed test:  1
>   Non-zero exit status: 1
> ../test/recipes/90-test_secmem.t                 (Wstat: 256 Tests: 1
> Failed: 1)
>   Failed test:  1
>   Non-zero exit status: 1
> Files=141, Tests=1313, 370 wallclock secs ( 3.42 usr  0.94 sys +
> 266.48 cusr 40.30 csys = 311.14 CPU)
> Result: FAIL
> Makefile:169: recipe for target '_tests' failed

I do not think it is expected.  Could you capture the output of 'make
V=1 TESTS="test_asn1_encode test_secmem"' and make it available? 
(Probably via posting it on the web and linking; the output may be long.)

-Ben
--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: 1.1.1 pre1 tests failing on Solaris SPARC

Norm Green
The output is not too long.



/export/localnew/sparc.Solaris/bin/gmake depend &&
/export/localnew/sparc.Solaris/bin/gmake _tests
gmake[1]: Entering directory
'/hamburg4/users/normg/gs64trunk/slow10/openssl_1.1'
gmake[1]: Leaving directory
'/hamburg4/users/normg/gs64trunk/slow10/openssl_1.1'
gmake[1]: Entering directory
'/hamburg4/users/normg/gs64trunk/slow10/openssl_1.1'
( cd test; \
   mkdir -p test-runs; \
   SRCTOP=../. \
   BLDTOP=../. \
   RESULT_D=test-runs \
   PERL="/opt/perl-5.24.0/bin/perl" \
   EXE_EXT= \
   OPENSSL_ENGINES=`cd .././engines; pwd` \
   OPENSSL_DEBUG_MEMORY=on \
     /opt/perl-5.24.0/bin/perl .././test/run_tests.pl test_asn1_encode
test_secmem )
../test/recipes/04-test_asn1_encode.t ..
1..1
     # Subtest: ../../test/asn1_encode_test
     1..6
     ok 1 - test_long_32bit
     # ASN1_LONG_DATA:
     #   success: TRUE
../../util/shlib_wrap.sh ../../test/asn1_encode_test => 138
not ok 1 - running asn1_encode_test

#   Failed test 'running asn1_encode_test'
#   at
/hamburg4/users/normg/gs64trunk/slow10/openssl_1.1/test/../util/perl/OpenSSL/Test/Simple.pm
line 77.
# Looks like you failed 1 test of 1.
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests
../test/recipes/90-test_secmem.t .......
1..1
     # Subtest: ../../test/secmemtest
     1..1
     # ERROR: (bool) 'CRYPTO_secure_malloc_init(4096, 32) == true'
failed @ test/secmemtest.c:28
     # false
     not ok 1 - test_sec_mem
../../util/shlib_wrap.sh ../../test/secmemtest => 1
not ok 1 - running secmemtest

#   Failed test 'running secmemtest'
#   at
/hamburg4/users/normg/gs64trunk/slow10/openssl_1.1/test/../util/perl/OpenSSL/Test/Simple.pm
line 77.
# Looks like you failed 1 test of 1.
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests

Test Summary Report
-------------------
../test/recipes/04-test_asn1_encode.t (Wstat: 256 Tests: 1 Failed: 1)
   Failed test:  1
   Non-zero exit status: 1
../test/recipes/90-test_secmem.t     (Wstat: 256 Tests: 1 Failed: 1)
   Failed test:  1
   Non-zero exit status: 1
Files=2, Tests=2,  2 wallclock secs ( 0.04 usr  0.01 sys + 0.38 cusr 
0.16 csys =  0.59 CPU)
Result: FAIL
Makefile:169: recipe for target '_tests' failed
gmake[1]: *** [_tests] Error 1
gmake[1]: Leaving directory
'/hamburg4/users/normg/gs64trunk/slow10/openssl_1.1'
Makefile:167: recipe for target 'tests' failed
gmake: *** [tests] Error 2
slow test failed



On 2/19/2018 12:50 PM, Benjamin Kaduk wrote:

> On 02/19/2018 02:06 PM, Norm Green wrote:
>> Not sure if this is expected on this platform?
>>
>> Test Summary Report
>> -------------------
>> ../test/recipes/04-test_asn1_encode.t            (Wstat: 256 Tests: 1
>> Failed: 1)
>>    Failed test:  1
>>    Non-zero exit status: 1
>> ../test/recipes/90-test_secmem.t                 (Wstat: 256 Tests: 1
>> Failed: 1)
>>    Failed test:  1
>>    Non-zero exit status: 1
>> Files=141, Tests=1313, 370 wallclock secs ( 3.42 usr  0.94 sys +
>> 266.48 cusr 40.30 csys = 311.14 CPU)
>> Result: FAIL
>> Makefile:169: recipe for target '_tests' failed
> I do not think it is expected.  Could you capture the output of 'make
> V=1 TESTS="test_asn1_encode test_secmem"' and make it available?
> (Probably via posting it on the web and linking; the output may be long.)
>
> -Ben

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: 1.1.1 pre1 tests failing on Solaris SPARC

Viktor Dukhovni


> On Feb 19, 2018, at 4:20 PM, Norm Green <[hidden email]> wrote:
>
> /export/localnew/sparc.Solaris/bin/gmake depend && /export/localnew/sparc.Solaris/bin/gmake _tests
> gmake[1]: Entering directory '/hamburg4/users/normg/gs64trunk/slow10/openssl_1.1'
> gmake[1]: Leaving directory '/hamburg4/users/normg/gs64trunk/slow10/openssl_1.1'
> gmake[1]: Entering directory '/hamburg4/users/normg/gs64trunk/slow10/openssl_1.1'
> ( cd test; \
>   mkdir -p test-runs; \
>   SRCTOP=../. \
>   BLDTOP=../. \
>   RESULT_D=test-runs \
>   PERL="/opt/perl-5.24.0/bin/perl" \
>   EXE_EXT= \
>   OPENSSL_ENGINES=`cd .././engines; pwd` \
>   OPENSSL_DEBUG_MEMORY=on \
>     /opt/perl-5.24.0/bin/perl .././test/run_tests.pl test_asn1_encode test_secmem )
> ../test/recipes/04-test_asn1_encode.t ..
> 1..1
>     # Subtest: ../../test/asn1_encode_test
>     1..6
>     ok 1 - test_long_32bit
>     # ASN1_LONG_DATA:
>     #   success: TRUE
> ../../util/shlib_wrap.sh ../../test/asn1_encode_test => 138

On FreeBSD signal 10 (128 + 10 == 138) is SIGBUS, which could be a result of unaligned
data access (please report "kill -l" output to confirm the signal numbers).

Could you run this test under gdb, or enable core dumps, and report the stack trace?
You may need a build with debugging symbols.

--
        Viktor.

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: 1.1.1 pre1 tests failing on Solaris SPARC

Norm Green
You are correct, we are getting a SIGBUS.  Solaris SPARC does not allow
unaligned data access:

(dbx) run
Running: asn1_encode_test
(process id 11159)
Reading libc_psr.so.1
Reading libscf.so.1
Reading libdoor.so.1
Reading libuutil.so.1
Reading libgen.so.1
Reading libmd.so.1
Reading libmp.so.2
1..6
ok 1 - test_long_32bit
# ASN1_LONG_DATA:
#   success: TRUE
t@1 (l@1) signal BUS (invalid address alignment) in asn1_item_print_ctx
at line 155 in file "tasn_prn.c"
   155          || (it->utype != V_ASN1_BOOLEAN)) && *fld == NULL) {
(dbx) where
current thread: t@1
=>[1] asn1_item_print_ctx(out = 0x1001453c0, fld = 0xffffffff7fffd6dc,
indent = 2, it = 0xffffffff7f3a29f0, fname = 0x100033ad8 "test_long",
sname = (nil), nohdr = 0, pctx = 0xffffffff7f39e8f8), line 155 in
"tasn_prn.c"
   [2] asn1_template_print_ctx(out = 0x1001453c0, fld =
0xffffffff7fffd6dc, indent = 2, tt = 0x100137808, pctx =
0xffffffff7f39e8f8), line 328 in "tasn_prn.c"
   [3] asn1_item_print_ctx(out = 0x1001453c0, fld = 0xffffffff7fffd5e0,
indent = 0, it = 0x1001376c8, fname = (nil), sname = 0x100033af8
"ASN1_LONG_DATA", nohdr = 0, pctx = 0xffffffff7f39e8f8), line 241 in
"tasn_prn.c"
   [4] ASN1_item_print(out = 0x1001453c0, ifld = 0xffffffff7fffd6d4,
indent = 0, it = 0x1001376c8, pctx = 0xffffffff7f39e8f8), line 131 in
"tasn_prn.c"
   [5] do_print_item(package = 0x100135e68), line 720 in
"asn1_encode_test.c"
   [6] test_intern(package = 0x100135e68), line 815 in "asn1_encode_test.c"
   [7] test_long_64bit(), line 832 in "asn1_encode_test.c"
   [8] run_tests(test_prog_name = 0xffffffff7fffef88
"/hamburg4/users/normg/gs64trunk/slow10/openssl_1.1/test/asn1_encode_test"),
line 205 in "driver.c"
   [9] main(argc = 1, argv = 0xffffffff7fffec08), line 51 in "main.c"
(dbx)


On 2/19/2018 1:30 PM, Viktor Dukhovni wrote:

>
>> On Feb 19, 2018, at 4:20 PM, Norm Green <[hidden email]> wrote:
>>
>> /export/localnew/sparc.Solaris/bin/gmake depend && /export/localnew/sparc.Solaris/bin/gmake _tests
>> gmake[1]: Entering directory '/hamburg4/users/normg/gs64trunk/slow10/openssl_1.1'
>> gmake[1]: Leaving directory '/hamburg4/users/normg/gs64trunk/slow10/openssl_1.1'
>> gmake[1]: Entering directory '/hamburg4/users/normg/gs64trunk/slow10/openssl_1.1'
>> ( cd test; \
>>    mkdir -p test-runs; \
>>    SRCTOP=../. \
>>    BLDTOP=../. \
>>    RESULT_D=test-runs \
>>    PERL="/opt/perl-5.24.0/bin/perl" \
>>    EXE_EXT= \
>>    OPENSSL_ENGINES=`cd .././engines; pwd` \
>>    OPENSSL_DEBUG_MEMORY=on \
>>      /opt/perl-5.24.0/bin/perl .././test/run_tests.pl test_asn1_encode test_secmem )
>> ../test/recipes/04-test_asn1_encode.t ..
>> 1..1
>>      # Subtest: ../../test/asn1_encode_test
>>      1..6
>>      ok 1 - test_long_32bit
>>      # ASN1_LONG_DATA:
>>      #   success: TRUE
>> ../../util/shlib_wrap.sh ../../test/asn1_encode_test => 138
> On FreeBSD signal 10 (128 + 10 == 138) is SIGBUS, which could be a result of unaligned
> data access (please report "kill -l" output to confirm the signal numbers).
>
> Could you run this test under gdb, or enable core dumps, and report the stack trace?
> You may need a build with debugging symbols.
>

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: 1.1.1 pre1 tests failing on Solaris SPARC

Norm Green
In reply to this post by Norm Green
For the failure in secmemtst, it appears that secure memory is not
enabled per this code in ./crypto/mem_sec.c

  23 /* e_os.h includes unistd.h, which defines _POSIX_VERSION */
  24 #if !defined(OPENSSL_NO_SECURE_MEMORY) && defined(OPENSSL_SYS_UNIX) \
  25     && defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L
  26 # define IMPLEMENTED
  27 # include <stdlib.h>
  28 # include <assert.h>
  29 # include <unistd.h>
  30 # include <sys/types.h>
  31 # include <sys/mman.h>
  32 # if defined(OPENSSL_SYS_LINUX)
  33 #  include <sys/syscall.h>
  34 #  include <linux/mman.h>
  35 #  include <errno.h>
  36 # endif
  37 # include <sys/param.h>
  38 # include <sys/stat.h>
  39 # include <fcntl.h>
  40 #endif



Solaris has this in sys/unistd.h

#ifndef _POSIX_VERSION
#ifdef  _XPG6
#define _POSIX_VERSION          200112L /* Supports IEEE Std 1003.1-2001 */
#else
#define _POSIX_VERSION          199506L /* Supports POSIX-1c DIS */
#endif
#endif /* _POSIX_VERSION */

I'm building with the native Oracle Solaris compiler which apparently
does not define these macros.

Nornm


On 2/19/2018 1:20 PM, Norm Green wrote:

> The output is not too long.
>
>
>
> /export/localnew/sparc.Solaris/bin/gmake depend &&
> /export/localnew/sparc.Solaris/bin/gmake _tests
> gmake[1]: Entering directory
> '/hamburg4/users/normg/gs64trunk/slow10/openssl_1.1'
> gmake[1]: Leaving directory
> '/hamburg4/users/normg/gs64trunk/slow10/openssl_1.1'
> gmake[1]: Entering directory
> '/hamburg4/users/normg/gs64trunk/slow10/openssl_1.1'
> ( cd test; \
>   mkdir -p test-runs; \
>   SRCTOP=../. \
>   BLDTOP=../. \
>   RESULT_D=test-runs \
>   PERL="/opt/perl-5.24.0/bin/perl" \
>   EXE_EXT= \
>   OPENSSL_ENGINES=`cd .././engines; pwd` \
>   OPENSSL_DEBUG_MEMORY=on \
>     /opt/perl-5.24.0/bin/perl .././test/run_tests.pl test_asn1_encode
> test_secmem )
> ../test/recipes/04-test_asn1_encode.t ..
> 1..1
>     # Subtest: ../../test/asn1_encode_test
>     1..6
>     ok 1 - test_long_32bit
>     # ASN1_LONG_DATA:
>     #   success: TRUE
> ../../util/shlib_wrap.sh ../../test/asn1_encode_test => 138
> not ok 1 - running asn1_encode_test
>
> #   Failed test 'running asn1_encode_test'
> #   at
> /hamburg4/users/normg/gs64trunk/slow10/openssl_1.1/test/../util/perl/OpenSSL/Test/Simple.pm
> line 77.
> # Looks like you failed 1 test of 1.
> Dubious, test returned 1 (wstat 256, 0x100)
> Failed 1/1 subtests
> ../test/recipes/90-test_secmem.t .......
> 1..1
>     # Subtest: ../../test/secmemtest
>     1..1
>     # ERROR: (bool) 'CRYPTO_secure_malloc_init(4096, 32) == true'
> failed @ test/secmemtest.c:28
>     # false
>     not ok 1 - test_sec_mem
> ../../util/shlib_wrap.sh ../../test/secmemtest => 1
> not ok 1 - running secmemtest
>
> #   Failed test 'running secmemtest'
> #   at
> /hamburg4/users/normg/gs64trunk/slow10/openssl_1.1/test/../util/perl/OpenSSL/Test/Simple.pm
> line 77.
> # Looks like you failed 1 test of 1.
> Dubious, test returned 1 (wstat 256, 0x100)
> Failed 1/1 subtests
>
> Test Summary Report
> -------------------
> ../test/recipes/04-test_asn1_encode.t (Wstat: 256 Tests: 1 Failed: 1)
>   Failed test:  1
>   Non-zero exit status: 1
> ../test/recipes/90-test_secmem.t     (Wstat: 256 Tests: 1 Failed: 1)
>   Failed test:  1
>   Non-zero exit status: 1
> Files=2, Tests=2,  2 wallclock secs ( 0.04 usr  0.01 sys + 0.38 cusr 
> 0.16 csys =  0.59 CPU)
> Result: FAIL
> Makefile:169: recipe for target '_tests' failed
> gmake[1]: *** [_tests] Error 1
> gmake[1]: Leaving directory
> '/hamburg4/users/normg/gs64trunk/slow10/openssl_1.1'
> Makefile:167: recipe for target 'tests' failed
> gmake: *** [tests] Error 2
> slow test failed
>
>
>
> On 2/19/2018 12:50 PM, Benjamin Kaduk wrote:
>> On 02/19/2018 02:06 PM, Norm Green wrote:
>>> Not sure if this is expected on this platform?
>>>
>>> Test Summary Report
>>> -------------------
>>> ../test/recipes/04-test_asn1_encode.t            (Wstat: 256 Tests: 1
>>> Failed: 1)
>>>    Failed test:  1
>>>    Non-zero exit status: 1
>>> ../test/recipes/90-test_secmem.t                 (Wstat: 256 Tests: 1
>>> Failed: 1)
>>>    Failed test:  1
>>>    Non-zero exit status: 1
>>> Files=141, Tests=1313, 370 wallclock secs ( 3.42 usr  0.94 sys +
>>> 266.48 cusr 40.30 csys = 311.14 CPU)
>>> Result: FAIL
>>> Makefile:169: recipe for target '_tests' failed
>> I do not think it is expected.  Could you capture the output of 'make
>> V=1 TESTS="test_asn1_encode test_secmem"' and make it available?
>> (Probably via posting it on the web and linking; the output may be
>> long.)
>>
>> -Ben
>

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: 1.1.1 pre1 tests failing on Solaris SPARC

Viktor Dukhovni
In reply to this post by Norm Green
On Mon, Feb 19, 2018 at 01:45:26PM -0800, Norm Green wrote:

> # ASN1_LONG_DATA:
> #   success: TRUE
> t@1 (l@1) signal BUS (invalid address alignment) in asn1_item_print_ctx at
> line 155 in file "tasn_prn.c"
>   155          || (it->utype != V_ASN1_BOOLEAN)) && *fld == NULL) {

Perhaps aligning the item buffer (by using malloc) will help, does
the patch below address the problem?

diff --git a/test/asn1_encode_test.c b/test/asn1_encode_test.c
index e9f459ad65..77fa9b5954 100644
--- a/test/asn1_encode_test.c
+++ b/test/asn1_encode_test.c
@@ -709,15 +709,19 @@ static int do_encode_custom(EXPECTED *input,
 static int do_print_item(const TEST_PACKAGE *package)
 {
 #define DATA_BUF_SIZE 256
-    unsigned char buf[DATA_BUF_SIZE];
     const ASN1_ITEM *i = ASN1_ITEM_ptr(package->asn1_type);
-    ASN1_VALUE *o = (ASN1_VALUE *)&buf;
+    ASN1_VALUE *o = OPENSSL_malloc(DATA_BUF_SIZE);
     int ret;
 
     OPENSSL_assert(package->encode_expectations_elem_size <= DATA_BUF_SIZE);
 
-    (void)RAND_bytes(buf, (int)package->encode_expectations_elem_size);
+    if (o == NULL)
+        return 0;
+
+    (void)RAND_bytes((unsigned char *)o,
+                     (int)package->encode_expectations_elem_size);
     ret = ASN1_item_print(bio_err, o, 0, i, NULL);
+    OPENSSL_free(o);
 
     return ret;
 }

--
        Viktor.
--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: 1.1.1 pre1 tests failing on Solaris SPARC

OpenSSL - User mailing list
Would making buf a union also avoid the problem?

        union { unsigned long dummy[2]; char buf[DATA_BUF_SIZE]; } d
and then replace 'buf' with 'd.buf' in the code?


On 2/20/18, 12:00 AM, "Viktor Dukhovni" <[hidden email]> wrote:

    On Mon, Feb 19, 2018 at 01:45:26PM -0800, Norm Green wrote:
   
    > # ASN1_LONG_DATA:
    > #   success: TRUE
    > t@1 (l@1) signal BUS (invalid address alignment) in asn1_item_print_ctx at
    > line 155 in file "tasn_prn.c"
    >   155          || (it->utype != V_ASN1_BOOLEAN)) && *fld == NULL) {
   
    Perhaps aligning the item buffer (by using malloc) will help, does
    the patch below address the problem?
   
    diff --git a/test/asn1_encode_test.c b/test/asn1_encode_test.c
    index e9f459ad65..77fa9b5954 100644
    --- a/test/asn1_encode_test.c
    +++ b/test/asn1_encode_test.c
    @@ -709,15 +709,19 @@ static int do_encode_custom(EXPECTED *input,
     static int do_print_item(const TEST_PACKAGE *package)
     {
     #define DATA_BUF_SIZE 256
    -    unsigned char buf[DATA_BUF_SIZE];
         const ASN1_ITEM *i = ASN1_ITEM_ptr(package->asn1_type);
    -    ASN1_VALUE *o = (ASN1_VALUE *)&buf;
    +    ASN1_VALUE *o = OPENSSL_malloc(DATA_BUF_SIZE);
         int ret;
     
         OPENSSL_assert(package->encode_expectations_elem_size <= DATA_BUF_SIZE);
     
    -    (void)RAND_bytes(buf, (int)package->encode_expectations_elem_size);
    +    if (o == NULL)
    +        return 0;
    +
    +    (void)RAND_bytes((unsigned char *)o,
    +                     (int)package->encode_expectations_elem_size);
         ret = ASN1_item_print(bio_err, o, 0, i, NULL);
    +    OPENSSL_free(o);
     
         return ret;
     }
   
    --
    Viktor.
    --
    openssl-users mailing list
    To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
   

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: 1.1.1 pre1 tests failing on Solaris SPARC

Viktor Dukhovni
On Tue, Feb 20, 2018 at 01:26:02PM +0000, Salz, Rich via openssl-users wrote:
> Would making buf a union also avoid the problem?
>
> union { unsigned long dummy[2]; char buf[DATA_BUF_SIZE]; } d
> and then replace 'buf' with 'd.buf' in the code?

If alignment of "buf" is the issue, then yes, a suitable union
would be an alternative to using malloc.  We could make the union:

    union {
        unsigned long long dummyl;
        ossl_uintmax_t     dummym;
        char              *dummyp;
        char buf[DATA_BUF_SIZE];
    } d;

just in case that's what it takes for the required alignment.  But,
OPENSSL_malloc() should do the job simply, without such hoop jumping.

Either way, the OP should confirm that aligning "buf" solves the
reported problem.

--
        Viktor.
--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: 1.1.1 pre1 tests failing on Solaris SPARC

Michael Wojcik
In reply to this post by Norm Green
> From: openssl-users [mailto:[hidden email]] On Behalf
> Of Norm Green
> Sent: Monday, February 19, 2018 17:02
> To: Benjamin Kaduk; [hidden email]
> Subject: Re: [openssl-users] 1.1.1 pre1 tests failing on Solaris SPARC
>
> For the failure in secmemtst, it appears that secure memory is not
> enabled per this code in ./crypto/mem_sec.c
>
>   23 /* e_os.h includes unistd.h, which defines _POSIX_VERSION */
>   24 #if !defined(OPENSSL_NO_SECURE_MEMORY) &&
> defined(OPENSSL_SYS_UNIX) \
>   25     && defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L
>   26 # define IMPLEMENTED
>   27 # include <stdlib.h>
>   28 # include <assert.h>
>   29 # include <unistd.h>
>   30 # include <sys/types.h>
>   31 # include <sys/mman.h>
>   32 # if defined(OPENSSL_SYS_LINUX)
>   33 #  include <sys/syscall.h>
>   34 #  include <linux/mman.h>
>   35 #  include <errno.h>
>   36 # endif
>   37 # include <sys/param.h>
>   38 # include <sys/stat.h>
>   39 # include <fcntl.h>
>   40 #endif
>
>
>
> Solaris has this in sys/unistd.h
>
> #ifndef _POSIX_VERSION
> #ifdef  _XPG6
> #define _POSIX_VERSION          200112L /* Supports IEEE Std 1003.1-2001 */
> #else
> #define _POSIX_VERSION          199506L /* Supports POSIX-1c DIS */
> #endif
> #endif /* _POSIX_VERSION */
>
> I'm building with the native Oracle Solaris compiler which apparently
> does not define these macros.

Not by default. The comments in /usr/include/sys/feature_tests.h (on a Solaris system) explain this in excruciating detail, but in short you need either -DPOSIX_C_SOURCE=200112L or -D_XOPEN_SOURCE=600 (or the equivalent in the code) to compile with XPG6 (aka IEEE 1003.1-2001).

Solaris has always (well, since Solaris 2) been a bit cautious about making new standards the default, preferring backward compatibility as the default and requiring applications that want new features to set the appropriate feature macros. In this case, that's one of the two macros I listed above.

One of them should probably be added to the appropriate entries in Configure. I don't think it much matters which one; they ought to have the same effect, and neither is particularly clear to people who haven't had to dig into this stuff.

Disclaimer: I haven't tested this (in the OpenSSL case), just confirmed what feature_tests.h says.

--
Michael Wojcik
Distinguished Engineer, Micro Focus
--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: 1.1.1 pre1 tests failing on Solaris SPARC

Norm Green
In reply to this post by Viktor Dukhovni
Hi Viktor,

Your patch tests clean, however there is an easier way which avoids malloc:

Norm


Index: test/asn1_encode_test.c
===================================================================
--- test/asn1_encode_test.c     (revision 43654)
+++ test/asn1_encode_test.c     (working copy)
@@ -706,15 +706,16 @@
      return ret;
  }

  static int do_print_item(const TEST_PACKAGE *package)
  {
  #define DATA_BUF_SIZE 256
-    unsigned char buf[DATA_BUF_SIZE];
+    uint64_t _buf[DATA_BUF_SIZE / sizeof(uint64_t)];/* force 8-byte
alignment */
+    unsigned char *buf = (unsigned char *) _buf;
      const ASN1_ITEM *i = ASN1_ITEM_ptr(package->asn1_type);
-    ASN1_VALUE *o = (ASN1_VALUE *)&buf;
+    ASN1_VALUE *o = (ASN1_VALUE *)buf;
      int ret;

OPENSSL_assert(package->encode_expectations_elem_size <= DATA_BUF_SIZE);

      (void)RAND_bytes(buf, (int)package->encode_expectations_elem_size);
      ret = ASN1_item_print(bio_err, o, 0, i, NULL);




On 2/19/2018 9:00 PM, Viktor Dukhovni wrote:

> On Mon, Feb 19, 2018 at 01:45:26PM -0800, Norm Green wrote:
>
>> # ASN1_LONG_DATA:
>> #   success: TRUE
>> t@1 (l@1) signal BUS (invalid address alignment) in asn1_item_print_ctx at
>> line 155 in file "tasn_prn.c"
>>    155          || (it->utype != V_ASN1_BOOLEAN)) && *fld == NULL) {
> Perhaps aligning the item buffer (by using malloc) will help, does
> the patch below address the problem?
>
> diff --git a/test/asn1_encode_test.c b/test/asn1_encode_test.c
> index e9f459ad65..77fa9b5954 100644
> --- a/test/asn1_encode_test.c
> +++ b/test/asn1_encode_test.c
> @@ -709,15 +709,19 @@ static int do_encode_custom(EXPECTED *input,
>   static int do_print_item(const TEST_PACKAGE *package)
>   {
>   #define DATA_BUF_SIZE 256
> -    unsigned char buf[DATA_BUF_SIZE];
>       const ASN1_ITEM *i = ASN1_ITEM_ptr(package->asn1_type);
> -    ASN1_VALUE *o = (ASN1_VALUE *)&buf;
> +    ASN1_VALUE *o = OPENSSL_malloc(DATA_BUF_SIZE);
>       int ret;
>  
>       OPENSSL_assert(package->encode_expectations_elem_size <= DATA_BUF_SIZE);
>  
> -    (void)RAND_bytes(buf, (int)package->encode_expectations_elem_size);
> +    if (o == NULL)
> +        return 0;
> +
> +    (void)RAND_bytes((unsigned char *)o,
> +                     (int)package->encode_expectations_elem_size);
>       ret = ASN1_item_print(bio_err, o, 0, i, NULL);
> +    OPENSSL_free(o);
>  
>       return ret;
>   }
>

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: 1.1.1 pre1 tests failing on Solaris SPARC

Norm Green
In reply to this post by Michael Wojcik
On 2/20/2018 5:43 AM, Michael Wojcik wrote:
> Not by default. The comments in /usr/include/sys/feature_tests.h (on a Solaris system) explain this in excruciating detail, but in short you need either -DPOSIX_C_SOURCE=200112L or -D_XOPEN_SOURCE=600 (or the equivalent in the code) to compile with XPG6 (aka IEEE 1003.1-2001).
Thanks for the suggestions Michael.  Neither resolves the problem. In
fact, adding -D_XOPEN_SOURCE=600 causes a new problem:

/opt/solarisstudio12.3/bin/c99  -I. -Icrypto/include -Iinclude -m64
-xtarget=ultra2 -D_XOPEN_SOURCE=600 -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W
-KPIC -xildoff -mt -xcode=pic32 -g -DDSO_DLFCN -DHAVE_DLFCN_H
-DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ
-DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM
-DSHA512_ASM -DMD5_ASM -DAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM
-DPOLY1305_ASM -DFILIO_H -DB_ENDIAN -DBN_DIV2W -D_REENTRANT
-DOPENSSLDIR="\"/hamburg4/users/normg/gs64trunk/slow10/openssl_1.1/install10/ssl\""
-DENGINESDIR="\"/hamburg4/users/normg/gs64trunk/slow10/openssl_1.1/install10/lib/engines-1.1\""
-c -o crypto/bio/b_addr.o crypto/bio/b_addr.c
"crypto/bio/b_addr.c", line 198: undefined symbol: NI_MAXHOST
"crypto/bio/b_addr.c", line 198: variable length array can not be
initialized: host
"crypto/bio/b_addr.c", line 198: undefined symbol: NI_MAXSERV
"crypto/bio/b_addr.c", line 198: variable length array can not be
initialized: serv
c99: acomp failed for crypto/bio/b_addr.c
Makefile:881: recipe for target 'crypto/bio/b_addr.o' failed


I also tried building with c99 instead of cc, without success.

Norm

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: 1.1.1 pre1 tests failing on Solaris SPARC

Dennis Clarke-2
On 20/02/18 12:47 PM, Norm Green wrote:

> On 2/20/2018 5:43 AM, Michael Wojcik wrote:
>> Not by default. The comments in /usr/include/sys/feature_tests.h (on a
>> Solaris system) explain this in excruciating detail, but in short you
>> need either -DPOSIX_C_SOURCE=200112L or -D_XOPEN_SOURCE=600 (or the
>> equivalent in the code) to compile with XPG6 (aka IEEE 1003.1-2001).
> Thanks for the suggestions Michael.  Neither resolves the problem. In
> fact, adding -D_XOPEN_SOURCE=600 causes a new problem:
>
> /opt/solarisstudio12.3/bin/c99  -I. -Icrypto/include -Iinclude -m64
> -xtarget=ultra2 -D_XOPEN_SOURCE=600 -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W
> -KPIC -xildoff -mt -xcode=pic32 -g -DDSO_DLFCN -DHAVE_DLFCN_H
> -DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ
> -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM
> -DSHA512_ASM -DMD5_ASM -DAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM
> -DPOLY1305_ASM -DFILIO_H -DB_ENDIAN -DBN_DIV2W -D_REENTRANT
> -DOPENSSLDIR="\"/hamburg4/users/normg/gs64trunk/slow10/openssl_1.1/install10/ssl\""
> -DENGINESDIR="\"/hamburg4/users/normg/gs64trunk/slow10/openssl_1.1/install10/lib/engines-1.1\""
> -c -o crypto/bio/b_addr.o crypto/bio/b_addr.c
> "crypto/bio/b_addr.c", line 198: undefined symbol: NI_MAXHOST
> "crypto/bio/b_addr.c", line 198: variable length array can not be
> initialized: host
> "crypto/bio/b_addr.c", line 198: undefined symbol: NI_MAXSERV
> "crypto/bio/b_addr.c", line 198: variable length array can not be
> initialized: serv
> c99: acomp failed for crypto/bio/b_addr.c
> Makefile:881: recipe for target 'crypto/bio/b_addr.o' failed
>
>
> I also tried building with c99 instead of cc, without success.
>


Is there a handy source tarball somewhere so that I may also have a
look at this?  I have had good success in the past with both c99 and
with fairly restrictive CFLAGS so I would like to look into this
also.

Dennis



--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: 1.1.1 pre1 tests failing on Solaris SPARC

Norm Green
Just download and build v1.1.1 pre alpha 1 on Solaris.  It's on
ftp.openssl.org.  That's all I did.  Configure using
solaris64-sparcv9-cc .  I'm using Solaris studio 12.3.

Norm


On 2/20/2018 10:01 AM, Dennis Clarke wrote:

> On 20/02/18 12:47 PM, Norm Green wrote:
>> On 2/20/2018 5:43 AM, Michael Wojcik wrote:
>>> Not by default. The comments in /usr/include/sys/feature_tests.h (on
>>> a Solaris system) explain this in excruciating detail, but in short
>>> you need either -DPOSIX_C_SOURCE=200112L or -D_XOPEN_SOURCE=600 (or
>>> the equivalent in the code) to compile with XPG6 (aka IEEE
>>> 1003.1-2001).
>> Thanks for the suggestions Michael.  Neither resolves the problem. In
>> fact, adding -D_XOPEN_SOURCE=600 causes a new problem:
>>
>> /opt/solarisstudio12.3/bin/c99  -I. -Icrypto/include -Iinclude -m64
>> -xtarget=ultra2 -D_XOPEN_SOURCE=600 -xstrconst -Xa -DB_ENDIAN
>> -DBN_DIV2W -KPIC -xildoff -mt -xcode=pic32 -g -DDSO_DLFCN
>> -DHAVE_DLFCN_H -DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC
>> -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m
>> -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DGHASH_ASM
>> -DECP_NISTZ256_ASM -DPOLY1305_ASM -DFILIO_H -DB_ENDIAN -DBN_DIV2W
>> -D_REENTRANT
>> -DOPENSSLDIR="\"/hamburg4/users/normg/gs64trunk/slow10/openssl_1.1/install10/ssl\""
>> -DENGINESDIR="\"/hamburg4/users/normg/gs64trunk/slow10/openssl_1.1/install10/lib/engines-1.1\""
>> -c -o crypto/bio/b_addr.o crypto/bio/b_addr.c
>> "crypto/bio/b_addr.c", line 198: undefined symbol: NI_MAXHOST
>> "crypto/bio/b_addr.c", line 198: variable length array can not be
>> initialized: host
>> "crypto/bio/b_addr.c", line 198: undefined symbol: NI_MAXSERV
>> "crypto/bio/b_addr.c", line 198: variable length array can not be
>> initialized: serv
>> c99: acomp failed for crypto/bio/b_addr.c
>> Makefile:881: recipe for target 'crypto/bio/b_addr.o' failed
>>
>>
>> I also tried building with c99 instead of cc, without success.
>>
>
>
> Is there a handy source tarball somewhere so that I may also have a
> look at this?  I have had good success in the past with both c99 and
> with fairly restrictive CFLAGS so I would like to look into this
> also.
>
> Dennis
>
>
>

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: 1.1.1 pre1 tests failing on Solaris SPARC

Dennis Clarke-2
On 20/02/18 01:11 PM, Norm Green wrote:
> Just download and build v1.1.1 pre alpha 1 on Solaris.  It's on
> ftp.openssl.org.  That's all I did.  Configure using
> solaris64-sparcv9-cc .  I'm using Solaris studio 12.3.

Did you modify the Configure file ?  Last time I looked the CFLAGS
as well as some other bits in there were terribly out of date and
not really what we want for a debug build.

Dennis

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: 1.1.1 pre1 tests failing on Solaris SPARC

Dennis Clarke-2
In reply to this post by Norm Green
On 20/02/18 01:11 PM, Norm Green wrote:
> Just download and build v1.1.1 pre alpha 1 on Solaris.  It's on
> ftp.openssl.org.  That's all I did.  Configure using
> solaris64-sparcv9-cc .  I'm using Solaris studio 12.3.

Let's have a look.


corv $ uname -a
SunOS corv 5.10 Generic_150400-59 sun4u sparc SUNW,SPARC-Enterprise

corv $ /opt/developerstudio12.6/bin/c99 -V
c99: Studio 12.6 Sun C 5.15 SunOS_sparc 2017/05/30

corv $ psrinfo -pv
The physical processor has 8 virtual processors (0-7)
   SPARC64-VII+ (portid 1024 impl 0x7 ver 0xa1 clock 2860 MHz)

corv $ pwd
/usr/local/src
corv $ cd ../build
corv $ gzip -dc ../src/openssl-1.1.1-pre1.tar.gz | tar -xf -
corv $ mv openssl-1.1.1-pre1 openssl-1.1.1-pre1_SunOS5.10_sparcv9.001
corv $ cd openssl-1.1.1-pre1_SunOS5.10_sparcv9.001
corv $ cp -p Configure Configure.backup
corv $ OPENSSL_SOURCE=`pwd`
corv $ export OPENSSL_SOURCE
corv $ echo $OPENSSL_SOURCE
/usr/local/build/openssl-1.1.1-pre1_SunOS5.10_sparcv9.001

OKay .. whats going on here ?

corv $ grep -i "sparc" Configure

Doesn't exist ... has to have been moved somewhere.

These two files make reference to solaris64 in some way :

./Configurations/10-main.conf
./config




Interesting comment :


#### Solaris x86 with Sun C setups
     # There used to be solaris-x86-cc target, but it was removed,
     # primarily because vendor assembler can't assemble our modules
     # with -KPIC flag. As result it, assembly support, was not even
     # available as option. But its lack means lack of side-channel
     # resistant code, which is incompatible with security by todays
     # standards. Fortunately gcc is readily available prepackaged
     # option, which we can firmly point at...
     #
     # On related note, solaris64-x86_64-cc target won't compile code
     # paths utilizing AVX and post-Haswell instruction extensions.
     # Consider switching to solaris64-x86_64-gcc even here...
     #


Pre-packaged? Really ... let's not go down the route of argument today.


     "solaris64-sparcv9-cc" => {
         inherit_from     => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
         cflags           => add_before("-xarch=v9"),
         bn_ops           => "BN_LLONG RC4_CHAR",
         multilib         => "/64",
     },


Actually xarch=v9 is wrong.  Should just say "sparc".

Well it looks like lots has changed ... so let me fish around in here
and find what is going on with Configure and its new sub-files and then
see if I can get a compile going as a debug build. Also I have gcc 7.2.0
here but there isn't any such thing as "pre-packaged".

Dennis








--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: 1.1.1 pre1 tests failing on Solaris SPARC

Norm Green
In reply to this post by Dennis Clarke-2
Hi Dennis,

You're right, I did modify the config file, sorry.  I did it so long ago
I had forgotten.  I will email it to you shortly.

Norm


On 2/20/2018 10:14 AM, Dennis Clarke wrote:

> On 20/02/18 01:11 PM, Norm Green wrote:
>> Just download and build v1.1.1 pre alpha 1 on Solaris.  It's on
>> ftp.openssl.org.  That's all I did. Configure using
>> solaris64-sparcv9-cc .  I'm using Solaris studio 12.3.
>
> Did you modify the Configure file ?  Last time I looked the CFLAGS
> as well as some other bits in there were terribly out of date and
> not really what we want for a debug build.
>
> Dennis
>

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: 1.1.1 pre1 tests failing on Solaris SPARC

Dennis Clarke-2
On 20/02/18 01:36 PM, Norm Green wrote:
> Hi Dennis,
>
> You're right, I did modify the config file, sorry.  I did it so long ago
> I had forgotten.  I will email it to you shortly.
>

Not a problem .. everyone does.

I mean look at this mess if you don't :


corv $ ./Configure shared zlib threads solaris64-sparcv9-cc
Perl v5.10.0 required--this is only v5.8.4, stopped at ./Configure line 12.
BEGIN failed--compilation aborted at ./Configure line 12.
corv $

uh huh.

I have newer perl I built myself but I generally start with the baseline
  system stuff .. which is covered in dust and mold :

corv $ /usr/local/bin/perl -V
Summary of my perl5 (revision 5 version 26 subversion 0) configuration:
.
.
.


So ... this will be fun.

Dennis
--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: 1.1.1 pre1 tests failing on Solaris SPARC

OpenSSL - User mailing list
 
>     So ... this will be fun.
   
:)

Thanks for poking at this, folks.  Please take a look at the INSTALL and README files which do cover some of this prerequisites.  And then once you've "fixed" it, let us  know what we need to change!!

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: 1.1.1 pre1 tests failing on Solaris SPARC

Dennis Clarke-2
In reply to this post by Dennis Clarke-2
On 20/02/18 01:50 PM, Dennis Clarke wrote:
> On 20/02/18 01:36 PM, Norm Green wrote:

Making progress here ...

/opt/developerstudio12.6/bin/c99  -I. -Icrypto/include -Iinclude
-errfmt=error -erroff=%none -errshort=full -xstrconst -xildoff -m64
-xmemalign=8s -xnolibmil -Xc -xcode=pic32 -xregs=no%appl -xlibmieee -mc
-ftrap=%none -Qy -xs -g -xbuiltin=%none -xdebugformat=dwarf -xunroll=1
-D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -KPIC
-DDSO_DLFCN -DHAVE_DLFCN_H -DZLIB -DNDEBUG -DOPENSSL_NO_STATIC_ENGINE
-DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT
-DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM
-DAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM
-I/usr/local/include -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE
-D_TS_ERRNO -DOPENSSLDIR="\"/usr/local/ssl\""
-DENGINESDIR="\"/usr/local/lib/engines-1.1\""  -c -o
crypto/bio/bss_bio.o crypto/bio/bss_bio.c
"crypto/bio/bss_bio.c", line 244: error: undefined symbol: OSSL_SSIZE_MAX
"crypto/bio/bss_bio.c", line 400: error: undefined symbol: OSSL_SSIZE_MAX
c99: acomp failed for crypto/bio/bss_bio.c
gmake[1]: *** [Makefile:1781: crypto/bio/bss_bio.o] Error 2
gmake[1]: Leaving directory
'/usr/local/build/openssl-1.1.1-pre1_SunOS5.10_sparcv9.001'
gmake: *** [Makefile:143: all] Error 2
corv $

let me track down that undef there


dc
--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
123