Skip to content

Segmentation fault: 11 in all de/serialization methods #1

@peiworld

Description

@peiworld

I get the libscarab working under 64Bit Mac. Pass the testsuit tests.

While I am trying to work with the python wrapper, I have problem with all de/serialization methods. Take this simple method as an example.

def test_mpz_serialization(self):
    print('begin')
    mpz = make_c_mpz_t()
    print('made mpz')
    stringified = serialize_c_mpz_t(mpz)
    print("after stringified")
    assert_equals(stringified, '0')

which trigger this method

def serialize_c_mpz_t(mpz):
"""
Serialize mpz_t

:type mpz: c_mpz_t
:rtype   : str
"""
c_str = lib_gmp.__gmpz_get_str(None, base, mpz)
if c_str == None:
    print "none"
else:
    print "has some thing"
result = string_at(c_str)
#.decode('ascii')
#libc.free(c_str)
return None

The nosetests failed at result = string_at(c_str). Would this be memory access problem? invalid memory? I confirm that same codes run fine under ubuntu build, using virtual machine in the same Mac.

Any idea?

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