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

clusterByAlignment fails in computeSimilarityMatrix on RawMessages #137

Open
skleber opened this issue Nov 10, 2017 · 1 comment
Open

clusterByAlignment fails in computeSimilarityMatrix on RawMessages #137

skleber opened this issue Nov 10, 2017 · 1 comment

Comments

@skleber
Copy link
Contributor

skleber commented Nov 10, 2017

Clustering and aligning fails with a SIGSEV for manually provided RawMessages as can be tested by the following example:

from netzob.all import *
m1=RawMessage("123")
m2=RawMessage("345")
messages = [m1, m2]
Format.clusterByAlignment(messages)

I tracked it down to the C-implemented ScoreComputation-library, to be exact the following line 192 in ClusterByAlignment.py:

        (listScores) = _libScoreComputation.computeSimilarityMatrix(
            self.internalSlick, self._cb_executionStatus, self._isFinish,
            debug, wrapper)

At this point I got stuck with debugging C inside of python for now.

To verify, other message contents failed also:

m1=RawMessage("\x41\x42\xab\xac\x09\x70\x95\xcc\xef")
m2=RawMessage("\x41\x42\x0a\x70\x03\x8f\x23\x5f")

or

m1=RawMessage("FGHJERTZ")
m2=RawMessage("CsdJERsd")
@Sygus
Copy link
Member

Sygus commented Nov 14, 2017

Hi Stephan, this should work when using bytes for RawMessage:

i.e.

m1=RawMessage(b"123")
m2=RawMessage(b"345")

instead of

m1=RawMessage("123")
m2=RawMessage("345")

This is due to the fact that bytes and Unicode strings are handled with different C objects in the C library. And the C library expects only bytes.

But, a SIGSEV is not a very nice behavior... :D Maybe adding some type checking when building RawMessage by hand would be nice.

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