Skip to content

hyper scan library crash #20

@TidyHuang

Description

@TidyHuang

Hello,

I have been developing an app with very simple function to compile a pattern and use the pattern to match which needs use Hyperscan library:

After compiling the hyperscan library with following options: -DCMAKE_BUILD_TYPE=debug -DBOOST_ROOT=${BOOST_ROOT} -DBUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_PREFIX=${USR_LIB_PATH}.

The App runs as expected at my compiling machine[model name : Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz], and then I copied my app and libhs.so to another machine [model name : Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz](Same X86 64bit machine).
however it crashed every time at pattern load function when I execute the app.

The compiling machine and running machine has difference cpuinfo, not sure it has relationship with this.

Could some one can help me out. Thanks.

Here are the crash info:

rgdb.sh core.simplegrep.14441 
file: compiled magic version [521] does not match with shared library magic version [524]
gdb ./simplegrep -c core.simplegrep.14441
GNU gdb (GDB) Amazon Linux (7.6.1-64.33.amzn1)
    Copyright (C) 2013 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-amazon-linux-gnu".
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/>...
    Reading symbols from /home/david/simplegrep...done.
    [New LWP 14441]
    Missing separate debuginfo for /usr/lib64/libstdc++.so.6
    Try: yum --enablerepo='*debug*' install /usr/lib/debug/.build-id/0a/90c35d3174805453ea67a785446d628e298b59.debug
    Missing separate debuginfo for /lib64/libgcc_s.so.1
    Try: yum --enablerepo='*debug*' install /usr/lib/debug/.build-id/00/fa2883fb47b1327397bbf167c52f51a723d013.debug
    Core was generated by `./simplegrep outside ss.list'.
    Program terminated with signal 4, Illegal instruction.
#0  set_range (to=111, from=111, this=0x7ffee99b7910) at /home/tidy/work/app/hyperscan/hyperscan/src/util/bitfield.h:154
    154 /home/tidy/work/app/hyperscan/hyperscan/src/util/bitfield.h: No such file or directory.
    Missing separate debuginfos, use: debuginfo-install glibc-2.17-106.167.amzn1.x86_64
    (gdb) bt
#0  set_range (to=111, from=111, this=0x7ffee99b7910) at /home/tidy/work/app/hyperscan/hyperscan/src/util/bitfield.h:154
#1  setRange (to=111 'o', from=111 'o', this=0x7ffee99b7910) at /home/tidy/work/app/hyperscan/hyperscan/src/util/charreach.h:106
#2  CharReach (to=111 'o', from=111 'o', this=0x7ffee99b7910) at /home/tidy/work/app/hyperscan/hyperscan/src/util/charreach.h:62
#3  ue2::AsciiComponentClass::add (this=0x1c3aca0, c=111) at /home/tidy/work/app/hyperscan/hyperscan/src/parser/AsciiComponentClass.cpp:124
#4  0x00007fe4c5fddcb1 in ue2::getLiteralComponentClass (c=c@entry=111 'o', nocase=<optimized out>)
        at /home/tidy/work/app/hyperscan/hyperscan/src/parser/ComponentClass.cpp:421
#5  0x00007fe4c5e0b1cc in ue2::addLiteral (currentSeq=currentSeq@entry=0x1c3ac50, c=111 'o', mode=...)
            at /home/tidy/work/app/hyperscan/hyperscan/src/parser/Parser.rl:181
#6  0x00007fe4c5fe78ca in ue2::parse (c_ptr=c_ptr@entry=0x7ffee99ba6ca "outside", globalMode=...)
                at /home/tidy/work/app/hyperscan/hyperscan/src/parser/Parser.rl:1823
#7  0x00007fe4c5e1b7b1 in ue2::ParsedExpression::ParsedExpression (this=0x7ffee99b8570, index_in=<optimized out>, expression=0x7ffee99ba6ca "outside", flags=2, 
            actionId=<optimized out>, ext=0x0) at /home/tidy/work/app/hyperscan/hyperscan/src/compiler/compiler.cpp:116
#8  0x00007fe4c5e1d0c4 in ue2::addExpression (ng=..., index=index@entry=0, expression=0x7ffee99ba6ca "outside", flags=2, ext=0x0, id=0)
    at /home/tidy/work/app/hyperscan/hyperscan/src/compiler/compiler.cpp:236
#9  0x00007fe4c5e19305 in ue2::hs_compile_multi_int (expressions=expressions@entry=0x7ffee99b8a98, flags=flags@entry=0x7ffee99b8a94, ids=ids@entry=0x7ffee99b8aac, 
            ext=ext@entry=0x0, elements=elements@entry=1, mode=mode@entry=1, platform=platform@entry=0x0, db=db@entry=0x7ffee99b8bf0, comp_error=comp_error@entry=0x7ffee99b8bf8, g=...)
    at /home/tidy/work/app/hyperscan/hyperscan/src/hs.cpp:228
#10 0x00007fe4c5e19a13 in hs_compile (expression=expression@entry=0x7ffee99ba6ca "outside", flags=flags@entry=2, mode=mode@entry=1, platform=platform@entry=0x0, 
            db=db@entry=0x7ffee99b8bf0, error=error@entry=0x7ffee99b8bf8) at /home/tidy/work/app/hyperscan/hyperscan/src/hs.cpp:285
#11 0x0000000000400d31 in main (argc=<optimized out>, argv=<optimized out>) at /home/tidy/exam/simplegrep.c:163
(gdb) q

Compiling machine cpuinfo:
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 69
model name : Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz
stepping : 1
microcode : 0x17
cpu MHz : 2300.092
cache size : 4096 KB
physical id : 0
siblings : 1
core id : 0
cpu cores : 1
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm ida arat epb pln pts dtherm fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid xsaveopt
bogomips : 4600.18
clflush size : 64
cache_alignment : 64
address sizes : 42 bits physical, 48 bits virtual
power management:

Running machine cpuinfo:

cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 62
model name : Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
stepping : 4
microcode : 0x415
cpu MHz : 2494.028
cache size : 25600 KB
physical id : 0
siblings : 1
core id : 0
cpu cores : 1
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology eagerfpu pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm fsgsbase smep erms xsaveopt
bugs :
bogomips : 4988.05
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:

-Tidy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions