Home Bug Reports

Python + Dynamic Ice: segfault when calling ice_invoke

Oscar.AcenaOscar.Acena Member Oscar AceñaOrganization: Universidad Castilla-La ManchaProject: Wireless sensor networks
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

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi Oscar,

    Thanks for reporting this, we'll take a look.

    Regards,
    Mark
  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    I was able to reproduce this failure. I've committed a fix for it to the 3.6 branch.

    Thanks again,
    Mark
  • Oscar.AcenaOscar.Acena Member Oscar AceñaOrganization: Universidad Castilla-La ManchaProject: Wireless sensor networks
    Great news! Thanks for your work and fast reply!
    Cheers.
Sign In or Register to comment.