Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 21388 invoked from network); 12 Oct 2009 18:42:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Oct 2009 18:42:29 -0000 Received: (qmail 88553 invoked by uid 500); 12 Oct 2009 18:42:29 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 88460 invoked by uid 500); 12 Oct 2009 18:42:28 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 88452 invoked by uid 99); 12 Oct 2009 18:42:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Oct 2009 18:42:28 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,FB_WORD1_END_DOLLAR X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of hyrum_wright@mail.utexas.edu designates 146.6.25.7 as permitted sender) Received: from [146.6.25.7] (HELO ironclad.mail.utexas.edu) (146.6.25.7) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Oct 2009 18:42:24 +0000 DomainKey-Signature: s=main; d=mail.utexas.edu; c=nofws; q=dns; h=X-IronPort-MID:Received:Received:Received:From: Content-Type:Subject:Date:Message-Id:To:Mime-Version: X-Mailer; b=RoQE8mtZE+iyjtv7bXwrH82lSTqH7p3CaAbuZ/Z/Swys1zoHBbgf5nOG CQsVgKFzI8zhdLhPsOLmiJSNG4XoqNvX7ekt9s1CtUof+4TDBrTqy1T89 lPVkHvArmk7pBI19JVHccPoh3zQ+ANmzYfAX5bUENJ/1yzgKccU4a/kYC 8=; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.utexas.edu; i=hyrum_wright@mail.utexas.edu; q=dns/txt; s=main; t=1255372944; x=1286908944; h=from:sender:reply-to:subject:date:message-id:to:cc: mime-version:content-transfer-encoding:content-id: content-description:resent-date:resent-from:resent-sender: resent-to:resent-cc:resent-message-id:in-reply-to: references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; z=From:=20"Hyrum=20K.=20Wright"=20|Subject:=20Segfault=20with=20APR=201.3.9=20on=20Ma c=20OS=20X=2010.6.1|Date:=20Mon,=2012=20Oct=202009=2013:4 2:03=20-0500|Message-Id:=20<6669ADBC-AFB1-47CE-BF71-F6627 5D128F3@mail.utexas.edu>|To:=20dev@apr.apache.org |Mime-Version:=201.0=20(Apple=20Message=20framework=20v10 76); bh=PsmYHcqqPV6bFUVQpKNFIszxJ8TnZLK0GYkVy2wnHCU=; b=l8oZNToH1IT0/mGLWEu1BNix+tDIIKvI0//4qbSqa5soLWK2icOno/pY QwA6RH46VJNEysyjZv50u5ncLltpFYMmyRJ0dXMTqIPBobdZiwQqzhSJQ CHeuMxF+l2A9lEBixVC7FPHzPfmaBu870FCf3uk12Ud61PZBZ7FL2baRT A=; X-IronPort-MID: 1088485132 Received: from wb2-a.mail.utexas.edu ([128.83.126.136]) by ironclad.mail.utexas.edu with SMTP; 12 Oct 2009 13:42:03 -0500 Received: (qmail 29693 invoked from network); 12 Oct 2009 18:42:03 -0000 Received: from 24-155-243-203.dyn.grandenetworks.net (HELO ?192.168.1.103?) (hyrum?wright@24.155.243.203) by wb2.mail.utexas.edu with (RC4-SHA encrypted) ESMTPSA; 12 Oct 2009 18:42:03 -0000 From: "Hyrum K. Wright" Content-Type: multipart/mixed; boundary=Apple-Mail-261-40332997 Subject: Segfault with APR 1.3.9 on Mac OS X 10.6.1 Date: Mon, 12 Oct 2009 13:42:03 -0500 Message-Id: <6669ADBC-AFB1-47CE-BF71-F66275D128F3@mail.utexas.edu> To: dev@apr.apache.org Mime-Version: 1.0 (Apple Message framework v1076) X-Mailer: Apple Mail (2.1076) --Apple-Mail-261-40332997 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252; format=flowed; delsp=yes Hi all. I recently upgraded to APR 1.3.9, and almost all of the Subversion =20 unit tests started failing. Upon further investigation, there is a =20 segfault inside the apr_psprintf() function of APR. I believe this =20 might be related to this the "Better handling of APR_OFF_T_FMT for =20 Darwin 10 depending on -arch setting of compiler" item listed in =20 CHANGES. I'm running Mac OS X 10.6.1, on an early-2008-era MacBook =20 Pro. Please let me know if you need additional about my environment. Using APR 1.3.9, I was able to tickle the bug using the attached 40-=20 line program, giving the following output: [[[ hyrum-wrights-macbook-pro-2:test Hyrum$ gcc -Wall -g -o apr-test apr-=20 test.c -I/opt/local/include/apr-1/ -lapr-1 -L/opt/local/lib hyrum-wrights-macbook-pro-2:test Hyrum$ ./apr-test Running with apr version '1.3.9' Segmentation fault hyrum-wrights-macbook-pro-2:test Hyrum$ gdb ./apr-test GNU gdb 6.3.50-20050815 (Apple version gdb-1344) (Fri Jul 3 01:19:56 =20= UTC 2009) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and =20 you are welcome to change it and/or distribute copies of it under certain =20 conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for =20 details. This GDB was configured as "x86_64-apple-darwin"...Reading symbols for =20= shared libraries ... done (gdb) r Starting program: /Users/Hyrum/dev/test/apr-test Reading symbols for shared libraries ++. done Running with apr version '1.3.9' Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000 0x00007fff8004ec00 in strlen () (gdb) bt #0 0x00007fff8004ec00 in strlen () #1 0x0000000100006594 in apr_vformatter () #2 0x000000010001043c in apr_pvsprintf () #3 0x00000001000106db in apr_psprintf () #4 0x0000000100000e6e in main (argc=3D1, argv=3D0x7fff5fbff8e0) at apr-=20= test.c:31 (gdb) ]]] Running the same program with APR 1.3.8 gives: [[[ hyrum-wrights-macbook-pro-2:test Hyrum$ gcc -Wall -g -o apr-test apr-=20 test.c -I/opt/local/include/apr-1/ -lapr-1 -L/opt/local/lib apr-test.c: In function =91main=92: apr-test.c:33: warning: format =91%ld=92 expects type =91long int=92, = but =20 argument 4 has type =91apr_off_t=92 apr-test.c:33: warning: format =91%ld=92 expects type =91long int=92, = but =20 argument 5 has type =91apr_off_t=92 apr-test.c:33: warning: format =91%ld=92 expects type =91long int=92, = but =20 argument 6 has type =91apr_off_t=92 hyrum-wrights-macbook-pro-2:test Hyrum$ gdb ./apr-testGNU gdb =20 6.3.50-20050815 (Apple version gdb-1344) (Fri Jul 3 01:19:56 UTC 2009) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and =20 you are welcome to change it and/or distribute copies of it under certain =20 conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for =20 details. This GDB was configured as "x86_64-apple-darwin"...Reading symbols for =20= shared libraries ... done (gdb) r Starting program: /Users/Hyrum/dev/test/apr-test Reading symbols for shared libraries ++. done Running with apr version '1.3.8' '42 10 11 12 itsy bitsy spider' Program exited normally. (gdb) ]]] Hopefully this helps fix the problem. Oh, and = http://www.apache.org/dist/apr/CHANGES-APR-1.3=20 hasn't yet been updated to reflect 1.3.9. Cheers, -Hyrum --Apple-Mail-261-40332997 Content-Disposition: attachment; filename=apr-test.c Content-Type: application/octet-stream; name="apr-test.c" Content-Transfer-Encoding: 7bit #include #include #include #include #include int main(int argc, char *argv[]) { long int x = 42; const char *foo; apr_off_t bar = 10; apr_off_t baz = 11; apr_off_t blah = 12; const char *blech = "itsy bitsy spider"; apr_status_t st; apr_pool_t *pool; printf("\nRunning with apr version '%s'\n", APR_VERSION_STRING); st = apr_initialize(); if (st != 0) return -1; st = apr_pool_create(&pool, NULL); if (st != 0) return -1; foo = apr_psprintf(pool, "%ld %" APR_OFF_T_FMT " %"APR_OFF_T_FMT " %" APR_OFF_T_FMT " %s", x, bar, baz, blah, blech); printf("'%s'\n", foo); apr_terminate(); return 0; } --Apple-Mail-261-40332997--