Python 3.6.3 + Ice 3.5.1 - crash on exit

o_baumo_baum Oliver BaumOrganization: AREVA NPProject: Safety I&CMember

We are currently evaluating our software that uses Ice 3.5.1 for Python3 under SLES15 beta4 (that contains Python 3.6.3) and found a crash on exit:
*** Error in `/usr/bin/python3': double free or corruption (out): 0x00007ffff6b24900 ***
Program received signal SIGABRT, Aborted.
Backtrace:
#0 0x00007ffff72db0d0 in raise () from /lib64/libc.so.6
#1 0x00007ffff72dc6b1 in abort () from /lib64/libc.so.6
#2 0x00007ffff731e427 in __libc_message () from /lib64/libc.so.6
#3 0x00007ffff7324b83 in malloc_printerr () from /lib64/libc.so.6
#4 0x00007ffff7326489 in _int_free () from /lib64/libc.so.6
#5 0x00007ffff5fc4641 in IcePy::PyObjectHandle::operator=(_object*) () from /opt/ice/python/IcePy.so
#6 0x00007ffff5fb61b3 in IcePy::InfoMapDestroyer::~InfoMapDestroyer() () from /opt/ice/python/IcePy.so
#7 0x00007ffff72ddce8 in __run_exit_handlers () from /lib64/libc.so.6
#8 0x00007ffff72ddd3a in exit () from /lib64/libc.so.6
#9 0x00007ffff72c5f51 in __libc_start_main () from /lib64/libc.so.6
#10 0x0000555555554e8a in _start ()

The Python file is just a one-liner: import Ice
We compiled the Ice libraries by ourself, using gcc-7.2.1 provided by SLES15.

When looking into the repo on GitHub I came across this commit that seems to fix the observed crash. It obviously references a bug tracker ticket "ICE-8496". Where can I find details on this?
Will this commit be contained in the Ice 3.7.1 release?

As a first fix (before moving to a new Ice version) I commented out InfoMapDestroyer, what seems to fix the crash, but possibly introduces memory leaks (that shouldn't matter because the process' memory is freed on exit anyway).

I would be happy to hear from you anything w.r.t. this crash (that didn't appear under SLES12 with Python 3.4.6 and gcc 6.2.1 b.t.w.).
Thanks in advance!

Regards,

Oliver

Tagged:

Best Answer

  • benoitbenoit Rennes, FranceBenoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Accepted Answer

    Hi Olivier,

    Sorry, our bug database isn't public. There isn't a lot more information than a stack trace similar to the one you posted on the bug report. You're correct, the Ice for Python module was relying on static destruction to break some cyclic reference counts. Relying on static construction/destruction order is indeed a bad idea.

    Cheers,
    Benoit.

Answers

  • mesmes CaliforniaMark SpruiellOrganization: ZeroC, Inc.Project: Ice DeveloperAdministrators, ZeroC Staff ZeroC Staff

    Hi,

    Yes, that fix will be included in 3.7.1. It only occurs with GCC 7.x, which must have changed the order of static destruction in some way because we never had any problems with earlier GCC versions.

    Commenting out InfoMapDestroyer is a reasonable workaround.

    Regards,
    Mark

  • mesmes CaliforniaMark SpruiellOrganization: ZeroC, Inc.Project: Ice DeveloperAdministrators, ZeroC Staff ZeroC Staff

    Also note that if you're willing to upgrade to Ice 3.7.0, we've updated our PyPi distribution to include this patch. You can install this version using pip.

  • o_baumo_baum Oliver BaumOrganization: AREVA NPProject: Safety I&CMember

    Hi,

    thank you for your answer.

    Do I understand it correctly, that the bug tracker ticket "ICE-8496" is about order of static destruction and GCC-7 incompatibilities? Is it possible to view this ticket?

    Anyway, as far as I understand, one should not rely on static construction/destruction order (see also "static initialization order fiasco").

    Regards,
    Oliver

  • benoitbenoit Rennes, FranceBenoit FoucherOrganization: ZeroC, Inc.Project: IceAdministrators, ZeroC Staff ZeroC Staff
    Accepted Answer

    Hi Olivier,

    Sorry, our bug database isn't public. There isn't a lot more information than a stack trace similar to the one you posted on the bug report. You're correct, the Ice for Python module was relying on static destruction to break some cyclic reference counts. Relying on static construction/destruction order is indeed a bad idea.

    Cheers,
    Benoit.

  • mesmes CaliforniaMark SpruiellOrganization: ZeroC, Inc.Project: Ice DeveloperAdministrators, ZeroC Staff ZeroC Staff

    Hi Oliver,

    We've just pushed patches for this bug to our 3.5 branch on GitHub (and also to our 3.6 branch). Let us know if you have any issues.

    Regards,
    Mark

Sign In or Register to comment.