[Bug c/43556] New: Ubuntu : segmentation fault in strchr() obtained with gcc4.4.3 and not with gcc4.4.1

eric dot cabret at gmail dot com gcc-bugzilla@gcc.gnu.org
Sun Mar 28 17:09:00 GMT 2010


My system is Ubuntu 64 bits Lucid Lynx.
with this following small program, I obtain a crazy segmentation fault in
strchr() with gcc4.4.3-4ubuntu5 AND NOT with gcc4.4.1-4ubuntu9 (with same glibc
in both case) :

// gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3 -> execution gives a "segmentation fault"
// gcc (Ubuntu 4.4.1-4ubuntu9) 4.4.1 -> execution is fully OK
#include <stdio.h>
#include <string.h>

char t[]="It: is a gcc4.4.3 bug";

main() {
char *p;

puts(t);
p = strchr(t, ':');
printf("p='%s'\n", p);

return 0;
}

Many best regards.
Eric.


-- 
           Summary: Ubuntu : segmentation fault in strchr() obtained with
                    gcc4.4.3 and not with gcc4.4.1
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: eric dot cabret at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43556



More information about the Gcc-bugs mailing list