[Bug 208027] misc/mc: 4.8.16 has undefined havior in its code and gcc generates "ud2a" instruction to produce SIGILL in 9.x

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Mar 15 15:31:10 UTC 2016


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

            Bug ID: 208027
           Summary: misc/mc: 4.8.16 has undefined havior in its code and
                    gcc generates "ud2a" instruction to produce SIGILL in
                    9.x
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: freebsd-ports-bugs at FreeBSD.org
          Reporter: eugen at grosbein.net
                CC: woodsb02 at gmail.com
             Flags: maintainer-feedback?(woodsb02 at gmail.com)
                CC: woodsb02 at gmail.com

Created attachment 168240
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=168240&action=edit
fix undefined behavior

While building mc-4.8.16 under FreeBSD 9.x using system gcc 4.2.1,
one obtains a warning:

interface.c: In function 'mc_open':
interface.c:203: warning: 'mode_t' is promoted to 'int' when passed through
'...'
interface.c:203: warning: (so you should pass 'int' not 'mode_t' to 'va_arg')
interface.c:203: note: if this code is reached, the program will abort
interface.c:203: warning: will never be executed

gcc generates instruction "ud2a" for the code and mc crashes with SIGILL when
it calls mc_open() function to create a file, e.g. while copying a file to
another directory or saving a file in the mcedit.

A patch is attached.

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


More information about the freebsd-ports-bugs mailing list