#24 Segfault when using xmlrpc.server object

closed-fixed
nobody
None
5
2002-03-19
2001-07-27
No

I am part of a team where many use the py-xmlrpc module. However some would experience segfaults where others would not on similar configurations. After a bit of debugging, I see that when you initialize a server object, it constructs a rpcSource object. Unless the an errorHandler callback is registered, the variables used to indicate prescense of an errorhandler remain uninitialized. If for instance the uninitialized soure->onErrType gets the value 1 (which also happens to be the macro ONERR_TYPE_PY), the server object will try to increment the reference count of a non-existent method object, hence a segfault.

I would recommend that you add the following line in the rpcSourceNew function in rpcSource.c:

sp->onErrType = ONERR_TYPE_DEF;

or in a better way deal with servers that do not have error handlers registered.

Best regards

Audun Nordal

Discussion

  • Shilad Sen
    Shilad Sen
    2002-03-19

    • status: open --> closed-fixed