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

Search Query Crashes Lucy #23

Closed
theory opened this issue Nov 20, 2015 · 2 comments
Closed

Search Query Crashes Lucy #23

theory opened this issue Nov 20, 2015 · 2 comments
Labels

Comments

@theory
Copy link
Member

theory commented Nov 20, 2015

This search makes Lucy barf:

http://pgxn.org/search?q=json%00'%7C%7CSLeeP(3)%26%26'1&in=docs
@theory theory added the bug label Nov 20, 2015
@theory
Copy link
Member Author

theory commented Nov 20, 2015

An error occurred during a request to http://pgxn.org/search?q=json%00'%7C%7CSLeeP(3)%26%26'1&in=docs.

Environment:

{
 "HTTP_ACCEPT"          => "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
 "HTTP_ACCEPT_ENCODING" => "gzip, deflate",
 "HTTP_ACCEPT_LANGUAGE" => "en-us",
 "HTTP_COOKIE"          => "rxx=a1ld7katbj4.185xd08&v=1",
 "HTTP_DNT"             => 1,
 "HTTP_HOST"            => "pgxn.org",
 "HTTP_USER_AGENT"      => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/601.3.6 (KHTML, like Gecko) Version/9.0.2 Safari/601.3.6",
 "PATH_INFO"            => "/search",
 "plack.request.query"  => bless({ in => "docs", q => "json\0'||SLeeP(3)&&'1" }, "Hash::MultiValue"),
 "QUERY_STRING"         => "q=json%00'%7C%7CSLeeP(3)%26%26'1&in=docs",
 "REMOTE_ADDR"          => "127.0.0.1",
 "REMOTE_HOST"          => "127.0.0.1",
 "REQUEST_METHOD"       => "GET",
 "REQUEST_URI"          => "/search?q=json%00'%7C%7CSLeeP(3)%26%26'1&in=docs",
 "SCRIPT_NAME"          => "",
 "SERVER_NAME"          => "127.0.0.1",
 "SERVER_PORT"          => 80,
 "SERVER_PROTOCOL"      => "HTTP/1.0",
}

Trace:

Failed to parse ' '||SLeeP(3)&&'1'
    S_parse_flat_string at /home/pgxn/.cpan/build/Lucy-0.3.2-gXJ5cd/core/Lucy/Search/QueryParser.c line 301
    at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/PGXN/API/Searcher.pm line 52.
    PGXN::API::Searcher::search('PGXN::API::Searcher=HASH(0x244d6e8)', 'in', 'docs', 'query', 'json\x{0}\'||SLeeP(3)&&\'1', 'limit', undef, 'offset', undef, ...) called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/WWW/PGXN.pm line 82
    WWW::PGXN::search('WWW::PGXN=HASH(0x1e88310)', 'in', 'docs', 'query', 'json\x{0}\'||SLeeP(3)&&\'1', 'offset', undef, 'limit', undef, ...) called at /home/pgxn/pgxn-site/releases/20131106072501/blib/lib/PGXN/Site/Controller.pm line 288
    PGXN::Site::Controller::search('PGXN::Site::Controller=HASH(0x1e882e0)', 'HASH(0x2459258)') called at /home/pgxn/pgxn-site/releases/20131106072501/blib/lib/PGXN/Site/Router.pm line 28
    PGXN::Site::Router::__ANON__('HASH(0x2459258)', 'HASH(0x2442948)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Router/Resource.pm line 50
    Router::Resource::dispatch('Router::Resource=HASH(0x1f225b8)', 'HASH(0x2459258)') called at /home/pgxn/pgxn-site/releases/20131106072501/blib/lib/PGXN/Site/Router.pm line 153
    PGXN::Site::Router::__ANON__('HASH(0x2459258)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/App/URLMap.pm line 71
    Plack::App::URLMap::call('Plack::App::URLMap=HASH(0x1e98e28)', 'HASH(0x2459258)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Component.pm line 50
    Plack::Component::__ANON__('HASH(0x2459258)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Middleware/ReverseProxy.pm line 68
    Plack::Middleware::ReverseProxy::call('Plack::Middleware::ReverseProxy=HASH(0x20b46f8)', 'HASH(0x2459258)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Component.pm line 50
    Plack::Component::__ANON__('HASH(0x2459258)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Middleware/StackTrace.pm line 31
    Plack::Middleware::StackTrace::__ANON__() called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Try/Tiny.pm line 71
    eval {...} called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Try/Tiny.pm line 67
    Try::Tiny::try('CODE(0x2368dd0)', 'Try::Tiny::Catch=REF(0x23a7d40)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Middleware/StackTrace.pm line 35
    Plack::Middleware::StackTrace::call('Plack::Middleware::StackTrace=HASH(0x1ff6208)', 'HASH(0x2459258)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Component.pm line 50
    Plack::Component::__ANON__('HASH(0x2459258)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Middleware/HTTPExceptions.pm line 20
    Plack::Middleware::HTTPExceptions::__ANON__() called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Try/Tiny.pm line 71
    eval {...} called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Try/Tiny.pm line 67
    Try::Tiny::try('CODE(0x245eb90)', 'Try::Tiny::Catch=REF(0x23b7418)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Middleware/HTTPExceptions.pm line 23
    Plack::Middleware::HTTPExceptions::call('Plack::Middleware::HTTPExceptions=HASH(0x1ff6358)', 'HASH(0x2459258)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Component.pm line 50
    Plack::Component::__ANON__('HASH(0x2459258)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Middleware/ErrorDocument.pm line 15
    Plack::Middleware::ErrorDocument::call('Plack::Middleware::ErrorDocument=HASH(0x1ff6598)', 'HASH(0x2459258)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Component.pm line 50
    Plack::Component::__ANON__('HASH(0x2459258)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Util.pm line 142
    eval {...} called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Util.pm line 142
    Plack::Util::run_app('CODE(0x1ff6508)', 'HASH(0x2459258)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Starman/Server.pm line 223
    Starman::Server::process_request('Starman::Server=HASH(0x200e1e0)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Net/Server.pm line 141
    Net::Server::run_client_connection('Starman::Server=HASH(0x200e1e0)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Net/Server/PreFork.pm line 273
    eval {...} called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Net/Server/PreFork.pm line 273
    Net::Server::PreFork::run_child('Starman::Server=HASH(0x200e1e0)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Net/Server/PreFork.pm line 229
    Net::Server::PreFork::run_n_children('Starman::Server=HASH(0x200e1e0)', 1) called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Net/Server/PreFork.pm line 447
    Net::Server::PreFork::coordinate_children('Starman::Server=HASH(0x200e1e0)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Net/Server/PreFork.pm line 401
    Net::Server::PreFork::run_parent('Starman::Server=HASH(0x200e1e0)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Starman/Server.pm line 104
    Starman::Server::run_parent('Starman::Server=HASH(0x200e1e0)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Net/Server/PreFork.pm line 147
    Net::Server::PreFork::loop('Starman::Server=HASH(0x200e1e0)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Net/Server.pm line 116
    Net::Server::run('Starman::Server=HASH(0x200e1e0)', 'port', 'ARRAY(0x23237e0)', 'host', 'ARRAY(0x2323a20)', 'proto', 'ARRAY(0x2323858)', 'serialize', 'flock', ...) called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Starman/Server.pm line 61
    Starman::Server::run('Starman::Server=HASH(0x200e1e0)', 'CODE(0x1ff6508)', 'HASH(0x20c6ea8)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Handler/Starman.pm line 18
    Plack::Handler::Starman::run('Plack::Handler::Starman=HASH(0x20c6f08)', 'CODE(0x1ff6508)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Loader.pm line 84
    Plack::Loader::run('Plack::Loader=HASH(0x1e9b4a0)', 'Plack::Handler::Starman=HASH(0x20c6f08)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Runner.pm line 277
    Plack::Runner::run('Plack::Runner=HASH(0xf22b28)', 'CODE(0x1ff6508)') called at blib/script/pgxn_site_server line 55
at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/x86_64-linux/Lucy.pm line 479
    Lucy::Object::Err::do_throw('Lucy::Object::Err=SCALAR(0x23556b0)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/PGXN/API/Searcher.pm line 52
    PGXN::API::Searcher::search('PGXN::API::Searcher=HASH(0x244d6e8)', 'in', 'docs', 'query', 'json^@\'||SLeeP(3)&&\'1', 'limit', undef, 'offset', undef) called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/WWW/PGXN.pm line 82
    WWW::PGXN::search('WWW::PGXN=HASH(0x1e88310)', 'in', 'docs', 'query', 'json^@\'||SLeeP(3)&&\'1', 'offset', undef, 'limit', undef) called at /home/pgxn/pgxn-site/releases/20131106072501/blib/lib/PGXN/Site/Controller.pm line 288
    PGXN::Site::Controller::search('PGXN::Site::Controller=HASH(0x1e882e0)', 'HASH(0x2459258)') called at /home/pgxn/pgxn-site/releases/20131106072501/blib/lib/PGXN/Site/Router.pm line 28
    PGXN::Site::Router::__ANON__('HASH(0x2459258)', 'HASH(0x2442948)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Router/Resource.pm line 50
    Router::Resource::dispatch('Router::Resource=HASH(0x1f225b8)', 'HASH(0x2459258)') called at /home/pgxn/pgxn-site/releases/20131106072501/blib/lib/PGXN/Site/Router.pm line 153
    PGXN::Site::Router::__ANON__('HASH(0x2459258)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/App/URLMap.pm line 71
    Plack::App::URLMap::call('Plack::App::URLMap=HASH(0x1e98e28)', 'HASH(0x2459258)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Component.pm line 50
    Plack::Component::__ANON__('HASH(0x2459258)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Middleware/ReverseProxy.pm line 68
    Plack::Middleware::ReverseProxy::call('Plack::Middleware::ReverseProxy=HASH(0x20b46f8)', 'HASH(0x2459258)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Component.pm line 50
    Plack::Middleware::StackTrace::__ANON__ at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Try/Tiny.pm line 71
    eval {...} at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Try/Tiny.pm line 67
    Plack::Middleware::StackTrace::call('Plack::Middleware::StackTrace=HASH(0x1ff6208)', 'HASH(0x2459258)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Component.pm line 50
    Plack::Component::__ANON__('HASH(0x2459258)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Middleware/HTTPExceptions.pm line 20
    Plack::Middleware::HTTPExceptions::__ANON__ at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Try/Tiny.pm line 71
    eval {...} at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Try/Tiny.pm line 67
    Try::Tiny::try('CODE(0x245eb90)', 'Try::Tiny::Catch=REF(0x23b7418)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Middleware/HTTPExceptions.pm line 23
    Plack::Middleware::HTTPExceptions::call('Plack::Middleware::HTTPExceptions=HASH(0x1ff6358)', 'HASH(0x2459258)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Component.pm line 50
    Plack::Component::__ANON__('HASH(0x2459258)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Middleware/ErrorDocument.pm line 15
    Plack::Middleware::ErrorDocument::call('Plack::Middleware::ErrorDocument=HASH(0x1ff6598)', 'HASH(0x2459258)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Component.pm line 50
    Plack::Component::__ANON__('HASH(0x2459258)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Util.pm line 142
    eval {...} at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Util.pm line 142
    Plack::Util::run_app('CODE(0x1ff6508)', 'HASH(0x2459258)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Starman/Server.pm line 223
    Starman::Server::process_request('Starman::Server=HASH(0x200e1e0)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Net/Server.pm line 141
    Net::Server::run_client_connection('Starman::Server=HASH(0x200e1e0)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Net/Server/PreFork.pm line 273
    eval {...} at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Net/Server/PreFork.pm line 273
    Net::Server::PreFork::run_child('Starman::Server=HASH(0x200e1e0)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Net/Server/PreFork.pm line 229
    Net::Server::PreFork::run_n_children('Starman::Server=HASH(0x200e1e0)', 1) called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Net/Server/PreFork.pm line 447
    Net::Server::PreFork::coordinate_children('Starman::Server=HASH(0x200e1e0)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Net/Server/PreFork.pm line 401
    Net::Server::PreFork::run_parent('Starman::Server=HASH(0x200e1e0)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Starman/Server.pm line 104
    Starman::Server::run_parent('Starman::Server=HASH(0x200e1e0)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Net/Server/PreFork.pm line 147
    Net::Server::PreFork::loop('Starman::Server=HASH(0x200e1e0)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Net/Server.pm line 116
    Net::Server::run('Starman::Server=HASH(0x200e1e0)', 'port', 'ARRAY(0x23237e0)', 'host', 'ARRAY(0x2323a20)', 'proto', 'ARRAY(0x2323858)', 'serialize', 'flock', 'log_level', 2, 'log_file', 'log/pgxn_site.log', 'min_servers', 5, 'min_spare_servers', 4, 'max_spare_servers', 4, 'max_servers', 5, 'max_requests', 1000, 'user', 1023, 'group', '1020 1020', 'listen', 1024, 'leave_children_open_on_hup', 1, 'no_client_stdout', 1, 'pid_file', 'pids/pgxn_site.pid', 'setsid', 1, 'background', 1) called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Starman/Server.pm line 61
    Starman::Server::run('Starman::Server=HASH(0x200e1e0)', 'CODE(0x1ff6508)', 'HASH(0x20c6ea8)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Handler/Starman.pm line 18
    Plack::Handler::Starman::run('Plack::Handler::Starman=HASH(0x20c6f08)', 'CODE(0x1ff6508)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Loader.pm line 84
    Plack::Loader::run('Plack::Loader=HASH(0x1e9b4a0)', 'Plack::Handler::Starman=HASH(0x20c6f08)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Plack/Runner.pm line 277
    Plack::Runner::run('Plack::Runner=HASH(0xf22b28)', 'CODE(0x1ff6508)') called at blib/script/pgxn_site_server line 55

@theory
Copy link
Member Author

theory commented Feb 8, 2024

Can no longer replicate. This API URL also now works fine:

https://api.pgxn.org/search/docs/?q=json%00%27%7C%7CSLeeP(3)%26%26%271

@theory theory closed this as completed Feb 8, 2024
@theory theory reopened this Feb 8, 2024
theory added a commit to pgxn/pgxn-api-searcher that referenced this issue Feb 8, 2024
Add regression tests to ensure it no longer chokes on null bytes.
Fixes pgxn/pgxn-api#23 and pgxn/pgxn-api#23.

Stop skipping tests against Lucy 0.002002, which is no longer supported.

Add developer dependencies and drop for Perl 5.10.

Timestamp for v0.11.1.
theory added a commit that referenced this issue Feb 8, 2024
Add a CI GitHub workflow to test on all supported versions of Perl, and
drop the old Travis config.

Also add a release workflow and the Build.PL stuff to support GitHub
releases.

Require PGXN::API::Searcher v0.11.1 to ensure #23 and #26 stay fixed,
and fix the CPAN meta merging to properly generate a v2 `MYMETA.json`
file.

Increment version to v0.20.0 and update the copyright year.

Drop support for Perl 5.10.

Flesh out the README a bit.
theory added a commit that referenced this issue Feb 8, 2024
Add a CI GitHub workflow to test on all supported versions of Perl, and
drop the old Travis config.

Also add a release workflow and the Build.PL stuff to support GitHub
releases.

Require PGXN::API::Searcher v0.11.1 to ensure #23 and #26 stay fixed,
and fix the CPAN meta merging to properly generate a v2 `MYMETA.json`
file.

Increment version to v0.20.0 and update the copyright year.

Drop support for Perl 5.10.

Flesh out the README a bit.
theory added a commit that referenced this issue Feb 9, 2024
Add a CI GitHub workflow to test on all supported versions of Perl, and
drop the old Travis config.

Also add a release workflow and the Build.PL stuff to support GitHub
releases.

Require PGXN::API::Searcher v0.11.1 to ensure #23 and #26 stay fixed,
and fix the CPAN meta merging to properly generate a v2 `MYMETA.json`
file.

Increment version to v0.20.0 and update the copyright year.

Drop support for Perl 5.10 and 5.12.

Flesh out the README a bit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant