Archived

This forum has been archived. Please start a new discussion on GitHub.

Python + Dynamic Ice: segfault when calling ice_invoke

Hi there!

I've been playing around with Python, calling ice_invoke to forward an invocation to somewhere else. I receive a segfault not the first time, but the 256th. When I try to trace the problem, I get the impression that the reference count of the Python object 'True' gets decremented over and over, and never incremented again. The following code is a sample of this scenario.

I've tested on Ubuntu and Debian, using Ice 3.6-1 from stable repositories, and Python 2.7.

To test, just launch the server, then the forwarder and finally the client. I've attached all, but I paste here the interesting part of forwarder.py. Thanks for your help!
...

class Servant(Ice.Blobject):
    def __init__(self, next):
        self.counter = 1
        self.next = next

    def ice_invoke(self, in_params, current):
        print "ice_invoke called ({})".format(self.counter)
        self.counter += 1

        next = self.next.ice_identity(current.id)

        # NOTE: vital to pass context as forth param!
        return next.ice_invoke(
            current.operation, current.mode, in_params, current.ctx)

...

Comments