pdahorek / seznam.cz wrote:
> https://bugs.ruby-lang.org/issues/15091
> ```
> https://www.oracle.com/technetwork/server-storage/solaris11/downloads/index.html

Weird, I'm not familiar with Solaris versions, but it seems our
CI machines are not affected

http://rubyci.s3.amazonaws.com/unstable11x/ruby-trunk/log/20180908T202406Z.log.html.gz
http://rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20180908T202505Z.log.html.gz

> ./template/encdb.h.tmpl:36: [BUG] Segmentation fault at 0x00000000403264b0
> ruby 2.6.0dev (2018-09-08) [x86_64-solaris2.11]
> 
> -- Control frame information -----------------------------------------------
> c:0011 p:---- s:0066 e:000065 CFUNC  :sort_by
> c:0010 p:0034 s:0062 e:000061 BLOCK  ./template/encdb.h.tmpl:36 [FINISH]
> c:0009 p:---- s:0058 e:000057 CFUNC  :each

Likely culprit is qsort_s being detected on your system (but not our CI machines):

> checking for qsort_r... no
> checking for qsort_s... yes

Leading to this:

> compiling util.c
> util.c: In function ?ruby_qsort?:
> util.c:200:24: warning: passing argument 4 of ?qsort_s? from incompatible pointer type [-Wincompatible-pointer-types]
>  # define cmp_bsd_qsort cmp_ms_qsort
>                         ^
> util.c:199:70: note: in definition of macro ?qsort_r?
>  # define qsort_r(base, nel, size, arg, cmp) qsort_s(base, nel, size, cmp, arg)
>                                                                       ^~~
> util.c:224:37: note: in expansion of macro ?cmp_bsd_qsort?
>      qsort_r(base, nel, size, &args, cmp_bsd_qsort);
>                                      ^~~~~~~~~~~~~
> In file included from /usr/include/stdlib.h:12:0,
>                  from ./include/ruby/defines.h:121,
>                  from ./include/ruby/ruby.h:29,
>                  from ./include/ruby.h:33,
>                  from internal.h:15,
>                  from util.c:16:
> /usr/include/iso/stdlib_iso.h:147:16: note: expected ?int (*)(const void *, const void *, void *)? but argument is of type ?int (*)(void *, const void *, const void *)?
>  extern errno_t qsort_s(void *, rsize_t, rsize_t,
>                 ^~~~~~~
> util.c: At top level:
> cc1: warning: unrecognized command line option ?-Wno-cast-function-type?
> cc1: warning: unrecognized command line option ?-Wno-self-assign?
> cc1: warning: unrecognized command line option ?-Wno-constant-logical-operand?
> cc1: warning: unrecognized command line option ?-Wno-parentheses-equality?

So, yes, it would crash if function signatures are wrong.
Somebody with access to Solaris should be able to fix this
easily.

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>