Reporting a problem, a bug or a crash

By doing a accurate bug report, and by providing everything to reproduce the bug, you usually have done half of the bug fix job.

SO BE ACCURATE AND INFORMATIVE!

1. The Bug Tracker

The Gambas bug tracker is hosted at http://gambaswiki.org/bugtracker at the moment. Please report your bugs there. Note that must register with a valid e-mail address to be able to post bug reports.

But please don't forget to:
  • Give details about your configuration : your processor, your distribution (Mandriva, SuSE, Debian, etc.) with the version number, your kernel version, and everything you find useful.

  • TELL WHICH VERSION OF Gambas YOU ARE USING.

  • For projects with a GUI, indicate what your desktop environment is and what graphics component you are using.

  • Try to isolate the problem in a small Gambas project, and explain how to reproduce it.

You can gather all needed information from the "System information" menu entry in the development environment:

2. The Mailing list

If you cannot solve your problem, first try to ask on the mailing list. Maybe someone could help you, who knows ? But please:
  • Give details about your configuration : your processor, your distribution (Mandriva, SuSE, Debian, etc.) with the version number, your kernel version, and everything you find useful.

  • TELL WHICH VERSION OF Gambas YOU ARE USING.

  • For projects with a GUI, indicate what your desktop environment is and what graphics component you are using.

  • Try to isolate the problem in a small Gambas project, and explain how to reproduce it.

3. Reporting a Gambas compilation problem

If you cannot compile and install Gambas successfully, please provide the output of the four commands: ./reconf-all, ./configure, make, and make install.

To do that, type the following commands in a terminal:

$ cd /gambas/source/directory
$ (./reconf-all && ./configure -C && make clean && make) > output.txt 2>&1
$ su
...
# make install > install.txt 2>&1

and send the "output.txt" and "install.txt" files.

If ./reconf-all is not the problem, you can skip it, and just send the output of the three other commands.

Compilation problems must be reported on the mailing-list, not on the bug tracker!

4. Reporting a bug

As a last resort, and if you are almost sure that it is an awful bug, you can send me an e-mail, but PLEASE:
  • Put the word "bug" somewhere in the subject.

  • Give details about your configuration : your processor, your distribution (Mandriva, SuSE, Debian, etc.) with the version number, your kernel version, and everything you find useful.

  • TELL WHICH VERSION OF Gambas YOU ARE USING.

  • For projects with a GUI, indicate what your desktop environment is and what graphics component you are using.

  • If it is a problem during the compilation or the execution of a program, SEND YOUR Gambas PROJECT so that I deal with it.

  • If you don't want to send your project, try to isolate the problem in a small project.

5. Reporting a crash (a segmentation fault, or a signal #11)

If Gambas crashes, you can trace it and tell me where it crashed exactly. It is very helpful for me. If you don't know how to do that, read the following carefully:

You have to compile Gambas with debugging information enabled, which is normally the default.

  • Open a terminal, and go to the directory of the project that crashes.

    $ cd /path/to/my/gambas/project
    

If the IDE crashes, go to the IDE sources in the app/src/gambas3 directory of the source package. Do not forget to compile the IDE. For example:

$ cd ~/gambas3-xxx/app/src/gambas3
$ gbc3 -agt

  • Launch the GNU debugger.

    $ gdb gbx3
    GNU gdb (GDB) 7.2-ubuntu
    Copyright (C) 2010 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".
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/>...
    Reading symbols from /usr/bin/gbx3...done.
    (gdb)
    

  • Run the program until it crashes.

    (gdb) run
    Starting program: /usr/bin/gbx3
    ...
    Program received signal SIGSEGV, Segmentation fault.
    0x4011010e in select () from /lib/i686/libc.so.6
    (gdb)
    

  • Then type the 'bt' command to get the stack contents.

    (gdb) bt
    #0  0x4011010e in select () from /lib/i686/libc.so.6
    #1  0x408ae730 in typeinfo for QMotifStyle () from /usr/lib/qt3/lib/libqt-mt.so.3
    #2  0x4040e270 in QApplication::enter_loop() () from /usr/lib/qt3/lib/libqt-mt.so.3
    #3  0x401d5b0b in MyMainWindow::showModal() (this=0x81d56c0) at CWindow.cpp:770
    #4  0x401d4a8b in CWINDOW_show_modal(void*, void*) (_object=0x81cc7c8, _param=0xbffff4c0)
        at CWindow.cpp:222
    #5  0x0804f624 in EXEC_call_native (exec=0x401d4a60 <CWINDOW_show_modal(void*, void*)>,
        object=0x81cc7c8, param=0xbffff4c0 "rubbish", type=4) at exec.c:592
    #6  0x0804f79f in EXEC_native () at exec.c:643
    #7  0x08050da3 in EXEC_loop () at exec_loop.c:1019
    #8  0x0804f418 in EXEC_function_real (keep_ret_value=0 '\0') at exec.c:505
    #9  0x08066ad6 in main (argc=1, argv=0xbffff814) at gbx.c:246
    #10 0x40061082 in __libc_start_main () from /lib/i686/libc.so.6
    (gdb)
    

Now send me the previous list so that I could understand what happened. Note that the previous example was not a real crash...

6. Reporting a crash (a segmentation fault, or a signal #11) with valgrind

Sometimes, the program crashes a long time after the bug has been encountered. Then the stack backtrace is not useful.

Hopefully, valgrind is there!

valgrind allows you to instrumentate any program. It runs it inside a CPU-emulator, and can detect any memory bug as soon as it is encountered. Of course, a program run inside valgrind is then a lot slower, but hey!...

Do not forget to install valgrind. It may not be installed by default on your system.

You have to compile Gambas with debugging information enabled, which is normally the default.

To run your gambas project in valgrind, do the following:

  • Open a terminal, and go to the directory of the project that crashes.

    $ cd /path/to/my/gambas/project
    

If the IDE crashes, go to the IDE sources in the app/src/gambas3 directory of the source package. Do not forget to compile the IDE if needed. For example:

$ cd ~/gambas3-xxx/app/src/gambas3
$ gbc3 -agt

  • Then run the project inside valgrind that way:

    $ valgrind --tool=memcheck --num-callers=50 gbx3 > valgrind.out 2>&1
    

Beware that valgrind will try to continue the program, even if it segfaults, until it really has to stop. So you may have to stop the program manually by hitting CTRL+C if you know that the bug has been reached.

Once done, send me the valgrind.out file.

Thanks in advance for all the information you can gather!