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

Deadloop in roseRunProgram_l. hyperscan/src/rose/program_runtime.c:3055: roseRunProgram_l: Assertion `0' failed. #141

Closed
danlark1 opened this issue Mar 24, 2019 · 2 comments

Comments

@danlark1
Copy link

danlark1 commented Mar 24, 2019

Hi, here is one of the programs to reproduce such behavior.

#include <hs.h>
#include <cassert>
#include <string>
 
int main() {
    hs_database_t *db = nullptr;
    hs_compile_error_t *compile_err = nullptr;
    std::string data = "/odezhda-dlya-bega/";
    const char *expr[] = {"/odezhda-dlya-bega/", "kurtki-i-vetrovki-dlya-bega", "futbolki-i-mayki-dlya-bega"};
    unsigned flags[] = {HS_FLAG_DOTALL | HS_FLAG_SINGLEMATCH, HS_FLAG_DOTALL | HS_FLAG_SINGLEMATCH, HS_FLAG_DOTALL | HS_FLAG_SINGLEMATCH};
    hs_error_t err = hs_compile_multi(expr, flags, nullptr, 3, HS_MODE_BLOCK, nullptr, &db, &compile_err);
 
    assert(HS_SUCCESS == err);
    assert(db != nullptr);
 
    hs_scratch_t *scratch = nullptr;
    err = hs_alloc_scratch(db, &scratch);
    assert(HS_SUCCESS == err);
    assert(scratch != nullptr);
 
    err = hs_scan(db, data.c_str(), data.size(), 0, scratch, nullptr, nullptr);
    assert(HS_SUCCESS == err);
 
    hs_free_database(db);
    err = hs_free_scratch(scratch);
    assert(HS_SUCCESS == err);
}

https://pastebin.com/YWgd2H3R

I am using the trunk version of hyperscan, in 4.7 this code does not go into the deadloop.

This issue was discovered while adding hyperscan to the open-source database system ClickHouse.

@xiangwang1
Copy link
Contributor

xiangwang1 commented Mar 25, 2019

Hi, thanks for reporting this issue.

I think this is related to calling hs_compile_multi() without specifying ids for your patterns. It only happens in release 5.1. We'll take a look and try to fix it.

xiangwang1 pushed a commit that referenced this issue Apr 10, 2019
@danlark1
Copy link
Author

Seems to be fixed in 5.1.1. Thank you

cosmicexplorer pushed a commit to cosmicexplorer/hyperscan that referenced this issue Dec 30, 2023
…ed-char-on-arm

Set Ragel.rl char type to unsigned, intel#135
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants