Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scenario related traceback #860

Closed
xavierba opened this issue Feb 6, 2020 · 11 comments · Fixed by #904
Closed

Scenario related traceback #860

xavierba opened this issue Feb 6, 2020 · 11 comments · Fixed by #904
Labels
Milestone

Comments

@xavierba
Copy link
Contributor

xavierba commented Feb 6, 2020

Version

6.2.52 + patches #842 #847 #850 #848
Running on CentOS 6.

Installation method

rpm

Expected behavior

No backtrace when browsing the webinterface.

Actual behavior

DIED: Invalid [] range "f->" in regex; marked by <-- HERE in m/[conf-> <-- HERE host]$/ at (eval 1138) line 1.
 at (eval 1138) line 1
        eval 'qr\'[conf->host]$\'i
;' called at /usr/share/sympa/lib/Sympa/Scenario.pm line 669
        Sympa::Scenario::_compile_condition(HASH(0x5070238)) called at /usr/share/sympa/lib/Sympa/Scenario.pm line 596
        Sympa::Scenario::_compile_rule(HASH(0x5070238)) called at /usr/share/sympa/lib/Sympa/Scenario.pm line 559
        Sympa::Scenario::_compile_scenario(Sympa::List <some_list@lists.domain.tld>, 'visibility', HASH(0x4fc1298)) called at /usr/share/sympa/lib/Sympa/Scenario.pm line 245
        Sympa::Scenario::compile(Sympa::List <some_list@lists.domain.tld>, 'title.gettext intranet access\x{a}\x{a}# this is example of a rule to...', 'function', 'visibility', 'file_path', '/etc/sympa/scenari/visibility.intranet') called at /usr/share/sympa/lib/Sympa/Scenario.pm line 218
        Sympa::Scenario::new('Sympa::Scenario', Sympa::List <some_list@lists.domain.tld>, 'visibility', 'name', 'intranet') called at /usr/share/sympa/lib/Sympa/Scenario.pm line 1669
        Sympa::Scenario::get_scenarios(Sympa::List <some_list@lists.domain.tld>, 'visibility') called at /usr/libexec/sympa/wwsympa.fcgi line 10878 
        main::_do_edit_list_request(Sympa::List::Config <some_list@lists.domain.tld>, HASH(0x4e39df8), ARRAY(0x4fcfab8)) called at /usr/libexec/sympa/wwsympa.fcgi line 10807 
        main::do_edit_list_request() called at /usr/libexec/sympa/wwsympa.fcgi line 1544

Additional information

Pure 6.2.52 install without patches applied is broken as well.
I've reverted to 6.2.48 + e262c7c
Another sympa server running 6.2.52 + patches #842 #847 (More or less the initial setup of the broken EL6 host) , but running on Fedora 30 seems okay.

@ikedas
Copy link
Member

ikedas commented Feb 7, 2020

See also #845.

Could you please show also the version of Perl?

@ikedas ikedas added the bug label Feb 7, 2020
@ikedas ikedas added this to the 6.2.54 milestone Feb 7, 2020
@xavierba
Copy link
Contributor Author

xavierba commented Feb 7, 2020

EL6 has perl 5.10.1.

@ikedas
Copy link
Member

ikedas commented Feb 10, 2020

By any chance, haven’t you restarted wwsympa service along with sympa services?

@xavierba
Copy link
Contributor Author

There's no wwsympa service on EL6, the Web UI is run from httpd with mod_fcgid. I'm pretty sure httpd was restarted while I was looking at the issue, but I'm not sure at which point exactly.

EL6 is the only distro/release from the Fedora/RHEL family which is still using mod_fcgid, Fedora and EL7+ are all using a standalone wwsympa service using spawn-fcgi.

@ikedas
Copy link
Member

ikedas commented Feb 10, 2020

On EL6, httpd would be better to be stopped once and started again to certainly restart wwsympa.fcgi .

On EL7 and 8, Systemd socket and optional multiplexing by multiwatch would be better. I’ll add instructions to doc site later.

@ikedas
Copy link
Member

ikedas commented Feb 11, 2020

@xavierba , patch #850 looks avoiding such traceback. Could you please check again with el6 and all of the patches?

@ikedas ikedas removed this from the 6.2.54 milestone Feb 17, 2020
@xavierba
Copy link
Contributor Author

xavierba commented Mar 4, 2020

I just reproduced with 6.2.54 + #890
httpd was restarted after sympa update.

Updated traceback:

DIED: Invalid [] range "f->" in regex; marked by <-- HERE in m/[conf-> <-- HERE host]$/ at (eval 1139) line 1.
 at (eval 1139) line 1
        eval 'qr\'[conf->host]$\'i
;' called at /usr/share/sympa/lib/Sympa/Scenario.pm line 671
        Sympa::Scenario::_compile_condition(HASH(0x6c58f30)) called at /usr/share/sympa/lib/Sympa/Scenario.pm line 598
        Sympa::Scenario::_compile_rule(HASH(0x6c58f30)) called at /usr/share/sympa/lib/Sympa/Scenario.pm line 560
        Sympa::Scenario::_compile_scenario(Sympa::List <some_list@lists.domain.tld>, 'send', HASH(0x6c95ef8)) called at /usr/share/sympa/lib/Sympa/Scenario.pm line 246
        Sympa::Scenario::compile(Sympa::List <some_list@lists.domain.tld>, 'title.gettext restricted to local domain\x{a}\x{a}# if subscriber req...', 'function', 'send', 'file_path', '/etc/sympa/scenari/send.intranet') called at /usr/share/sympa/lib/Sympa/Scenario.pm line 219
        Sympa::Scenario::new('Sympa::Scenario', Sympa::List <some_list@lists.domain.tld>, 'send', 'name', 'intranet') called at /usr/share/sympa/lib/Sympa/Scenario.pm line 1674
        Sympa::Scenario::get_scenarios(Sympa::List <some_list@lists.domain.tld>, 'send') called at /usr/libexec/sympa/wwsympa.fcgi line 10865
        main::_do_edit_list_request(Sympa::List::Config <some_list@lists.domain.tld>, HASH(0x6c54a90), ARRAY(0x6c92eb0)) called at /usr/libexec/sympa/wwsympa.fcgi line 10794
        main::do_edit_list_request() called at /usr/libexec/sympa/wwsympa.fcgi line 1541

if I move both /etc/sympa/scenari/send.intranet then subsequently /etc/sympa/scenari/send.intranetorprivate out of the way, I don't reproduce the traceback anymore.

These files are left-overs from a previous rpm version. They are not shipped anymore in the RPM as they have been removed from sympa source code in 2dfb5bd
The files are unaltered from what was shipped until c95a1ec which deprecated conf.host in favor of domain.

If I move back both file to their previous location after changing conf->host into domain, I don't reproduce the traceback anymore.

@ikedas
Copy link
Member

ikedas commented Mar 5, 2020

I found a minimal reproducible case.

bad.pl:

use lib '/usr/share/sympa/lib';    # MODULESDIR
use Sympa::Crash;

eval "qr'[x->x]'i";
print "Eval is safe: $@";
  • It dies due to "Invalid [] range "x->" in regex".
  • If the line use Sympa::Crash; is removed, it prints "Eval is safe: ...".

good.pl:

use lib '/usr/share/sympa/lib';    # MODULESDIR
use Sympa::Crash;

do {
    local $SIG{__DIE__};
    eval "qr'[x->x]'i";
};
print "Eval is safe: $@";
  • It prints "Eval is safe: ...".

I confirmed with Perl 5.10.1, 5.16.3 & 5.28.2.

@ikedas
Copy link
Member

ikedas commented Mar 5, 2020

@xavierba, could you please check the PR above?

@xavierba
Copy link
Contributor Author

xavierba commented Mar 5, 2020

Yes, #904 fixes the issue.

Test cases:

  • Valid scenario file, no patch --> no crash
  • Invalid scenario file, no patch --> crash
    (apply patch, wwsympa restart)
  • Invalid scenario file, patch --> no crash
  • valid scenario file, patch --> no crash

I applied only ef76342 for the fix on top of the rpm install but not 1d3acd8 for the test suite.

@ikedas ikedas added this to the 6.2.56 milestone Mar 6, 2020
ikedas added a commit that referenced this issue Mar 6, 2020
Scenario: Prevent crashing by fatal error in syntax of regexp (#860)
@ikedas
Copy link
Member

ikedas commented Mar 6, 2020

Thanks for confirmation! The fixes were merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants