[Gambas-user] Issue 630 in gambas: Gambas signal 11 on external calls, if a previous call (function doesn't exist in library)

gambas at ...2524... gambas at ...2524...
Mon Jul 27 20:28:53 CEST 2015


Status: New
Owner: ----
Labels: Version Type-Bug Priority-Medium OpSys-Any Dist-Any Arch-Any  
Desktop-Any GUI-Any

New issue 630 by uAle... at ...626...: Gambas signal 11 on external calls, if  
a previous call (function doesn't exist in library)
https://code.google.com/p/gambas/issues/detail?id=630

1) Describe the problem.

Gambas can interface with external libraries, this works normally very  
nice. Only if we call a not-existing routine in an external (I use "Try" to  
catch the error), the next call to the same library results in most cases a  
signal 11.

2) Give information about your system. Use the 'System information' menu in
the Gambas IDE, and paste the result there.

[System]
Gambas=3.7.1
OperatingSystem=Linux
Kernel=3.13.0-57-generic
Architecture=x86_64
Distribution=Ubuntu 14.04.2 LTS
Desktop=GNOME
Theme=QGtk
Language=en_US.UTF-8
Memory=980M
[Libraries]
Cairo=libcairo.so.2.11301.0
Curl=libcurl.so.4.3.0
DBus=libdbus-1.so.3.7.6
GStreamer=libgstreamer-0.10.so.0.30.0
GStreamer=libgstreamer-1.0.so.0.204.0
GTK+3=libgtk-3.so.0.1000.8
GTK+=libgtk-x11-2.0.so.0.2400.23
OpenGL=libGL.so.1.2.0
Poppler=libpoppler.so.44.0.0
Qt4=libQtCore.so.4.8.6
SDL=libSDL-1.2.so.0.11.4

3) Indicate the Gambas version in the issue labels, and if it is a bug, a
crash, or an enhancement request.

Gambas 3.7.1

4) Provide a little project that reproduces the bug or the crash.

Attached

5) If your project needs a database, try to provide it, or part of it.

6) Explain clearly how to reproduce the bug or the crash.

Run the attached example project.

I found a way which seem to solve the problem, by modifying  
the "main/gbx/gbx_extern.c":
...
static EXTERN_FUNC *get_function(CLASS_EXTERN *ext)
{
         EXTERN_FUNC *func;
         void *call;
         lt_dlhandle handle;

         if (ext->loaded)
                 return (EXTERN_FUNC *)ext->alias;

         handle = get_library(ext->library);
         call = lt_dlsym(handle, ext->alias);

         if (call == NULL)
         {
                 //lt_dlclose(handle); // <--- COMMENT THIS ONE OUT --->
                 THROW(E_EXTSYM, ext->library, ext->alias);
         }
..

Comment out the "lt_dlclose(handle);" solves the problem for me.

Attachments:
	TestExtern.tar.gz  4.8 KB

-- 
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings




More information about the User mailing list