[Gambas-bugtracker] Bug #1551: Signal 11 caused by too many variables?? with 11 nested for-next loops
bugtracker at gambaswiki.org
bugtracker at gambaswiki.org
Wed Mar 13 13:27:48 CET 2019
http://gambaswiki.org/bugtracker/edit?object=BUG.1551&from=L21haW4-
Jessie HAMLIN reported a new bug.
Summary
-------
Signal 11 caused by too many variables?? with 11 nested for-next loops
Type : Bug
Priority : Medium
Gambas version : 3.12
Product : Unknown
Description
-----------
I have written a program to try to find the check digit and determine the check method for 10 digit numerical codes. It consists of 10 nested for-next loops with each loop multiplying each digit of the sample codes by the loop number. In this way over the course of the run it will have tried every possible combination of multipliers and compared the results between codes. Inside all these loops is an 11th loop which runs a sequence of 3 tests on the current multipliers. It does work but the original version used 5 codes and there were many false positives so I increased the number of codes it compared. Each code requires the use of 12 numeric variables and one string for the code. After I added the variable definitions (DIM) for a 7th code the program would crash as it entered the for-next loops throwing a Segmentation Fault (11). I also get a Linux crash notice stating the gbx3 has stopped unexpectedly. If I eliminate loops or reduce the number of variables used the program will run. Right now the program crashes after the FOR statement to for the 11th loop - the one which starts the 3 tests. In other versions of the program it crashed earlier after the 5ht loop started. If I remove some variables the program will run fine.
I have redefined the variables so that they use the least memory possible (most are single digits and are now defined as BYTE) but the problem persists.
Is there a limit to the number of variables in a GAMBAS program?
System information
------------------
[System]
Gambas=3.12.2
OperatingSystem=Linux
Kernel=4.4.0-142-generic
Architecture=x86_64
Distribution=Ubuntu 16.04.6 LTS
Desktop=UNITY
Theme=Gtk
Language=en_US.UTF-8
Memory=11959M
[Libraries]
Cairo=libcairo.so.2.11400.6
Curl=libcurl.so.4.4.0
DBus=libdbus-1.so.3.14.6
GStreamer=libgstreamer-0.10.so.0.30.0
GStreamer=libgstreamer-1.0.so.0.803.0
GTK+2=libgtk-x11-2.0.so.0.2400.30
GTK+3=libgtk-3.so.0.1800.9
OpenGL=libGL.so.1.2.0
Poppler=libpoppler.so.58.0.0
QT4=libQtCore.so.4.8.7
QT5=libQt5Core.so.5.5.1
SDL=libSDL-1.2.so.0.11.4
SQLite=libsqlite3.so.0.8.6
[Environment]
CLUTTER_IM_MODULE=xim
COMPIZ_BIN_PATH=/usr/bin/
COMPIZ_CONFIG_PROFILE=ubuntu
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-PXUbfdVyfm
DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path
DESKTOP_SESSION=ubuntu
DISPLAY=:0
GB_GUI=gb.qt4
GDMSESSION=ubuntu
GDM_LANG=en_US
GIO_LAUNCHED_DESKTOP_FILE=/usr/share/applications/gambas3.desktop
GIO_LAUNCHED_DESKTOP_FILE_PID=3511
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
GNOME_KEYRING_CONTROL=
GNOME_KEYRING_PID=
GPG_AGENT_INFO=<home>/.gnupg/S.gpg-agent:0:1
GTK2_MODULES=overlay-scrollbar
GTK_IM_MODULE=ibus
GTK_MODULES=gail:atk-bridge:unity-gtk-module
HOME=<home>
IM_CONFIG_PHASE=1
INSTANCE=
JOB=unity-settings-daemon
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LOGNAME=<user>
MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path
PATH=<home>/bin:<home>/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
PWD=<home>
QT4_IM_MODULE=xim
QT_ACCESSIBILITY=1
QT_IM_MODULE=ibus
QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
QT_QPA_PLATFORMTHEME=appmenu-qt5
SESSION=ubuntu
SESSIONTYPE=gnome-session
SESSION_MANAGER=local/<hostname>:@/tmp/.ICE-unix/1818,unix/<hostname>:/tmp/.ICE-unix/1818
SHELL=/bin/bash
SHLVL=0
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
TZ=:/etc/localtime
UNITY_DEFAULT_PROFILE=unity
UNITY_HAS_3D_SUPPORT=true
UPSTART_EVENTS=xsession started
UPSTART_INSTANCE=
UPSTART_JOB=unity7
UPSTART_SESSION=unix:abstract=/com/ubuntu/upstart-session/1000/1564
USER=<user>
XAUTHORITY=<home>/.Xauthority
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg
XDG_CURRENT_DESKTOP=Unity
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/share/gnome:/usr/local/share:/usr/share:/var/lib/snapd/desktop:/var/lib/snapd/desktop
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/<user>
XDG_MENU_PREFIX=gnome-
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_SESSION_DESKTOP=ubuntu
XDG_SESSION_ID=c1
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_SESSION_TYPE=x11
XDG_VTNR=7
XMODIFIERS=@im=ibus
(gdb) run
Starting program: /usr/bin/gbx3
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe9906700 (LWP 3744)]
[New Thread 0x7fffe9105700 (LWP 3745)]
[New Thread 0x7fffe8904700 (LWP 3746)]
[New Thread 0x7fffdaedf700 (LWP 3747)]
[New Thread 0x7fffda6de700 (LWP 3748)]
Code 1 is 4746713989
A=4 B=7 C=4 D=6 E=7 F=1 G=3 H=9 I=8 J=9
Code 2 is 4735879542
A=4 B=7 C=3 D=5 E=8 F=7 G=9 H=5 I=4 J=2
Code 3 is 4712586982
A=4 B=7 C=1 D=2 E=5 F=8 G=6 H=9 I=8 J=2
Code 4 is 4740139853
A=4 B=7 C=4 D=0 E=1 F=3 G=9 H=8 I=5 J=3
Code 5 is 4799999996
A=4 B=7 C=9 D=9 E=9 F=9 G=9 H=9 I=9 J=6
Code 6 is 4766395677
A=4 B=7 C=6 D=6 E=3 F=9 G=5 H=6 I=7 J=7
Code 7 is 4706333172
A=4 B=7 C=0 D=6 E=3 F=3 G=3 H=1 I=7 J=2
A loop started
B loop started
C loop started
D loop started
E loop started
F loop started
G loop started
H loop started
I loop started
J loop started
Thread 1 "gbx3" received signal SIGSEGV, Segmentation fault.
0x00000000004311a1 in ?? ()
(gdb) bt
#0 0x00000000004311a1 in ?? ()
#1 0x00000000004349ee in ?? ()
#2 0x0000000000438a15 in ?? ()
#3 0x000000000043aab5 in ?? ()
#4 0x00000000004195be in ?? ()
#5 0x000000000041b70b in ?? ()
#6 0x00007ffff5f9cb79 in ?? () from /usr/lib/gambas3/gb.gtk.so
#7 0x00007ffff5f9d11c in ?? () from /usr/lib/gambas3/gb.gtk.so
#8 0x00007ffff5f9cab7 in ?? () from /usr/lib/gambas3/gb.gtk.so
#9 0x0000000000439a42 in ?? ()
#10 0x000000000043aaf1 in ?? ()
#11 0x0000000000404bc0 in ?? ()
#12 0x00007ffff7a2d830 in __libc_start_main (main=0x4044c8, argc=1,
argv=0x7fffffffdf98, init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>, stack_end=0x7fffffffdf88)
at ../csu/libc-start.c:291
#13 0x0000000000404d59 in ?? ()
(gdb)
More information about the Bugtracker
mailing list