[Gambas-user] Bug affecting to ShowModal

Jussi Lahtinen jussi.lahtinen at ...626...
Sun Aug 15 16:42:33 CEST 2010


Because of messiness, that program could do anything weird
(clarification is not ready yet).
Problem occurs when program is closing.
Here:

==4946== Memcheck, a memory error detector
==4946== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==4946== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for
copyright info
==4946== Command: gbx3
==4946==
==4946== Conditional jump or move depends on uninitialised value(s)
==4946==    at 0x405178: my_free (gb_alloc_temp.h:324)
==4946==    by 0x42B6EE: EXTERN_exit (gbx_extern.c:438)
==4946==    by 0x4216AD: main_exit (gbx.c:135)
==4946==    by 0x421E0E: main (gbx.c:391)
==4946==  Uninitialised value was created by a heap allocation
==4946==    at 0x4C284A8: malloc (vg_replace_malloc.c:236)
==4946==    by 0x405295: my_malloc (gb_alloc_temp.h:308)
==4946==    by 0x42B25C: get_function (gbx_extern.c:184)
==4946==    by 0x42B7A3: EXTERN_call (gbx_extern.c:243)
==4946==    by 0x42FA1F: EXEC_loop (gbx_exec_loop.c:1056)
==4946==    by 0x409DB5: EXEC_function_loop (gbx_exec.c:858)
==4946==    by 0x40A808: EXEC_function_real (gbx_exec.c:845)
==4946==    by 0x41C20B: raise_event (gbx_api.c:483)
==4946==    by 0x41C9E6: GB_Raise (gbx_api.c:583)
==4946==    by 0x60C6024: CButton::clicked() (CButton.cpp:690)
==4946==    by 0x60C5D09: CButton::qt_metacall(QMetaObject::Call, int,
void**) (CButton_moc.cpp:173)
==4946==    by 0x7E0CE3E: QMetaObject::activate(QObject*, QMetaObject
const*, int, void**) (in /usr/lib/libQtCore.so.4.6.2)
==4946==    by 0x784E5F1: QAbstractButton::clicked(bool) (in
/usr/lib/libQtGui.so.4.6.2)
==4946==    by 0x756886A: ??? (in /usr/lib/libQtGui.so.4.6.2)
==4946==    by 0x756970A: ??? (in /usr/lib/libQtGui.so.4.6.2)
==4946==    by 0x756997B:
QAbstractButton::mouseReleaseEvent(QMouseEvent*) (in
/usr/lib/libQtGui.so.4.6.2)
==4946==    by 0x7209581: QWidget::event(QEvent*) (in
/usr/lib/libQtGui.so.4.6.2)
==4946==    by 0x71B322B: QApplicationPrivate::notify_helper(QObject*,
QEvent*) (in /usr/lib/libQtGui.so.4.6.2)
==4946==    by 0x71B9ECA: QApplication::notify(QObject*, QEvent*) (in
/usr/lib/libQtGui.so.4.6.2)
==4946==    by 0x7DFA06B: QCoreApplication::notifyInternal(QObject*,
QEvent*) (in /usr/lib/libQtCore.so.4.6.2)
==4946==    by 0x71B90AD:
QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*,
QWidget*, QWidget**, QPointer<QWidget>&, bool) (in
/usr/lib/libQtGui.so.4.6.2)
==4946==    by 0x7238F64: ??? (in /usr/lib/libQtGui.so.4.6.2)
==4946==    by 0x72378AB: QApplication::x11ProcessEvent(_XEvent*) (in
/usr/lib/libQtGui.so.4.6.2)
==4946==    by 0x7264198: ??? (in /usr/lib/libQtGui.so.4.6.2)
==4946==    by 0x7DF8991:
QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (in
/usr/lib/libQtCore.so.4.6.2)
==4946==    by 0x7DF8D6B:
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (in
/usr/lib/libQtCore.so.4.6.2)
==4946==    by 0x60C32DD: MyMainWindow::showModal() (CWindow.cpp:1790)
==4946==    by 0x60C3353: CWINDOW_show_modal(void*, void*) (CWindow.cpp:698)
==4946==    by 0x408C93: EXEC_native_quick (gbx_exec.c:1084)
==4946==    by 0x42F808: EXEC_loop (gbx_exec_loop.c:970)
==4946==    by 0x409DB5: EXEC_function_loop (gbx_exec.c:858)
==4946==    by 0x40A808: EXEC_function_real (gbx_exec.c:845)
==4946==    by 0x421D2D: main (gbx.c:359)
==4946==
==4946==
==4946== HEAP SUMMARY:
==4946==     in use at exit: 6,599,259 bytes in 36,597 blocks
==4946==   total heap usage: 317,322 allocs, 280,725 frees,
552,830,515 bytes allocated
==4946==
==4946== LEAK SUMMARY:
==4946==    definitely lost: 15,304 bytes in 28 blocks
==4946==    indirectly lost: 57,616 bytes in 1,797 blocks
==4946==      possibly lost: 5,124,760 bytes in 27,867 blocks
==4946==    still reachable: 1,371,899 bytes in 6,622 blocks
==4946==         suppressed: 29,680 bytes in 283 blocks
==4946== Rerun with --leak-check=full to see details of leaked memory
==4946==
==4946== For counts of detected and suppressed errors, rerun with: -v
==4946== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 20 from 8)

Jussi


2010/8/15 Benoît Minisini <gambas at ...1...>:
>> Yes, after I wrote my mail, I figured it may be the case.
>> Problem is that my program is oriented to module.
>> It invokes forms when needed and shows with them what
>> happens inside of module.
>
> Yes. Maybe that automatic main window feature should be optional...
>
>>
>> Project I'm working on is big, old and messy. It is ported from vb6.
>> Now I'm trying to make code more clear, but I'm getting signal 11.
>> I can't send this project to you, but I'm trying to isolate the problem.
>> Do gdb outputs help you without source code?
>> However, here:
>>
>> Program received signal SIGSEGV, Segmentation fault.
>> my_free (alloc=0x1e1d150a1e1d150a) at ../share/gb_alloc_temp.h:333
>> 333           pool = (size / SIZE_INC) - 1;
>> (gdb) bt
>> #0  my_free (alloc=0x1e1d150a1e1d150a) at ../share/gb_alloc_temp.h:333
>> #1  0x000000000042b6ef in EXTERN_exit () at gbx_extern.c:438
>> #2  0x00000000004216ae in main_exit (silent=<value optimised out>) at
>> gbx.c:135 #3  0x0000000000421e0f in main (argc=1, argv=<value optimised
>> out>) at gbx.c:391
>>
>> Jussi
>>
>
> Yes, but not necessarily. If a bug corrupts memory, then the crash can occurs
> later, and then the backtrace is meaningless.
>
> The better is using valgrind and reproducing the crash. To do that, run your
> project that way:
>
> $ cd /path/to/my/project
> $ valgrind --tool=memcheck --num-callers=50 --track-origins=yes gbx3
> ...
>
> Do what is needed to get a crash, and then send me the valgrind output.
>
> Sometimes, the program won't crash, because valgrind always tries to continue
> even after a segmentation fault. Send me the valgrind output anyway!
>
> Regards,
>
> --
> Benoît Minisini
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>




More information about the User mailing list