New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link plugin tests even if only BUILD_SHARED is enabled #723

Open
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@manuelm
Contributor

manuelm commented May 17, 2016

This fixes a number of build problems, like elektra-kdb not directly linked to any plugintest although every test calls key/keyset functions.

Note: 4 plugins are crashing with this configuration:

The following tests FAILED:
         19 - testmod_jni (Failed)
         29 - testmod_python (SEGFAULT)
         30 - testmod_python2 (SEGFAULT)
         66 - testscr_check_plugins (Failed)

Most probably all crashes are plugin related and shared linking just reveals the bug.

manuelm added some commits May 17, 2016

Link plugin tests even if only BUILD_SHARED is enabled
This fixes a number of build problems, like elektra-kdb not directly
linked to any plugintest although every test calls key/ks function.

Addtional flags:
LINK_PLUGIN
  required if the test directly calls exported functions
  will link elektra-plugin + adds the include path for the
  generated readme

LINK_ELEKTRA
  allows to link other elektra libraries (like LINK_LIBRARIES)

@manuelm manuelm force-pushed the manuelm:sharedplugintests branch from b2e5759 to db1fa26 May 17, 2016

@markus2330

This comment has been minimized.

Contributor

markus2330 commented May 17, 2016

Thanks! I am currently working on rewriting add_plugin/add_plugintest so that it works with BUILD_SHARED only. I also called the option LINK_PLUGIN, but mainly to choose a different name (for variants). Don't you think it should link by default?

@manuelm

This comment has been minimized.

Contributor

manuelm commented May 17, 2016

I'm not attached to LINK_PLUGIN. I chose it merely because of lacking better alternatives.

I don't think it should be default. Most plugin tests don't call the exported functions directly.
Edit: But linking doesn't hurt either :-)

@markus2330

This comment has been minimized.

Contributor

markus2330 commented May 17, 2016

Do you have any idea why these plugins segfault? I have the same behaviour with my indepedent implementation.

@manuelm

This comment has been minimized.

Contributor

manuelm commented May 17, 2016

Looked at the python plugin for a few seconds. The last test is causing this. And the backtrace is useless here.

@markus2330

This comment has been minimized.

Contributor

markus2330 commented May 17, 2016

#0  0x00007f94e4bd3654 in ?? () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
#1  0x00007f94e4bdfed7 in _PyGC_CollectNoFail () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
#2  0x00007f94e4b5a739 in PyImport_Cleanup () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
#3  0x00007f94e4b0fa37 in Py_EndInterpreter () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
#4  0x00007f94ddbfcd3b in Python_Shutdown (data=0x8503b0) at /home/markus/Projekte/Elektra/current/src/plugins/python/python.cpp:174
#5  0x00007f94ddbfdbd1 in libelektra_Python_LTX_elektraPluginOpen (handle=0x906e60, errorKey=0x9b0950)
    at /home/markus/Projekte/Elektra/current/src/plugins/python/python.cpp:308
#6  0x00007f94e521bf85 in elektraPluginOpen (name=name@entry=0x407d7f "python", modules=modules@entry=0x799e90, config=0x0, config@entry=0x88ac60, 
    errorKey=errorKey@entry=0x9b0950) at /home/markus/Projekte/Elektra/current/src/libs/elektra/plugin.c:295
#7  0x0000000000403a1a in test_wrong () at /home/markus/Projekte/Elektra/current/src/plugins/python/testmod_python.c:138
#8  main (argc=<optimized out>, argv=<optimized out>) at /home/markus/Projekte/Elektra/current/src/plugins/python/testmod_python.c:176

markus2330 added a commit that referenced this pull request May 17, 2016

@markus2330

This comment has been minimized.

Contributor

markus2330 commented May 17, 2016

Did you change something so that the test cases work now?
I temporarily disabled them in 51b72cf can you take a look at it?

@manuelm

This comment has been minimized.

Contributor

manuelm commented May 17, 2016

I'm busy with work. Project manager suddenly decided that we have to release a new service we've worked for half a year on thursday.

But what's wrong with letting the build fail until this is fixed?

@markus2330

This comment has been minimized.

Contributor

markus2330 commented May 17, 2016

I wanted to know if the jni testcase is now fixed for all agents. If other test cases fail I would need to click them through.

@markus2330

This comment has been minimized.

Contributor

markus2330 commented May 17, 2016

Btw. based on your answer you had not fixed it here. I only wondered because this PR seemed to have fix it (at least elektra-test-bindings only fails with jni)

@manuelm

This comment has been minimized.

Contributor

manuelm commented May 17, 2016

No idea why it's working now.

@markus2330 markus2330 added this to the 0.8.19 milestone Nov 11, 2016

@markus2330 markus2330 removed this from the 0.8.19 milestone Nov 19, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment