bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

regex.c value out of range on Solaris compiler


From: Gavin Smith
Subject: regex.c value out of range on Solaris compiler
Date: Fri, 14 Apr 2017 22:27:45 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

Hello,

When I try to compile a program using the 'regex' module on Solaris 10, 
I get the output

/opt/solarisstudio12.3/bin/c99 -Xc -D_XPG6 -DHAVE_CONFIG_H -I. -I../..   
-D_REENTRANT  -I/opt/csw/include -c -o regex.o regex.c
"regex_internal.h", line 105: warning: macro redefined: gettext
"regex_internal.h", line 734: warning: token-less macro argument
Assembler: "/tmp/yabeAAAiUaidC", line 19010 : Value out of range
        "/tmp/yabeAAAiUaidC", line 19031 : Value out of range
        Failure in /opt/solarisstudio12.3/prod/bin/fbe, status = 0x7f00
        Fatal Error exec'ing /opt/solarisstudio12.3/prod/bin/fbe
        c99: acomp failed for regex.c

The warnings about macros are harmless, but the "Value out of range" 
errors are fatal.

I re-ran with the -S option to get assembler output:

/opt/solarisstudio12.3/bin/c99 -Xc -D_XPG6 -DHAVE_CONFIG_H -I. -I../..   
-D_REENTRANT  -I/opt/csw/include -c -o regex.o regex.c -S

Then if I try to compile the regex.o file:

mv regex.o regex.S
/opt/solarisstudio12.3/bin/c99 -Xc -D_XPG6 -DHAVE_CONFIG_H -I.  -I../..   
-D_REENTRANT  -I/opt/csw/include -c -o regex.o regex.S
Assembler: "regex.S", line 21273 : Value out of range
        "regex.S", line 21294 : Value out of range
        c99: fbe failed for regex.S

Line 21273 is
        subl    $4294967296,%eax

Line 21294 is
        subl    $4294967296,%eax

I think the error is that these constants are too large. 4,294,967,296
is 2 ** 32 which is too big a value to fit in 32 bits.

When I try again with the Gnulib from 2016-12-15, this file compiles OK, 
but when I apply the patch from

http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00666.html

the problem occurs. I believe that the faulty code is coming from the 
use of INT_ADD_WRAPV from intprops.h. I haven't investigated how exactly 
this macro leads to the faulty code. Hopefully I am on the right track 
here and someone will have an idea of how to fix it. If not, I will have 
to study what this macro does and why it is being used here.

Thanks,
Gavin

PS please keep me CC'd in any responses





reply via email to

[Prev in Thread] Current Thread [Next in Thread]