bugmake - Bugs: bug #14684, make fails if LC_CTYPE is...

 
 

bug #14684: make fails if LC_CTYPE is iso_8859_1

Submitter:  None
Submitted:  Sun 02 Oct 2005 10:24:19 AM UTC
Votes: 100
 
Severity:  3 - Normal Item Group:  Bug
Status:  Not A Bug Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  3.80 Operating System:  POSIX-Based
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 14 Jun 2009 02:36:19 AM UTC, comment #12: 

I'm closing this as "not a bug".  Hopefully the Solaris folks have resolved this issue.

Paul D. Smith <psmith>
Group administrator
Tue 04 Apr 2006 11:59:16 AM UTC, comment #11: 

This is pretty clearly a bug in Solaris; the POSIX spec says:

  blank
      Define characters to be classified as <blank>s.
                                                                               
      In the POSIX locale, only the <space> and <tab> shall be included.

      In a locale definition file, the <space> and <tab> are automatically included in this class.

Thanks for reporting it to Sun.

As for checking this in configure, the problem is that I can't think of any way to do that without running a program to test it, and we can't run programs during configure as it breaks cross-compilation environments...

Paul D. Smith <psmith>
Group administrator
Tue 04 Apr 2006 06:04:25 AM UTC, comment #10: 

Yes. I tracked the problem down to the locale definition file for iso_8859_1, in which the character class blank is defined as:

    blank        <space>;<no-break-space>

Of the non-unicode locales, iso_8859_1 seems to be the only one broken in this respect (I haven't checked the unicode locales). I have filed a bug report with Sun for this issue.

David Byers <ringflinger>
Mon 03 Apr 2006 09:56:09 PM UTC, comment #9: 

Aha!  That macro, isblank(), is actually defined by GNU make to be something very simple which will obviously always match '\t'.  Except when it isn't defined by GNU make, and it isn't defined by GNU make when the system already defines it!

It looks like for Solaris 10 they introduced an implementation of isblank() into the standard header files, which didn't used to be there (it's not on my Solaris 8 system for example).  That implementation apparently treats TAB characters differently under different locales and under iso_8859_1 at least, on that system, TAB is not considered a "blank".

Paul D. Smith <psmith>
Group administrator
Mon 03 Apr 2006 12:58:42 PM UTC, comment #8: 

On Solaris 10, with LC_CTYPE set to iso_8859_1, isblank returns zero for isblank('\t'), which (at least for me) causes the problem described in the original report.

The following program demonstrates the issue:

#include <stdio.h>
#include <ctype.h>
#include <locale.h>

int main(int argc,char** argv) {
  setlocale(LC_ALL,"");
  printf("isblank=%d\n", isblank('\t'));
}

This behavior seems to be consistent, and it seems to be a bug in Solaris rather than in make. I wonder, though, if make should maybe check for a working isblank in the configure script?

David Byers <ringflinger>
Tue 13 Dec 2005 03:02:12 AM UTC, comment #7: 

Hm.  I can't find any system that reproduces this problem.  I'm concerned that it's a bug in Solaris 10.  This being the case I'll need you to debug this for me.  First, please get a copy of make 3.81beta4 (available later tonight on ftp://alpha.gnu.org/gnu/make/).  Next, please build GNU make with debugging and without optimization.  Next, please test it using the makefile you've attached to this bug report, and not another one.

Finally, please break at the beginning of the for loop in construct_command_argv_internal() (the one that contains the assert) and single-step ("s" in GDB) until the assertion fails.  You can either attach the log to his bug or email it to me directly (don't past it into a command as the formatting will get all messed up).  It would be good if you could print the value of interesting variables (p and ap for example) as you go.

Paul D. Smith <psmith>
Group administrator
Wed 09 Nov 2005 10:44:37 PM UTC, comment #6: 

The Makefile is simplistic (attached).

Fazal Majid <majid>
Wed 09 Nov 2005 10:21:37 PM UTC, comment #5: 

Thanks for the detailed reports!

But, what I really, really need is for you to attach a sample makefile (as small and simple as you can get it) that shows this problem when it's used with GNU make, so I can examine it in comparison to the traceback logs that you've provided.

Thanks!

Paul D. Smith <psmith>
Group administrator
Wed 09 Nov 2005 10:16:36 PM UTC, comment #4: 

And here it is when LC_CTYPE=C

shimeh ~/src/bug>setenv LC_CTYPE C
shimeh ~/src/bug>gdb ../make-3.81beta3/make
GNU gdb 6.2.1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-pc-solaris2.10"...
(gdb) b construct_command_argv_internal
Breakpoint 1 at 0x805cd5d: file job.c, line 2284.
(gdb) r clean hello
Starting program: /home/majid/src/make-3.81beta3/make clean hello

Breakpoint 1, construct_command_argv_internal (line=0x80904bc "°,\t\b", restp=0x8089450, shell=0x8090bf8 "/bin/sh", ifs=0x8089450 "(x\b\b(x\b\b", batch_filename_ptr=0x8092edc) at job.c:2284
2284      if (restp != NULL)
(gdb) c
Continuing.

Breakpoint 1, construct_command_argv_internal (line=0xfeef14e0 "\203Ä\004\213F \205Àt,Ç@\b", restp=0x8046308, shell=0x0, ifs=0x8046300 "Gc\004\b c\004\b¸c\004\bg?\005\b", batch_filename_ptr=0x0) at job.c:2284
2284      if (restp != NULL)
(gdb) c
Continuing.
rm -f hello hello.o *~

Breakpoint 1, construct_command_argv_internal (line=0xfeef1828 "\203Ä\004Ç\006", restp=0x808d588, shell=0x8094110 "/bin/sh", ifs=0x808d588 "`\226\b\b`\226\b\b", batch_filename_ptr=0x80940fc) at job.c:2284
2284      if (restp != NULL)
(gdb) c
Continuing.
gcc    -c -o hello.o hello.c

Breakpoint 1, construct_command_argv_internal (line=0x8090afc "ð\\\t\b", restp=0x80894a8, shell=0x8090c28 "/bin/sh", ifs=0x80894a8 "Hx\b\bHx\b\b", batch_filename_ptr=0x8090c14) at job.c:2284
2284      if (restp != NULL)
(gdb) c
Continuing.
gcc -o hello hello.o -lc

Program exited normally.
(gdb)

Fazal Majid <majid>
Wed 09 Nov 2005 10:16:04 PM UTC, comment #3: 

The problem is in construct_command_argv_internal. Here is the result of running it with LC_CTYPE=iso_8859_1

shimeh ~/src/bug>gdb ../make-3.81beta3/make
GNU gdb 6.2.1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-pc-solaris2.10"...
(gdb) b construct_command_argv_internal
Breakpoint 1 at 0x805cd5d: file job.c, line 2284.
(gdb) r clean hello
Starting program: /home/majid/src/make-3.81beta3/make clean hello

Breakpoint 1, construct_command_argv_internal (line=0x809061c "P.\t\b", restp=0x80895d0, shell=0x8090d58 "/bin/sh", ifs=0x80895d0 "\230y\b\b\230y\b\b", batch_filename_ptr=0x809303c) at job.c:2284
2284      if (restp != NULL)
(gdb) c
Continuing.
Assertion failed: ap <= end, file job.c, line 2366

Program received signal SIGABRT, Aborted.
0xfef4df57 in _lwp_kill () from /usr/lib/libc.so.1

Fazal Majid <majid>
Wed 09 Nov 2005 10:02:27 PM UTC, comment #2: 

I reproduce this with 3.81beta3 on Solaris 10/x64, even when make is configured with --disable-nls

The problem seems to be specifically with LC_CTYPE=iso_8859_1:

shimeh ~/src/bug>ls
Makefile   hello*     hello.c    hello.o
shimeh ~/src/bug>../make-3.81beta3/make clean
Assertion failed: ap <= end, file job.c, line 2366
Abort
shimeh ~/src/bug>echo $LC_CTYPE
iso_8859_1
shimeh ~/src/bug>setenv LC_CTYPE doijdofigfd
shimeh ~/src/bug>../make-3.81beta3/make clean
rm -f hello hello.o *~
couldn't set locale correctly
couldn't set locale correctly
shimeh ~/src/bug>cat Makefile
CC=gcc
hello: hello.o
        $(CC) -o hello hello.o -lc
clean:
        -rm -f hello hello.o *~

Anonymous
Wed 12 Oct 2005 03:51:08 PM UTC, comment #1: 

I wasn't able to reproduce this myself.
Can you please attach a SMALL, simple makefile that shows the error?

Paul D. Smith <psmith>
Group administrator
Sun 02 Oct 2005 10:24:19 AM UTC, original submission:  

I'm running Solaris 10 x86 with the following locate settings:
LANG=
LC_CTYPE=iso_8859_1
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=

If I run GNU make, it exits and I either get
'gmake: * No rule to make target `             base', needed by `all'.  Stop.

The word base is preceeded by two \t, not spaces.

Sometimes I only get
Abort


Now, if I set LC_CTYPE to C, GNU makes runs without any errors.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #2710:  Makefile added by majid (82B - application/octet-stream - Makefile)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  •  

    There are 100 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-06-14 psmith StatusNone Not A Bug
        Open/ClosedOpen Closed
    2006-04-03 ringflinger Carbon-Copy- Added -email is unavailable-
    2005-11-09 majid Attached File- Added Makefile, #3094
    2005-11-09 psmith Carbon-Copy- Added majid

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code