[Bug 206664] lang/ruby21: miniruby gets bus error on arm that requires alignment (SCTLR bit[1]==1); build fails

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Jan 27 11:43:23 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206664

--- Comment #3 from Mark Millard <markmi at dsl-only.net> ---
Relative to the powerpc64 segmentation faults

I'll note that the powerpc64 clang does report the following sorts of warnings
that means the code involved is dependent on undefined behavior that various
compilers could treat differently:

vm_dump.c:48:13: warning: shifting a negative signed value is undefined
[-Wshift-negative-value]
    switch (VM_FRAME_TYPE(cfp)) {
            ^~~~~~~~~~~~~~~~~~
./vm_core.h:772:43: note: expanded from macro 'VM_FRAME_TYPE'
#define VM_FRAME_TYPE(cfp) ((cfp)->flag & VM_FRAME_MAGIC_MASK)
                                          ^~~~~~~~~~~~~~~~~~~
./vm_core.h:770:36: note: expanded from macro 'VM_FRAME_MAGIC_MASK'
#define VM_FRAME_MAGIC_MASK   (~(~0<<VM_FRAME_MAGIC_MASK_BITS))
                                 ~~^
. . .
parse.y:1360:4: warning: shifting a negative signed value is undefined
[-Wshift-negative-value]
                        nd_set_line((yyval.node), (yyvsp[(2) - (5)].num));
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./node.h:290:43: note: expanded from macro 'nd_set_line'
   
RNODE(n)->flags=((RNODE(n)->flags&~(-1<<NODE_LSHIFT))|(((l)&NODE_LMASK)<<NODE_LSHIFT))
                                        ~~^

(Many messages, just a couple extracted for here.)

There were a few examples of messages like:

re.c:106:11: warning: using the result of an assignment as a condition without
parentheses [-Wparentheses]
    if (y = memmem(ys, n, xs, m))
        ~~^~~~~~~~~~~~~~~~~~~~~~

but this does not get into undefined behavior.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ruby mailing list