gvSIG bugs #4042

gvSIG native libraries path is added after the system one

Added by Antonio Falciano over 8 years ago. Updated about 8 years ago.

Status:Closed% Done:

0%

Priority:NormalSpent time:-
Assignee:Joaquín del Cerro Murciano
Category:Application
Target version:2.3.0-2419 (rev. org.gvsig.desktop-2.0.125)
Severity:Major Add-on version:
gvSIG version:2.3.0 Add-on build:
gvSIG build:2415 Add-on resolve version:
Operative System: Add-on resolve build:
Keywords: Proyecto:
Has patch: Hito:
Add-on name:Unknown

Description

The gvSIG native libraries path is added after the system one, so the system libraries are loaded first. This can cause issues like those described in #3848 and #4013. So the gvSIG native libraries (e.g. GDAL/OGR ones) should be loaded first in gvSIG.sh:

###################################################################
# gvSIG native libraries location
###################################################################

export GVSIG_NATIVE_LIBS="" 
export LD_LIBRARY_PATH="" 
export PATH

add_library_path() {
  #logger_info "add_library_path $1" 
  LD_LIBRARY_PATH="$1${CPSEP}$LD_LIBRARY_PATH" 
  GVSIG_NATIVE_LIBS="$1${CPSEP}$GVSIG_NATIVE_LIBS" 
  PATH="$1${CPSEP}$PATH" 
}

list_shared_library_dependencies() {
  logger_info "Checking shared library dependencies for $1" 
  if [ "$OS" = "win" ] ; then
        logger_cmd ./cygcheck.exe "$1" 
  else
        logger_cmd ldd "$1" 
  fi || logger_warn "Problems checking shared library $1"  || true
}

add_classpath() {
  GVSIG_CLASSPATH="$1${CPSEP}$GVSIG_CLASSPATH" 
}

Related to #3848 and #4013.

gvsigsh_path.patch Magnifier (1.05 KB) Antonio Falciano, 01/28/2016 11:56 AM

Associated revisions

Revision 42667
Added by Joaquín del Cerro Murciano over 8 years ago

refs #4042, cambiado el orden de busqueda de las nativas para que primero busque en la instalacion de gvSIG y luego en el sistema.

Revision 42723
Added by Joaquín del Cerro Murciano about 8 years ago

refs #4042, corregido para que en linux use primero las nativas que lleva gvSIG y despues las del sistema.

History

#1 Updated by Antonio Falciano over 8 years ago

I've tested the fix reported above and found that it helps to prevent issues like #3848 and #4013. Because we can't isolate gvSIG in a virtual environment (because it depends by some system libraries), we have to load its libraries before than the system ones.

#2 Updated by Antonio Falciano over 8 years ago

In order to reproduce the issue on a win machine:
  • install the GDAL/OGR libraries standalone (or coming from OSGeo4W), e.g. 1.11.0 version;
  • add the GDAL binary folder to the PATH environmental variable;
  • execute gvSIG and then check the gvSIG-launcher.log.

Result: checking the shared library dependencies of gdaljni.dll used by gvSIG, you'll see the GDAL system dlls among the dependencies and not the gvSIG one. So the GDAL system libraries are loaded accidentally instead of gvSIG ones.

Solution: we need only to invert the order of concatenation of PATH variable to avoid to "see" GDAL/OGR libraries eventually installed on the system before than gvSIG ones. I attach a patch that solves the issue.

Has patch: yes

#3 Updated by Joaquín del Cerro Murciano over 8 years ago

  • Target version changed from 2.3.0-2447-final (rev. org.gvsig.desktop-2.0.153) to 2.3.0-2418 (rev. org.gvsig.desktop-2.0.124)
  • Assignee set to Joaquín del Cerro Murciano
  • Status changed from New to Fixed

#4 Updated by Antonio Falciano over 8 years ago

  • Target version changed from 2.3.0-2418 (rev. org.gvsig.desktop-2.0.124) to 2.3.0-2447-final (rev. org.gvsig.desktop-2.0.153)
  • Status changed from Fixed to New

Hi Joaquin,
it should be:

add_library_path() {
  #logger_info "add_library_path $1" 
  LD_LIBRARY_PATH="$1${CPSEP}$LD_LIBRARY_PATH" 
  GVSIG_NATIVE_LIBS="$1${CPSEP}$GVSIG_NATIVE_LIBS" 
  PATH="$1${CPSEP}$PATH" 
}
The $ is missing before {CPSEP} in build 2418, so I reopen the ticket.

#5 Updated by Joaquín del Cerro Murciano over 8 years ago

  • Target version changed from 2.3.0-2447-final (rev. org.gvsig.desktop-2.0.153) to 2.3.0-2419 (rev. org.gvsig.desktop-2.0.125)

Antonio Falciano wrote:

Hi Joaquin,
it should be:
[...]The $ is missing before {CPSEP} in build 2418, so I reopen the ticket.

Aaayyy ya lo he visto, que error tan tonto... lo corrijo y hago otro build.
Gracias.

#6 Updated by Joaquín del Cerro Murciano over 8 years ago

  • Status changed from New to Fixed

#7 Updated by Antonio Falciano about 8 years ago

  • Status changed from Fixed to Closed

Also available in: Atom PDF