1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

Ticket #526 (assigned defect)

Opened 2 years ago

Last modified 8 months ago

Our Linux shared libraries are not "versionned"

Reported by: pouillot Owned by: somebody
Priority: minor Milestone: to be defined
Component: Build system Version: 2.0.0-dev
Keywords: shared library version name Cc:

Description

Ex: libtgf.so should be renamed as libtgf.so.2.0.0 or so (+ a libtgf.so.2 symbolic link to it).

Seems it is a problem for building RPM-based packages (Fedora, Mandriva, Mageia, ...), as the rpmlint tool report warnings about this.

Change History

Changed 2 years ago by pouillot

  • owner changed from somebody to pouillot
  • status changed from new to accepted
  • milestone changed from to be defined to 2.0.0

Mostly fixed in r4330, using the ldconfig version-naming scheme :

  • the name of library file itself gives the "version" (= SD version for most of our libs, but the robots),
  • a symbolic link to this file gives the "so-version" of the library,
  • a last symbolic link to the latter finally gives the "link-name" of the library.

Example :

$ ls -l
lrwxrwxrwx 1 root root      20 2012-01-02 20:31 liblearning.so -> liblearning.so.0.0.0*
lrwxrwxrwx 1 root root      22 2012-01-02 20:31 liblearning.so.0.0.0 -> liblearning.so.2.0.0*
-rwxr-xr-x 1 root root  275432 2012-01-02 20:30 liblearning.so.2.0.0*

Please test (should be transparent). Any comment welcome.

TODO: Fix the so-version of our modules : should be 1.0.0 if we want it to be consistent with the robots ones (the interface changed from TORCS's in 1.4.0).

Changed 2 years ago by pouillot

Sorry, r4340.

Changed 2 years ago by mungewell

Looks like this may have introduced some problems....

On an unbuilt SVN repo on Linux I get
--
simon@drifter:~/speed-dreams-svn$ cmake -D OPTION_DEBUG:BOOL=ON -D CMAKE_BUILD_TYPE:STRING=Debug -D OPTION_OFFICIAL_ONLY:BOOL=OFF .
...
-- Found '2.0-dev-r4342m'
CMake Error: File /home/simon/speed-dreams-svn/cmake/version.h.cmake does not exist.
CMake Error at CMakeLists.txt:98 (CONFIGURE_FILE):

configure_file Problem configuring file

--

On my git-svn repo I get (previously built OK)
--
simon@drifter:~/speed-dreams-svn-git$ cmake -D OPTION_DEBUG:BOOL=ON -D CMAKE_BUILD_TYPE:STRING=Debug -D OPTION_OFFICIAL_ONLY:BOOL=OFF .
...
-- Looking for library SDL - found
Warning: Could not determine version name from HeadURL $HeadURL$
CMake Error at src/libs/txml/CMakeLists.txt:43 (SET_TARGET_PROPERTIES):

set_target_properties called with incorrect number of arguments.

--

If you're looking for hints on how to pull the SVN version from a 'git log', here's what I do in the previews gen python script
--

# Return GIT revision
if _has_pygit and options.git:

repo = Repo(myfile)
commits = repo.commits(path=myfile, max_count=1)
if commits:

for line in commits[0].message.splitlines():

if line.startswith("git-svn-id:"):

return int(line.split("@", 1)[1].split(" ",1)[0])

else:

return -1

--

Changed 2 years ago by mungewell

Found out that 'svn up' was failing due to local changes, and svn repo appears to build OK.

Git-SVN still broken. Is there a '-D' I can use to override the version detection?

Changed 2 years ago by pouillot

No available -D option for inhibiting the SVN version detection (but that's an idea).

You can abruptly remove you root CMakeLists.txt and update again, this should fix the (may be also remove the CMakeCache.txt or even ./clobber.sh ?).

And you can temporarily also copy line 39 "SET(NEED_SVN_REV FALSE)" of this root CMakeLists.txt right after line 56 ... this should stop calling 'svnversion'.

PS: Thanks for the git hint (even if I personally don't use git).

Changed 2 years ago by mungewell

got it to work with this added at line 59:
--
ENDIF(VERSION_IS_TAG)
SET(NEED_SVN_REV FALSE)
SET(VERSION "1234-dev")
--

Changed 2 years ago by pouillot

Simon, I don't understand why the version detection stuff no more work on your side ... this has been up and running for may be 3 years now (Mart could tell more) !
And the changes I made about the library versioning under Linux are definitely something independant.

Did you recently change something in the way you do things ?

Changed 2 years ago by mungewell

No recent changes to my 'methods'....

Changed 2 years ago by mungewell

You did remove cmake.version.h 5 weeks ago....
https://sourceforge.net/apps/trac/speed-dreams/changeset/4238

Changed 2 years ago by kmetykog

I've never had version info using git...

Changed 2 years ago by pouillot

Can't see how the version.h.cmake removal (and associated work to merge generated version.h into generated config.h) can produce this, as the whole SVN version detection feature is based only on the HeadURL SVN property attached to the root CMakeLists.txt file ... but I might miss something.

Any way, after r4382 (now, VERSION gets defined even when the HEADURL stuff does not work : see #335), r4391 adds a new OPTION_AUTOVERSION boolean CMake cache variable (default: On), in order one can disable this SVN version detection feature. It also slightly changes the version naming scheme : keeping the 'dev' postfix for the Off case, moving to the 'trunk' postfix when trunk, probably something closer to what Mart intended at the beginning (and that I had made slighty poorer :-).

Changed 2 years ago by pouillot

See #552 about broken SVN version detection in svn-git sandboxes : no more on this here, please.

Changed 2 years ago by pouillot

Reverted back to the old not-versionned shared library files scheme, as it seems to cause issues at simuvx / track modules re-load / unload time, when building with GCC 4.5 or newer (Note: does work like a charm with GCC 4.4.1 under Linux Mandriva 2010.0 x86_64).

Experienced by Xavier with r4340 or newer, but NOT with 4339 or older, under Linux Mageia 1 x86_64 (GCC 4.5.2) and Linux Mageia 2 Alpha x86_64 (GCC 4.6.?) :

# Crash when reloading Simu V2.1 module after quitting a race and starting it again :

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff4b60a7c in std::string::compare(std::string const&) const ()
   from /usr/lib64/libstdc++.so.6
(gdb) where
#0  0x00007ffff4b60a7c in std::string::compare(std::string const&) const ()
   from /usr/lib64/libstdc++.so.6
#1  0x00007ffff7bc4729 in std::operator< <char,std::char_traits<char>, std::allocator<char> > (__lhs= <error reading variable: Cannot access memory at address 0xffffffffffffffe8>,
__rhs="/usr/local/lib64/games/speed-dreams-2/modules/simu/simuv2.1.so")
    at /usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.2/../../../../include/c++/4.6.2/bits/basic_string.h:2512
#2  0x00007ffff7bc43ad in std::less<std::string>::operator() (
    this=0x7ffff7ddea60, __x=
    <error reading variable: Cannot access memory at address 0xffffffffffffffe8>,
__y="/usr/local/lib64/games/speed-dreams-2/modules/simu/simuv2.1.so")
    at /usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.2/../../../../include/c++/4.6.2/bits/stl_function.h:236
#3  0x00007ffff7bc4614 in std::_Rb_tree<std::string, std::pair<std::string const, GfModule*>,
std::_Select1st<std::pair<std::string const, GfModule*> >, std::less<std::string>, std::allocator<std::pair<std::string const, GfModule*> > >::_M_lower_bound (this=0x7ffff7ddea60, __x=0x31bbf90, __y=0x7ffff7ddea68, __k= "/usr/local/lib64/games/speed-dreams-2/modules/simu/simuv2.1.so")
    at /usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.2/../../../../include/c++/4.6.2/bits/stl_tree.h:1080
#4  0x00007ffff7bc4293 in std::_Rb_tree<std::string, std::pair<std::string const, GfModule*>,
std::_Select1st<std::pair<std::string const, GfModule*> >, std::less<std::string>, std::allocator<std::pair<std::string const, GfModule*> > >::find (this=0x7ffff7ddea60, __k=    "/usr/local/lib64/games/speed-dreams-2/modules/simu/simuv2.1.so")
    at /usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.2/../../../../include/c++/4.6.2/bits/stl_tree.h:1526
#5  0x00007ffff7bc4015 in std::map<std::string, GfModule*,
std::less<std::string>, std::allocator<std::pair<std::string const,
GfModule*> > >::find (this=0x7ffff7ddea60, __x="/usr/local/lib64/games/speed-dreams-2/modules/simu/simuv2.1.so")
    at /usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.2/../../../../include/c++/4.6.2/bits/stl_map.h:737
#6  0x00007ffff7bc39c8 in GfModule::load (strShLibName=
    "/usr/local/lib64/games/speed-dreams-2/modules/simu/simuv2.1.so")
    at /home/xavier/Sources/speed-dreams/trunk/src/libs/tgf/module.cpp:91
#7  0x00007ffff74d41fa in RaceEngine::loadPhysicsEngine (this=0x8401d0)
    at /home/xavier/Sources/speed-dreams/trunk/src/libs/raceengine/raceengine.cpp:282
#8  0x00007ffff74e144d in ReRaceRealStart ()
    at /home/xavier/Sources/speed-dreams/trunk/src/libs/raceengine/racemain.cpp:299
#9  0x00007ffff74e2900 in ReRaceStart ()
    at /home/xavier/Sources/speed-dreams/trunk/src/libs/raceengine/racemain.cpp:622
#10 0x00007ffff74eadc3 in ReStateManage ()
    at /home/xavier/Sources/speed-dreams/trunk/src/libs/raceengine/racestate.cpp:86
#11 0x00007ffff74eb161 in ReStateApply (pvState=0x3)
    at /home/xavier/Sources/speed-dreams/trunk/src/libs/raceengine/racestate.cpp:195
#12 0x00007ffff74e293c in ReRaceRestart ()
    at /home/xavier/Sources/speed-dreams/trunk/src/libs/raceengine/racemain.cpp:636
# Crash when unloading track module after aborting a race, configure it again and clicking 'Back' in one of the race configuration menus :

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff4b60a7c in std::string::compare(std::string const&) const ()
   from /usr/lib64/libstdc++.so.6
(gdb) where
#0  0x00007ffff4b60a7c in std::string::compare(std::string const&)
const ()
   from /usr/lib64/libstdc++.so.6
#1  0x00007ffff7bc4729 in std::operator< <char,
std::char_traits<char>, std::allocator<char(__lhs=
    <error reading variable: Cannot access memory at address
0xffffffffffffffe8>,
__rhs="/usr/local/lib64/games/speed-dreams-2/modules/track/track.so")
    at
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.2/../../../../include/c++/4.6.2/bits/basic_string.h:2512
#2  0x00007ffff7bc43ad in std::less<std::string>::operator() (
    this=0x7ffff7ddea60, __x=
    <error reading variable: Cannot access memory at address
0xffffffffffffffe8>,
__y="/usr/local/lib64/games/speed-dreams-2/modules/track/track.so")
    at
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.2/../../../../include/c++/4.6.2/bits/stl_function.h:236
#3  0x00007ffff7bc4614 in std::_Rb_tree<std::string,
std::pair<std::string const, GfModule*>,
std::_Select1st<std::pair<std::string const, GfModule*> >,
std::less<std::string>, std::allocator<std::pair<std::string const,
GfModule*>::_M_lower_bound (this=0x7ffff7ddea60, __x=0x6376960,
__y=0x7ffff7ddea68, __k=
    "/usr/local/lib64/games/speed-dreams-2/modules/track/track.so")
    at
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.2/../../../../include/c++/4.6.2/bits/stl_tree.h:1080
#4  0x00007ffff7bc4293 in std::_Rb_tree<std::string,
std::pair<std::string const, GfModule*>,
std::_Select1st<std::pair<std::string const, GfModule*> >,
std::le---Type <return> to continue, or q <return> to quit---
ss<std::string>, std::allocator<std::pair<std::string const,
GfModule*>::find (this=0x7ffff7ddea60, __k=
    "/usr/local/lib64/games/speed-dreams-2/modules/track/track.so")
    at
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.2/../../../../include/c++/4.6.2/bits/stl_tree.h:1526
#5  0x00007ffff7bc4015 in std::map<std::string, GfModule*,
std::less<std::string>, std::allocator<std::pair<std::string const,
GfModule*>::find (
    this=0x7ffff7ddea60, __x=
    "/usr/local/lib64/games/speed-dreams-2/modules/track/track.so")
    at
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.2/../../../../include/c++/4.6.2/bits/stl_map.h:737
#6  0x00007ffff7bc3ee2 in GfModule::unregister (pModule=0x85c8e0)
    at /home/xavier/Sources/speed-dreams/trunk/src/libs/tgf/module.cpp:201
#7  0x00007fffedee767c in closeGfModule ()
    at
/home/xavier/Sources/speed-dreams/trunk/src/modules/track/trackitf.cpp:44
#8  0x00007ffff7bc3ccc in GfModule::unload (pModule=@0x7fffffffd8d8)
    at /home/xavier/Sources/speed-dreams/trunk/src/libs/tgf/module.cpp:153
#9  0x00007ffff74d3d2c in RaceEngine::cleanup (this=0x840210)
    at
/home/xavier/Sources/speed-dreams/trunk/src/libs/raceengine/raceengine.cpp:110
#10 0x00007ffff74d3b01 in RaceEngine::reset (this=0x840210)
    at
/home/xavier/Sources/speed-dreams/trunk/src/libs/raceengine/raceengine.cp---Type
<return> to continue, or q <return> to quit---
p:67
#11 0x00007fffee129a19 in rmOnActivate ()
    at
/home/xavier/Sources/speed-dreams/trunk/src/modules/userinterface/legacymenu/racescreens/raceselectmenu.cpp:53

Changed 2 years ago by pouillot

About these GCC 4.5 or newer issues about loading / unloading shared libraries, some links to the Internet (may be relevant or not) :

http://paludis.exherbo.org/news.html : search for "4.5" in the page :

"GCC 4.5 appears to be unhappy with dlclose being called in a static

variable's destructor. We no longer do this."

http://stackoverflow.com/questions/7730955/dlclose-crashes-when-copying-dynamic-libraries
http://www.cygwin.com/ml/libc-help/2010-11/msg00013.html
https://bbs.archlinux.org/viewtopic.php?id=113535

dlclose + change contents of / shared library file + dlopen

http://boost.2283326.n4.nabble.com/Cannot-dlclose-module-when-including-exception-ptr-hpp-in-GCC-4-5-td3394982.html

Changed 2 years ago by pouillot

The above mentioned revert was committed in r4410.

Changed 2 years ago by pouillot

  • milestone changed from 2.0.0 to to be defined

And so, postponed after 2.0.

Changed 19 months ago by pouillot

  • status changed from accepted to assigned

Changed 8 months ago by pouillot

  • owner changed from pouillot to somebody
Note: See TracTickets for help on using tickets.