Skip to content

use python-pin error #8

Description

@ling245100108

I try convert the simplest pintools: inscount0.cpp to python. But It has a segment error:
C: Tool (or Pin) caused signal 11 at PC 0x7f946f1dd8b9
I don't know what's wrong with me.
Here is the python source I write:

import sys, pin

info = file("count.out", "w")

count = 0

def docount(ins_info):
global count
count = count + 1

def instruction(ins):
pin.INS_InsertCall(pin.IPOINT_BEFORE, ins, docount)

def fini():
global count
info.writelines(str(count))
info.close()

pin.INS_AddInstrumentFunction(instruction, 0)
pin.AddFiniFunction(fini, 0)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions