[Gambas-user] Project gives a Segfault

Willy Raets willy at ...2734...
Wed Dec 24 02:32:33 CET 2014


I have been testing a project of mine and found it to segfault on some
distros.

Tested conditions WITH NO SEGFAULT:
- Gambas 3.5.4 - LXDE 0.5.10 - Debian 7.7 Wheezy
- Gambas 3.5.4 - LXDE 0.6.1 - Fedora 20
- Gambas 3.5.4 - Xfce 4.10 - Linux Mint 13
- Gambas 3.6.2 - LXDE 0.5.8 - Lubuntu 12.04
- Gambas 3.6.2 - Xfce 4.10 - Linux Mint 13

Tested conditions WITH SEGFAULT:

- Gambas 3.6.2 - Mate 1.8 - Linux Mint 17
- Gambas 3.6.90 (rev#6768) - LXDE 0.6.1 - Lubuntu 14.04

It seems to effect Ubuntu 14.04 based system (Linux Mint 17 is Ubuntu
14.04 based as is Lubuntu 14.04)

Strangely enough the segfault doesn't happen on very run!!
About half of the times the application starts normal, the other times
it freezes or gives a segfault message.

I run gdb gbx / (gdb)run ang (gbd) bt
Added is an attachment with the output.

There are two outputs, one of a a segfault run and one of successful
run. Both are on the same system with the same project.

This is the system info of the system (Lubuntu 14.04) I run gdb on:

[System]
Gambas=3.6.90
OperatingSystem=Linux
Kernel=3.13.0-37-generic
Architecture=x86
Distribution=Ubuntu 14.04.1 LTS
Desktop=LXDE
Theme=QGtk
Language=nl_NL.UTF-8
Memory=1002M
[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

If more info is needed, let me know.

-- 
Kind regards,

Willy (aka gbWilly)

http://gambasshowcase.org/
http://howtogambas.org
http://gambos.org



-------------- next part --------------
================== output of a failed run ==========================
$gdb gbx3
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from gbx3...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/bin/gbx3 
Warning: couldn't activate thread debugging using libthread_db: Cannot find new threads: generic error
warning: File "/lib/i386-linux-gnu/libthread_db-1.0.so" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
  add-auto-load-safe-path /lib/i386-linux-gnu/libthread_db-1.0.so
line to your configuration file "/home/willy/.gdbinit".
To completely disable this security protection add
  set auto-load safe-path /
line to your configuration file "/home/willy/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
  info "(gdb)Auto-loading safe path"
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
[New LWP 3568]
[LWP 3568 exited]
[New LWP 3579]

Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 3579]
__GI_fgets_unlocked (buf=buf at ...2861...=0xa2c416e8 "127.0.0.1", n=n at ...2861...=1032, fp=0x0) at iofgets_u.c:53
53  iofgets_u.c: Bestand of map bestaat niet.
(gdb) bt
#0  __GI_fgets_unlocked (buf=buf at ...2861...=0xa2c416e8 "127.0.0.1", n=n at ...2861...=1032, fp=0x0) at iofgets_u.c:53
#1  0xafe0d3ec in get_contents (stream=<optimized out>, len=1032, linebuf=0xa2c416e8 "127.0.0.1") at nss_files/files-XXX.c:201
#2  internal_getent (result=result at ...2861...=0xa2c4166c, buffer=buffer at ...2861...=0xa2c416d0 "\177", buflen=buflen at ...2861...=1056, errnop=errnop at ...2861...=0xa2c41bf0, 
    herrnop=herrnop at ...2861...=0xa2c41bfc, af=af at ...2861...=0, flags=flags at ...2861...=0) at nss_files/files-XXX.c:246
#3  0xafe0e445 in _nss_files_gethostbyname4_r (name=0xaf121770 "idsync.rlcdn.com", pat=0xa2c41bec, buffer=0xa2c416d0 "\177", buflen=buflen at ...2861...=1056, errnop=0xa2c41bf0, 
    herrnop=0xa2c41bfc, ttlp=ttlp at ...2861...=0x0) at nss_files/files-hosts.c:402
#4  0xb7edf368 in gaih_inet (name=<optimized out>, service=<optimized out>, req=req at ...2861...=0xa2c41dec, pai=pai at ...2861...=0xa2c41cb0, naddrs=naddrs at ...2861...=0xa2c41cbc)
    at ../sysdeps/posix/getaddrinfo.c:850
#5  0xb7ee114b in __GI_getaddrinfo (name=<optimized out>, service=<optimized out>, hints=0xa2c41dec, pai=0xa2c41dd8) at ../sysdeps/posix/getaddrinfo.c:2406
#6  0xb4ebdbba in ?? () from /usr/lib/i386-linux-gnu/libQtNetwork.so.4
#7  0xb4eb2ab1 in ?? () from /usr/lib/i386-linux-gnu/libQtNetwork.so.4
#8  0xb6467f07 in ?? () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#9  0xb6474b6f in ?? () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#10 0xb629df70 in start_thread (arg=0xa2c42b40) at pthread_create.c:312
#11 0xb7f0647e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:129

================== output of a succesfull run ==========================
$ gdb gbx3
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from gbx3...(no debugging symbols found)...done.

(gdb) run
Starting program: /usr/bin/gbx3 
Warning: couldn't activate thread debugging using libthread_db: Cannot find new threads: generic error
warning: File "/lib/i386-linux-gnu/libthread_db-1.0.so" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
  add-auto-load-safe-path /lib/i386-linux-gnu/libthread_db-1.0.so
line to your configuration file "/home/willy/.gdbinit".
To completely disable this security protection add
  set auto-load safe-path /
line to your configuration file "/home/willy/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
  info "(gdb)Auto-loading safe path"
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
[New LWP 3638]
[LWP 3638 exited]
[New LWP 3648]
[LWP 3648 exited]
[LWP 3602 exited]
[Inferior 1 (process 3602) exited normally]




More information about the User mailing list