The issue is that for some reason it gets  libpthread.so.0 referenced
but not listed as in a.out NEDED section

1. Conpile  std::string s; commented out, it works, do objdump -pR a.out 
Dynamic Section:
  NEEDED               libGL.so.1
  NEEDED               libc.so.6
Version References:
  required from libc.so.6:
    0x09691a75 0x00 02 GLIBC_2.2.5

2. Do same thing the std::string line active , notice that libpthreas.so.0 is 
not NEEDED but it is in version referennces and there is  __pthread_key_create 
symbol and you got the bug
Dynamic Section:
  NEEDED               libGL.so.1
  NEEDED               libstdc++.so.6
  NEEDED               libgcc_s.so.1
  NEEDED               libc.so.6
Version References:
  required from libgcc_s.so.1:
    0x0b792650 0x00 06 GCC_3.0
  required from libpthread.so.0:
    0x09691a75 0x00 04 GLIBC_2.2.5
  required from libc.so.6:
    0x09691a75 0x00 03 GLIBC_2.2.5
  required from libstdc++.so.6:
    0x056bafd3 0x00 05 CXXABI_1.3
    0x08922974 0x00 02 GLIBCXX_3.4

DYNAMIC RELOCATION RECORDS
OFFSET           TYPE              VALUE 
0000000000600ff8 R_X86_64_GLOB_DAT  __gmon_start__
0000000000601018 R_X86_64_JUMP_SLOT  _ZNSsC1Ev
0000000000601020 R_X86_64_JUMP_SLOT  glEnable
0000000000601028 R_X86_64_JUMP_SLOT  __gmon_start__
0000000000601030 R_X86_64_JUMP_SLOT  __libc_start_main
0000000000601038 R_X86_64_JUMP_SLOT  _ZNSsD1Ev
0000000000601040 R_X86_64_JUMP_SLOT  __pthread_key_create


3. Add call to pthread , it woirks again
 #include <pthread.h>
#include <string>
#include <GL/gl.h>
int main(int argc, char *argv[]) {
  std::string s;
 glEnable(GL_LIGHT0);
 int i=pthread_getconcurrency();
}

And objdump looks now
Dynamic Section:
  NEEDED               libGL.so.1
  NEEDED               libstdc++.so.6
  NEEDED               libgcc_s.so.1
  NEEDED               libpthread.so.0
  NEEDED               libc.so.6

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to nvidia-graphics-drivers-319 in Ubuntu.
https://bugs.launchpad.net/bugs/1248642

Title:
  dynamic library inconsistencies with OpenGL/C++

Status in “nvidia-graphics-drivers-319” package in Ubuntu:
  New

Bug description:
  While using the nvidia-319 driver, the following C++ program won't
  run:

  $ cat > test.cpp << EOF
  #include <string>
  #include <GL/gl.h>
  int main(int argc, char *argv[]) {
        std::string s;
        glEnable(GL_LIGHT0);
  }
  EOF

  Instead, it fails with the following error message:
  $ g++ test.cpp -lGL
  $ ./a.out
  Inconsistency detected by ld.so: dl-version.c: 224: _dl_check_map_versions: 
Assertion `needed != ((void *)0)' failed!

  Using the xserver-xorg-video-nouveau driver, the problem does not
  occur. Also, when std::string is not used, the program runs without
  problems. Using OpenGL from pure C programs is also not a problem. The
  problem can be reproduced with both g++-4.6 and g++-4.8.

  ProblemType: Bug
  DistroRelease: Ubuntu 13.10
  Package: nvidia-319 319.32-0ubuntu7
  ProcVersionSignature: Ubuntu 3.11.0-12.19-generic 3.11.3
  Uname: Linux 3.11.0-12-generic x86_64
  NonfreeKernelModules: openafs nvidia
  ApportVersion: 2.12.5-0ubuntu2.1
  Architecture: amd64
  Date: Wed Nov  6 18:25:48 2013
  InstallationDate: Installed on 2013-11-01 (5 days ago)
  InstallationMedia: Ubuntu-GNOME 13.10 "Saucy Salamander" - Release amd64 
(20131017)
  MarkForUpload: True
  SourcePackage: nvidia-graphics-drivers-319
  UpgradeStatus: No upgrade log present (probably fresh install)
  modified.conffile..etc.modprobe.d.nvidia.319.hybrid.conf: [deleted]

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-319/+bug/1248642/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to