Discussion:
[TIP] Travis.ci => tox => py.test => exited with code -11
Olemis Lang
2018-07-07 21:27:23 UTC
Permalink
Hello

We are running a (relatively) complex build job on Travis . The steps are
like this :

- git clone with submodules
- compile go in submodule
- run SWIG , input interface files from submodule
- compile C extension module
- run tox
- run py.test

The py.test build step fails [1]_ with exit error code -11 . Nonetheless
this code is not listed in py.test exit codes list [2]_ .

Does anybody know what could be happening with py.test during this build ?
What's py.test error code -11 about ?

Thanks in advance .

.. [1] https://travis-ci.org/simelo/pyskycoin/jobs/401293871#L614-L626

.. [2] https://docs.pytest.org/en/3.6.3/usage.html#possible-exit-codes
--
Regards,

Olemis - @olemislc

Software Eng Skycoin : https://www.skycoin.net
Apache™ Bloodhound contributor : http://issues.apache.org/bloodhound
Brython committer : http://brython.info
SciPy Latin America - Ambassador : http://conf.scipyla.org

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
Bruno Oliveira
2018-07-07 21:36:26 UTC
Permalink
Hi Olemis,
Post by Olemis Lang
Hello
We are running a (relatively) complex build job on Travis . The steps are
- git clone with submodules
- compile go in submodule
- run SWIG , input interface files from submodule
- compile C extension module
- run tox
- run py.test
The py.test build step fails [1]_ with exit error code -11 . Nonetheless
this code is not listed in py.test exit codes list [2]_ .
Does anybody know what could be happening with py.test during this build ?
What's py.test error code -11 about ?
This error code is not coming from pytest, it seems like one of your tests
is crashing. Since you have a custom C extension module, I would guess the
problem is there.

I suggest running pytest with `-v` to see which test is crashing, and
trying to figure out what might be causing it from there.

Hope that helps,
Bruno.
Olemis Lang
2018-07-08 05:12:09 UTC
Permalink
Post by Bruno Oliveira
Hi Olemis,
Post by Olemis Lang
Hello
We are running a (relatively) complex build job on Travis . The steps are
- git clone with submodules
- compile go in submodule
- run SWIG , input interface files from submodule
- compile C extension module
- run tox
- run py.test
The py.test build step fails [1]_ with exit error code -11 . Nonetheless
this code is not listed in py.test exit codes list [2]_ .
Does anybody know what could be happening with py.test during this build
? What's py.test error code -11 about ?
[...]
I suggest running pytest with `-v` to see which test is crashing, and
trying to figure out what might be causing it from there.
[...]
Sure https://travis-ci.org/simelo/pyskycoin/builds/401340567
Struggling with Python 3.6 on Travis ... but that's another story .
--
Regards,

Olemis - @olemislc

Software Eng Skycoin : https://www.skycoin.net
Apache™ Bloodhound contributor : http://issues.apache.org/bloodhound
Brython committer : http://brython.info
SciPy Latin America - Ambassador : http://conf.scipyla.org

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
Olemis Lang
2018-07-08 05:12:34 UTC
Permalink
Post by Olemis Lang
Post by Bruno Oliveira
Hi Olemis,
Post by Olemis Lang
Hello
We are running a (relatively) complex build job on Travis . The steps
- git clone with submodules
- compile go in submodule
- run SWIG , input interface files from submodule
- compile C extension module
- run tox
- run py.test
The py.test build step fails [1]_ with exit error code -11 . Nonetheless
this code is not listed in py.test exit codes list [2]_ .
Does anybody know what could be happening with py.test during this build
? What's py.test error code -11 about ?
[...]
I suggest running pytest with `-v` to see which test is crashing, and
trying to figure out what might be causing it from there.
[...]
Sure https://travis-ci.org/simelo/pyskycoin/builds/401340567
Struggling with Python 3.6 on Travis ... but that's another story .
[...]
Thanks
--
Regards,

Olemis - @olemislc

Software Eng Skycoin : https://www.skycoin.net
Apache™ Bloodhound contributor : http://issues.apache.org/bloodhound
Brython committer : http://brython.info
SciPy Latin America - Ambassador : http://conf.scipyla.org

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
Floris Bruynooghe
2018-07-08 09:17:54 UTC
Permalink
Hi,
Post by Olemis Lang
The py.test build step fails [1]_ with exit error code -11 . Nonetheless
this code is not listed in py.test exit codes list [2]_ .
Does anybody know what could be happening with py.test during this build ?
What's py.test error code -11 about ?
Negative return codes do not come from the process (where the python
interpreter running pytest is the process here), but they indicate the
unhandled signal with which the OS has terminated the process. In this
case `man 7 signal` tells me signal no 11 is SIGSEGV aka segmentation
fault aka "Invalid memory reference".

So the most likely explanation is that one of your go or swig layers is
allowing your python code to execute something that it shouldn't and the
bug is in those layers somewhere rather then in python or pytest. The
traditional first step to figure this out is to enable coredumps and
then run the debugger on the coredump which will show you the stack
frames leading up to the crash and hopefully point you in the right
direction.

Cheers,
Floris
Olemis Lang
2018-07-08 15:03:09 UTC
Permalink
Hello Floris
Thanks for continuing the thread.
Post by Floris Bruynooghe
Hi,
Post by Olemis Lang
The py.test build step fails [1]_ with exit error code -11 . Nonetheless
this code is not listed in py.test exit codes list [2]_ .
Does anybody know what could be happening with py.test during this build
?
Post by Olemis Lang
What's py.test error code -11 about ?
Negative return codes do not come from the process (where the python
interpreter running pytest is the process here), but they indicate the
unhandled signal with which the OS has terminated the process. In this
case `man 7 signal` tells me signal no 11 is SIGSEGV aka segmentation
fault aka "Invalid memory reference".
I did not know of this . Shouldn't this be included in the py.test docs
[1]_ . If people knew then issues would be fixed faster . Or maybe this is
a temporary situation that should remain undocumented ?
Post by Floris Bruynooghe
So the most likely explanation is that one of your go or swig layers is
allowing your python code to execute something that it shouldn't and the
bug is in those layers somewhere rather then in python or pytest.
Well, for the record , the actual problem was that Travis build was
installing SWIG 2.x instead of 3.0.12 .
Post by Floris Bruynooghe
The
traditional first step to figure this out is to enable coredumps and
then run the debugger on the coredump which will show you the stack
frames leading up to the crash and hopefully point you in the right
direction.
[...]
... but still I'll explore how to do it since I'm not familiar with this .

.. [1] https://docs.pytest.org/en/3.6.3/usage.html#possible-exit-codes
--
Regards,

Olemis - @olemislc

Software Eng Skycoin : https://www.skycoin.net
Apache™ Bloodhound contributor : http://issues.apache.org/bloodhound
Brython committer : http://brython.info
SciPy Latin America - Ambassador : http://conf.scipyla.org

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
Olemis Lang
2018-07-08 15:08:20 UTC
Permalink
On Sun, Jul 8, 2018 at 11:03 AM, Olemis Lang <***@gmail.com> wrote:
[...]
Post by Olemis Lang
Post by Olemis Lang
[...]
Post by Olemis Lang
Does anybody know what could be happening with py.test during this
build ?
Post by Olemis Lang
What's py.test error code -11 about ?
Negative return codes do not come from the process (where the python
interpreter running pytest is the process here), but they indicate the
unhandled signal with which the OS has terminated the process. In this
case `man 7 signal` tells me signal no 11 is SIGSEGV aka segmentation
fault aka "Invalid memory reference".
I did not know of this . Shouldn't this be included in the py.test docs
[1]_ . If people knew then issues would be fixed faster . Or maybe this is
a temporary situation that should remain undocumented ?
[...]
.. [1] https://docs.pytest.org/en/3.6.3/usage.html#possible-exit-codes
Oh ! Nevermind . Now I get it . This is built into the Python interpreter .
No need to document it since this is not specific to py.test .
--
Regards,

Olemis - @olemislc

Software Eng Skycoin : https://www.skycoin.net
Apache™ Bloodhound contributor : http://issues.apache.org/bloodhound
Brython committer : http://brython.info
SciPy Latin America - Ambassador : http://conf.scipyla.org

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
Floris Bruynooghe
2018-07-08 16:05:11 UTC
Permalink
Post by Olemis Lang
[...]
Post by Olemis Lang
Post by Olemis Lang
[...]
Post by Olemis Lang
Does anybody know what could be happening with py.test during this
build ?
Post by Olemis Lang
What's py.test error code -11 about ?
Negative return codes do not come from the process (where the python
interpreter running pytest is the process here), but they indicate the
unhandled signal with which the OS has terminated the process. In this
case `man 7 signal` tells me signal no 11 is SIGSEGV aka segmentation
fault aka "Invalid memory reference".
I did not know of this . Shouldn't this be included in the py.test docs
[1]_ . If people knew then issues would be fixed faster . Or maybe this is
a temporary situation that should remain undocumented ?
[...]
.. [1] https://docs.pytest.org/en/3.6.3/usage.html#possible-exit-codes
Oh ! Nevermind . Now I get it . This is built into the Python interpreter .
No need to document it since this is not specific to py.test .
It's the UNIX-like operating system's behaviour really, not specific to
the Python interpreter even.
Olemis Lang
2018-07-08 21:57:57 UTC
Permalink
[...]
[...]
Post by Olemis Lang
Post by Olemis Lang
Post by Olemis Lang
Post by Olemis Lang
Does anybody know what could be happening with py.test during this build ?
Post by Olemis Lang
What's py.test error code -11 about ?
Negative return codes do not come from the process (where the python
interpreter running pytest is the process here), but they indicate the
unhandled signal with which the OS has terminated the process.
[...]
Post by Olemis Lang
Post by Olemis Lang
Post by Olemis Lang
I did not know of this . Shouldn't this be included in the py.test docs
[1]_ . If people knew then issues would be fixed faster . Or maybe this
is
Post by Olemis Lang
Post by Olemis Lang
a temporary situation that should remain undocumented ?
[...]
Post by Olemis Lang
Post by Olemis Lang
Post by Olemis Lang
.. [1] https://docs.pytest.org/en/3.6.3/usage.html#possible-exit-codes
Oh ! Nevermind . Now I get it . This is built into the Python
interpreter .
Post by Olemis Lang
No need to document it since this is not specific to py.test .
It's the UNIX-like operating system's behaviour really, not specific to
the Python interpreter even.
Got it . It's completely green in Linux and in MacOS for Python 2.7 [1]_
... which leads to the next question ...

.. [1] https://travis-ci.org/simelo/pyskycoin/builds/401528298
--
Regards,

Olemis - @olemislc

Software Eng Skycoin : https://www.skycoin.net
Apache™ Bloodhound contributor : http://issues.apache.org/bloodhound
Brython committer : http://brython.info
SciPy Latin America - Ambassador : http://conf.scipyla.org

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
Florian Bruhin
2018-07-08 15:11:40 UTC
Permalink
Post by Olemis Lang
Hello Floris
Thanks for continuing the thread.
Post by Floris Bruynooghe
Hi,
Post by Olemis Lang
The py.test build step fails [1]_ with exit error code -11 . Nonetheless
this code is not listed in py.test exit codes list [2]_ .
Does anybody know what could be happening with py.test during this build
?
Post by Olemis Lang
What's py.test error code -11 about ?
Negative return codes do not come from the process (where the python
interpreter running pytest is the process here), but they indicate the
unhandled signal with which the OS has terminated the process. In this
case `man 7 signal` tells me signal no 11 is SIGSEGV aka segmentation
fault aka "Invalid memory reference".
I did not know of this . Shouldn't this be included in the py.test docs
[1]_ . If people knew then issues would be fixed faster . Or maybe this is
a temporary situation that should remain undocumented ?
I'm not against documenting it, but note that this isn't pytest
specific. Any application, when getting a signal, will exit with such an
exit code. (-11, or 128+11 = 139).

For example, try running this which spawns a subshell which then kills
itself with that signal:

sh -c 'kill -SEGV $$'; echo $?

Florian
--
https://www.qutebrowser.org | ***@the-compiler.org (Mail/XMPP)
GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
I love long mails! | https://email.is-not-s.ms/
Loading...