Front page | perl.perl5.porters |
Postings from September 2010
/i Modifier Segfaults SVN::Notify
From:
David E. Wheeler
Date:
September 21, 2010 23:42
Subject:
/i Modifier Segfaults SVN::Notify
Message ID:
066AAD42-23EA-45CC-A39B-172442F3B766@cpan.org
Hey Porters,
I got this report from Steven Schubiger for SVN-Notify-2.80 v5.10.1 OpenBSD: http://www.cpantesters.org/cpan/report/1a43381a-c31a-11df-b5f1-a798ca15ebd2. Steven kindly ran the tests verbosely for me and got segfaults:
> GNU gdb 6.3
> 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-unknown-openbsd4.7"...
> (gdb) run
> Starting program: /home/sts/cpansmoke/perl-5.10.1_debugging/bin/perl -Ilib t/base.t
> 1..244
> ok 1 - use SVN::Notify;
> ok 2 - Construct new notifier
> ok 3 - The object isa SVN::Notify
> ok 4 - prepare recipients
> ok 5 - prepare contents
> ok 6 - prepare files
> ok 7 - prepare subject
> ok 8 - Check repos_path accessor
> ok 9 - Check revision accessor
> ok 10 - Check to accessor
> ok 11 - Check to_regex_map accessor
> ok 12 - Check to_email_map accessor
> ok 13 - Check from accessor
> ok 14 - Check user_domain accessor
> ok 15 - Check svnlook accessor
> ok 16 - Check sendmail accessor
> ok 17 - Check encoding accessor
> ok 18 - Check svn_encoding accessor
> ok 19 - Check diff_encoding accessor
> ok 20 - Check language accessor
> ok 21 - Check env_lang accessor
> ok 22 - Check svn_env_lang accessor
> ok 23 - Check with_diff accessor
> ok 24 - Check attach_diff accessor
> ok 25 - Check diff_switches accessor
> ok 26 - Check reply_to accessor
> ok 27 - Check subject_prefix accessor
> ok 28 - Check subject_cx accessor
> ok 29 - Check max_sub_length accessor
> ok 30 - Check viewcvs_url accessor
> ok 31 - Check svnweb_url accessor
> ok 32 - Check author_url accessor
> ok 33 - Check verbose accessor
> ok 34 - Check user accessor
> ok 35 - Check date accessor
> ok 36 - Check message_size accessor
> ok 37 - Check message accessor isa ARRAY
> ok 38 - Check the message
> ok 39 - Check files accessor isa HASH
> ok 40 - Check subject accessor
> ok 41 - Check header accessor
> ok 42 - Check footer accessor
> ok 43 - Check ticket_url
> ok 44 - Check ticket_regex
> ok 45 - Check ticket_map
> ok 46 - Notify
> ok 47 - Check subject
> ok 48 - Check From
> ok 49 - Check Errors-To
> ok 50 - Check To
> ok 51 - Check Content-Type
> ok 52 - Check Content-Transfer-Encoding
> ok 53 - Log Message
> ok 54 - Modified Paths
> ok 55 - Added Paths
> ok 56 - Removed Paths
> ok 57 - Property Changed
> ok 58 - Check Revision
> ok 59 - Check Author
> ok 60 - Check Date
> ok 61 - Check for log message
> ok 62 - Check for two Class/Meta.pm
> ok 63 - Check for one Class/Meta/Class.pm
> ok 64 - Check for one Class/Meta/Type.pm
> ok 65 - Check for no diff
> ok 66 - Construct new diff notifier
> ok 67 - with_diff() should return true
> ok 68 - language should be "en_US"
> ok 69 - Check env_lang accessor
> ok 70 - Check svn_env_lang accessor
> ok 71 - The object isa SVN::Notify
> ok 72 - Single method call prepare
> ok 73 - Diff notify
> ok 74 - Check diff subject
> ok 75 - Check diff From
> ok 76 - Check diff To
> ok 77 - Check diff Content-Language
> ok 78 - Check for one Content-Type header
> ok 79 - Check for one Content-Transfer-Encoding header
> ok 80 - Check for diff
> ok 81 - Check for no attachment
> ok 82 - Check for no filename
> ok 83 - Construct new attach diff notifier
> ok 84 - The object isa SVN::Notify
> ok 85 - Single method call prepare
> ok 86 - Attach diff notify
> ok 87 - Check attach diff subject
> ok 88 - Check attach diff From
> ok 89 - Check attach diff To
> ok 90 - Check for two Content-Type headers
> ok 91 - Check for two Content-Language headers
> ok 92 - Check for two Content-Transfer-Encoding headers
> ok 93 - Check for diff
> ok 94 - Check for attachment
> ok 95 - Check for filename
> ok 96 - Check for two boundaries
> ok 97 - Check for one final boundary
> ok 98 - Construct new regex_map notifier
> ok 99 - The object isa SVN::Notify
> ok 100 - Prepare to_regex_map
> ok 101 - Notify to_regex_map
> ok 102 - The regex map hash should be unchanged
> ok 103 - Check regex_map To
> ok 104 - Construct new email_map notifier
> ok 105 - The object isa SVN::Notify
> ok 106 - email_map should be set
> ok 107 - Prepare to_email_map
> ok 108 - Notify to_email_map
> ok 109 - The email map hash should be unchanged
> ok 110 - Check email_map To
> ok 111 - Construct new reply_to notifier
> ok 112 - The object isa SVN::Notify
> ok 113 - Prepare reply_to
> ok 114 - Notify reply_to
> ok 115 - Check Reply-To Header
> ok 116 - Construct new subject_prefix notifier
> ok 117 - The object isa SVN::Notify
> ok 118 - Prepare subject_prefix
> ok 119 - Notify subject_prefix
> ok 120 - Check subject header for prefix
> ok 121 - Construct new subject_prefix with %d notifier
> ok 122 - The object isa SVN::Notify
> ok 123 - Prepare subject_prefix
> ok 124 - Notify subject_prefix
> ok 125 - Check subject header for prefix with %d
> ok 126 - Construct new subject_cx notifier
> ok 127 - The object isa SVN::Notify
> ok 128 - Prepare subject_cx
> ok 129 - Notify subject_cx
> ok 130 - Check subject header for CX
> ok 131 - Construct new subject_cx file notifier
> ok 132 - The object isa SVN::Notify
> ok 133 - Prepare subject_cx file
> ok 134 - Notify subject_cx file
> ok 135 - Check subject header for file CX
> ok 136 - Construct new subject length notifier
> ok 137 - The object isa SVN::Notify
> ok 138 - Prepare subject length
> ok 139 - Notify subject length
> ok 140 - Check subject header for subject length
> ok 141 - Construct new max_sub_length notifier
> ok 142 - The object isa SVN::Notify
> ok 143 - Prepare max_sub_length
> ok 144 - Notify max_sub_length
> ok 145 - Check subject header for 10 characters.
> ok 146 - Construct new user_domain notifier
> ok 147 - The object isa SVN::Notify
> ok 148 - Prepare user_domain
> ok 149 - Notify user_domain
> ok 150 - Check From for user domain
> ok 151 - Construct new viewcvs_url notifier
> ok 152 - The object isa SVN::Notify
> ok 153 - Prepare viewcvs_url
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to process 1641, thread 0x86315400]
> 0x1c1fb0a2 in S_regmatch (my_perl=0x7ffe0800, reginfo=0xcfbfb240, prog=0x83e7a620) at regexec.c:3049
> 3049 REXEC_TRIE_READ_CHAR(trie_type, trie, widecharmap, uc,
> (gdb) bt
> #0 0x1c1fb0a2 in S_regmatch (my_perl=0x7ffe0800, reginfo=0xcfbfb240, prog=0x83e7a620) at regexec.c:3049
> #1 0x1c1f8602 in S_regtry (my_perl=0x7ffe0800, reginfo=0xcfbfb240, startpos=0xcfbfb014) at regexec.c:2355
> #2 0x1c1f10be in S_find_byclass (my_perl=0x7ffe0800, prog=0x7d29c08c, c=0x83e7a620, s=0x88fa3078 "�\200\235. r1234", strend=0x88fa3081 "4", reginfo=0xcfbfb240)
> at regexec.c:1366
> #3 0x1c1f7323 in Perl_regexec_flags (my_perl=0x7ffe0800, prog=0x7d29c08c,
> stringarg=0x88fa300c "Did this, that, and the «other». And then I did some more. Some\nit was done on a second line. �\200\234Go figure�\200\235. r1234",
> strend=0x88fa3081 "4",
> strbeg=0x88fa300c "Did this, that, and the «other». And then I did some more. Some\nit was done on a second line. �\200\234Go figure�\200\235. r1234", minend=0,
> sv=0x7d0e56dc, data=0x0, flags=2) at regexec.c:2087
> #4 0x1c1046b0 in Perl_pp_match (my_perl=0x7ffe0800) at pp_hot.c:1356
> #5 0x1c0cb1d8 in Perl_runops_debug (my_perl=0x7ffe0800) at dump.c:1968
> #6 0x1c03aec3 in S_run_body (my_perl=0x7ffe0800, oldscope=1) at perl.c:2426
> #7 0x1c03a500 in perl_run (my_perl=0x7ffe0800) at perl.c:2349
> #8 0x1c017bcd in main (argc=3, argv=0xcfbfb4f4, env=0xcfbfb504) at perlmain.c:117
> (gdb) q
> The program is running. Exit anyway? (y or n)
>
>
>
> GNU gdb 6.3
> 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-unknown-openbsd4.7"...
> (gdb) run
> Starting program: /home/sts/cpansmoke/perl-5.10.1_debugging/bin/perl -Ilib t/html.t
> 1..221
> ok 1 - use SVN::Notify::HTML;
> ok 2 - Construct new HTML notifier
> ok 3 - The object isa SVN::Notify::HTML
> ok 4 - The object isa SVN::Notify
> ok 5 - Single method call prepare
> ok 6 - Check linkize
> ok 7 - Check bugzilla_url
> ok 8 - Check jira_url
> ok 9 - Check rt_url
> ok 10 - wrap_log should be false
> ok 11 - Should have a revision URL
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to process 13796, thread 0x80858c00]
> 0x1c1fb0a2 in S_regmatch (my_perl=0x8be07000, reginfo=0xcfbe0150, prog=0x80491620) at regexec.c:3049
> 3049 REXEC_TRIE_READ_CHAR(trie_type, trie, widecharmap, uc,
> (gdb) bt
> #0 0x1c1fb0a2 in S_regmatch (my_perl=0x8be07000, reginfo=0xcfbe0150, prog=0x80491620) at regexec.c:3049
> #1 0x1c1f8602 in S_regtry (my_perl=0x8be07000, reginfo=0xcfbe0150, startpos=0xcfbdff24) at regexec.c:2355
> #2 0x1c1f10be in S_find_byclass (my_perl=0x8be07000, prog=0x85f2f60c, c=0x80491620, s=0x84e47878 "�\200\235. r1234", strend=0x84e47881 "4", reginfo=0xcfbe0150)
> at regexec.c:1366
> #3 0x1c1f7323 in Perl_regexec_flags (my_perl=0x8be07000, prog=0x85f2f60c,
> stringarg=0x84e4780c "Did this, that, and the «other». And then I did some more. Some\nit was done on a second line. �\200\234Go figure�\200\235. r1234",
> strend=0x84e47881 "4",
> strbeg=0x84e4780c "Did this, that, and the «other». And then I did some more. Some\nit was done on a second line. �\200\234Go figure�\200\235. r1234", minend=0,
> sv=0x8966849c, data=0x0, flags=3) at regexec.c:2087
> #4 0x1c109662 in Perl_pp_subst (my_perl=0x8be07000) at pp_hot.c:2159
> #5 0x1c0cb1d8 in Perl_runops_debug (my_perl=0x8be07000) at dump.c:1968
> #6 0x1c03af31 in S_run_body (my_perl=0x8be07000, oldscope=1) at perl.c:2431
> #7 0x1c03a500 in perl_run (my_perl=0x8be07000) at perl.c:2349
> #8 0x1c017bcd in main (argc=3, argv=0xcfbe042c, env=0xcfbe043c) at perlmain.c:117
> (gdb) q
> The program is running. Exit anyway? (y or n)
>
>
>
> GNU gdb 6.3
> 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-unknown-openbsd4.7"...
> (gdb) run
> Starting program: /home/sts/cpansmoke/perl-5.10.1_debugging/bin/perl -Ilib t/htmlcolordiff.t
> 1..193
> ok 1 - use SVN::Notify::HTML::ColorDiff;
> ok 2 - Construct new HTML::ColorDiff notifier
> ok 3 - The object isa SVN::Notify::HTML::ColorDiff
> ok 4 - The object isa SVN::Notify::HTML
> ok 5 - The object isa SVN::Notify
> ok 6 - Single method call prepare
> ok 7 - HTML notify
> ok 8 - Check HTML subject
> ok 9 - Check HTML From
> ok 10 - Check HTML To
> ok 11 - Check HTML Content-Type
> ok 12 - Check HTML Content-Transfer-Encoding
> ok 13 - Check for <html> tag
> ok 14 - Check for </html> tag
> ok 15 - Check for <head> tag
> ok 16 - Check for </head> tag
> ok 17 - Check for <body> tag
> ok 18 - Check for </body> tag
> ok 19 - Check for <dl> tag
> ok 20 - Check for </dl> tag
> ok 21 - Check for <style> tag
> ok 22 - Check for </style> tag
> ok 23 - Check for style
> ok 24 - Check for msg div
> ok 25 - HTML Log Message
> ok 26 - HTML Modified Paths
> ok 27 - HTML Added Paths
> ok 28 - HTML Removed Paths
> ok 29 - HTML Property Changed
> ok 30 - Check Revision
> ok 31 - Check Author
> ok 32 - Check Date
> ok 33 - Check for HTML log message
> ok 34 - Check for two HTML Class/Meta.pm
> ok 35 - Check for one HTML Class/Meta/Class.pm
> ok 36 - Check for one HTML Class/Meta/Type.pm
> ok 37 - Check for html diff
> ok 38 - Construct new HTML notifier
> ok 39 - The object isa SVN::Notify::HTML::ColorDiff
> ok 40 - The object isa SVN::Notify
> ok 41 - Single method call prepare
> ok 42 - HTML notify
> ok 43 - Check HTML subject
> ok 44 - Check HTML From
> ok 45 - Check HTML To
> ok 46 - Check HTML Content-Type
> ok 47 - Check HTML Content-Transfer-Encoding
> ok 48 - Construct new HTML diff notifier
> ok 49 - The object isa SVN::Notify::HTML::ColorDiff
> ok 50 - The object isa SVN::Notify
> ok 51 - Single method call prepare
> ok 52 - HTML diff notify
> ok 53 - Check HTML diff subject
> ok 54 - Check HTML diff From
> ok 55 - Check HTML diff To
> ok 56 - Check for one HTML Content-Type header
> ok 57 - Check for one HTML Content-Transfer-Encoding header
> ok 58 - Check for patch div
> ok 59 - Check for file div ID
> ok 60 - Check for diff file header
> ok 61 - Check for added file div ID
> ok 62 - Check for added diff file header
> ok 63 - Check for an insert element.
> ok 64 - Check for a del element
> ok 65 - Check for no html diff attachment
> ok 66 - Check for no html diff filename
> ok 67 - Check for HTML escaping
> ok 68 - Check for file name link.
> ok 69 - Check for linked file name
> ok 70 - Check for linked property change file
> ok 71 - Construct new HTML diff_switches notifier
> ok 72 - The object isa SVN::Notify::HTML::ColorDiff
> ok 73 - The object isa SVN::Notify
> ok 74 - Single method call prepare
> ok 75 - HTML diff_switches notify
> ok 76 - Check for added diff file header without body
> ok 77 - Construct new HTML attach diff notifier
> ok 78 - The object isa SVN::Notify::HTML::ColorDiff
> ok 79 - The object isa SVN::Notify
> ok 80 - Single method call prepare
> ok 81 - Attach HTML attach diff notify
> ok 82 - Check HTML attach diff subject
> ok 83 - Check HTML attach diff From
> ok 84 - Check HTML attach diff To
> ok 85 - Check for two Content-Type headers
> ok 86 - Check for two Content-Transfer-Encoding headers
> ok 87 - Check for diff
> ok 88 - Check for html diff attachment
> ok 89 - Check for html diff filename
> ok 90 - Check for no pre tag
> ok 91 - Check for two boundaries
> ok 92 - Check for one final boundary
> ok 93 - Construct new subject_cx file notifier
> ok 94 - The object isa SVN::Notify::HTML::ColorDiff
> ok 95 - The object isa SVN::Notify
> ok 96 - Prepare HTML file
> ok 97 - Notify HTML file
> ok 98 - Check subject header for HTML file
> ok 99 - Check HTML file From
> ok 100 - Check HTML file To
> ok 101 - Check HTML file Content-Type
> ok 102 - Check HTML file Content-Transfer-Encoding
> ok 103 - Construct new HTML viewcvs_url notifier
> ok 104 - The object isa SVN::Notify::HTML::ColorDiff
> ok 105 - The object isa SVN::Notify
> ok 106 - Prepare HTML viewcvs_url
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to process 10146, thread 0x86d56400]
> 0x1c1fb0a2 in S_regmatch (my_perl=0x88c1c000, reginfo=0xcfbca620, prog=0x7e622020) at regexec.c:3049
> 3049 REXEC_TRIE_READ_CHAR(trie_type, trie, widecharmap, uc,
> (gdb) bt
> #0 0x1c1fb0a2 in S_regmatch (my_perl=0x88c1c000, reginfo=0xcfbca620, prog=0x7e622020) at regexec.c:3049
> #1 0x1c1f8602 in S_regtry (my_perl=0x88c1c000, reginfo=0xcfbca620, startpos=0xcfbca3f4) at regexec.c:2355
> #2 0x1c1f10be in S_find_byclass (my_perl=0x88c1c000, prog=0x84cfe80c, c=0x7e622020, s=0x7c9d3678 "�\200\235. r1234", strend=0x7c9d3681 "4", reginfo=0xcfbca620)
> at regexec.c:1366
> #3 0x1c1f7323 in Perl_regexec_flags (my_perl=0x88c1c000, prog=0x84cfe80c,
> stringarg=0x7c9d360c "Did this, that, and the «other». And then I did some more. Some\nit was done on a second line. �\200\234Go figure�\200\235. r1234",
> strend=0x7c9d3681 "4",
> strbeg=0x7c9d360c "Did this, that, and the «other». And then I did some more. Some\nit was done on a second line. �\200\234Go figure�\200\235. r1234", minend=0,
> sv=0x85bd057c, data=0x0, flags=3) at regexec.c:2087
> #4 0x1c109662 in Perl_pp_subst (my_perl=0x88c1c000) at pp_hot.c:2159
> #5 0x1c0cb1d8 in Perl_runops_debug (my_perl=0x88c1c000) at dump.c:1968
> #6 0x1c03af31 in S_run_body (my_perl=0x88c1c000, oldscope=1) at perl.c:2431
> #7 0x1c03a500 in perl_run (my_perl=0x88c1c000) at perl.c:2349
> #8 0x1c017bcd in main (argc=3, argv=0xcfbca904, env=0xcfbca914) at perlmain.c:117
> (gdb) q
> The program is running. Exit anyway? (y or n)
>
>
>
> GNU gdb 6.3
> 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-unknown-openbsd4.7"...
> (gdb) run
> Starting program: /home/sts/cpansmoke/perl-5.10.1_debugging/bin/perl -Ilib t/smtp.t
> 1..38
> ok 1 - use SVN::Notify;
> ok 2 - Create new SMTP notifier
> ok 3 - it isa SVN::Notify
> ok 4 - Prepare notifier
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to process 19738, thread 0x81d7a800]
> 0x1c1fb0a2 in S_regmatch (my_perl=0x85343800, reginfo=0xcfbed140, prog=0x84594420) at regexec.c:3049
> 3049 REXEC_TRIE_READ_CHAR(trie_type, trie, widecharmap, uc,
> (gdb) bt
> #0 0x1c1fb0a2 in S_regmatch (my_perl=0x85343800, reginfo=0xcfbed140, prog=0x84594420) at regexec.c:3049
> #1 0x1c1f8602 in S_regtry (my_perl=0x85343800, reginfo=0xcfbed140, startpos=0xcfbecf14) at regexec.c:2355
> #2 0x1c1f10be in S_find_byclass (my_perl=0x85343800, prog=0x815d690c, c=0x84594420, s=0x7e910e78 "�\200\235. r1234", strend=0x7e910e81 "4", reginfo=0xcfbed140)
> at regexec.c:1366
> #3 0x1c1f7323 in Perl_regexec_flags (my_perl=0x85343800, prog=0x815d690c,
> stringarg=0x7e910e0c "Did this, that, and the «other». And then I did some more. Some\nit was done on a second line. �\200\234Go figure�\200\235. r1234",
> strend=0x7e910e81 "4",
> strbeg=0x7e910e0c "Did this, that, and the «other». And then I did some more. Some\nit was done on a second line. �\200\234Go figure�\200\235. r1234", minend=0,
> sv=0x8a628b5c, data=0x0, flags=2) at regexec.c:2087
> #4 0x1c1046b0 in Perl_pp_match (my_perl=0x85343800) at pp_hot.c:1356
> #5 0x1c0cb1d8 in Perl_runops_debug (my_perl=0x85343800) at dump.c:1968
> #6 0x1c03af31 in S_run_body (my_perl=0x85343800, oldscope=1) at perl.c:2431
> #7 0x1c03a500 in perl_run (my_perl=0x85343800) at perl.c:2349
> #8 0x1c017bcd in main (argc=3, argv=0xcfbed3ec, env=0xcfbed3fc) at perlmain.c:117
> (gdb) q
> The program is running. Exit anyway? (y or n)
This is way over my head. Steven fiddled a bit further:
> I was able to locate where it happens by stepping through a test file with the debugger:
>
> SVN::Notify::HTML::output_log_message(lib/SVN/Notify/HTML.pm:383):
> 383: $msg =~ s{\b((?:rev(?:ision)?\s*#?\s*|r)(\d+))\b}{sprintf qq{<a href="$url">$1</a>}, $2}ige;
>
> If the /i modifier is being omitted here, then it doesn't crash. Unfortunately,
> I wasn't successful in isolating the cause further.
Does anyone know what an issue with /i might be on 5.10.1? Maybe it's a known issue that has been fixed? Do I need to worry about it?
Thanks,
David
-
/i Modifier Segfaults SVN::Notify
by David E. Wheeler