From owner-freebsd-stable@FreeBSD.ORG Tue Jul 9 18:08:35 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B0FB9159 for ; Tue, 9 Jul 2013 18:08:35 +0000 (UTC) (envelope-from freebsd-stable@m.gmane.org) Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) by mx1.freebsd.org (Postfix) with ESMTP id 7076C1144 for ; Tue, 9 Jul 2013 18:08:35 +0000 (UTC) Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UwcKy-00016X-GY for freebsd-stable@freebsd.org; Tue, 09 Jul 2013 20:08:28 +0200 Received: from p5482be42.dip0.t-ipconnect.de ([84.130.190.66]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 09 Jul 2013 20:08:28 +0200 Received: from sperber by p5482be42.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 09 Jul 2013 20:08:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-stable@freebsd.org From: Michael Sperber Subject: Weird regex behavior on 9.1-RELEASE on amd64 in 32-bit mode Date: Tue, 09 Jul 2013 20:08:22 +0200 Lines: 40 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5482be42.dip0.t-ipconnect.de User-Agent: Gnus/5.110011 (No Gnus v0.11) XEmacs/21.5-b33 (darwin) Cancel-Lock: sha1:Qeq/Eb1PzJ2ISUC47HD2qC5IIo0= X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jul 2013 18:08:35 -0000 I noticed that scsh (which only runs in 32-bit mode) fails on amd64. I narrowed it down to a regex malfunction (I think). This program: ----snip---- #include #include int main(void) { regex_t r; int status = regcomp(&r, "/afs", REG_EXTENDED); size_t nmatch = 1 + r.re_nsub; regmatch_t pmatch[32]; status = regexec(&r, "/afs/informatik", nmatch, pmatch, 0); { int i; for(i = 0; i < nmatch; i--) { printf("%d: %d - %d\n", i, (int) pmatch[i].rm_so, (int) pmatch[i].rm_eo); } } return 0; } ----snip---- This giveds me: # gcc r.c # ./a.out 0: 0 - 4 # gcc -m32 r.c # ./a.out 0: 0 - 0 Is it me or is there a bug? Help would be much appreciated! -- Regards, Mike