Gambas segfaults on PPC

Bug #2616 reported by Arne Caspari
8
Affects Status Importance Assigned to Milestone
gambas (Debian)
Fix Released
Unknown
gambas (Ubuntu)
Fix Released
Medium
MOTU

Bug Description

My system is: Ubuntu-Breezy-PPC.

Trying to run 'gambas' just results in "segmentation fault".

Revision history for this message
Arne Caspari (arne-datafloater) wrote : Gambas just segfaults

My system is: Ubuntu-Breezy-PPC.

Trying to run 'gambas' just results in "segmentation fault".

Changed in gambas:
assignee: nobody → motu
Revision history for this message
JuanConde (juan-conde) wrote :

The same for me.

Revision history for this message
Daniel Holbach (dholbach) wrote :

Thanks for your bug report. Could you get a backtrace by following the steps on http://wiki.ubuntu.com/DebuggingProgramCrash please and attach it here?

Revision history for this message
JuanConde (juan-conde) wrote :
Download full text (5.8 KiB)

Following the indications of Daniel Holbach I have learned some things:
The command gambas is a kind of script that runs gbx -x, the gambas intepreter in archive mode (all the project contained in a file).

The interpreter, gbx, works OK with some example files (included in gambas pkg) that I have tested.

Is the gambas project (the IDE, a gambas program itself) what is broken.

Gambas has its own debugging mode - I must learn its basic ussage - so, probably there's no much use in gdb backtrace.

Running gbx gambas from the app directory in the source tree of gambas, it crashes with a message:
ERROR: #2: Cannot load class 'Project': Unable to load class file
QSettings::sync: filename is null/empty

I don't know if it's meaningfull enough, but it's something more than a SegFault, isn't it?

Anyway, the output of gdb, following the instructions above instruction follows:

juan@ibook:/$ gdb gbx
GNU gdb 6.3-debian
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "powerpc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) handle SIG33 pass nostop noprint
Signal Stop Print Pass to program Description
SIG33 No No Yes Real-time event 33
(gdb) run -x /usr/bin/gambas
Starting program: /usr/bin/gbx -x /usr/bin/gambas
Qt: gdb: -nograb added to command-line options.
         Use the -dograb option to enforce grabbing.

Program received signal SIGSEGV, Segmentation fault.
0x0f4ba754 in ?? ()
(gdb) bt
#0 0x0f4ba754 in ?? ()
#1 0x100045d0 in key_equal_binary (key_comp=0x101d63b8 "",
    key=0x1 <Address 0x1 out of bounds>, len=0) at gbx_hash.c:68
#2 0x10004c0c in hash_table_lookup_node (hash_table=0x101fe338,
    key=0x1 <Address 0x1 out of bounds>, len=0) at gbx_hash.c:194
#3 0x10004cf8 in HASH_TABLE_insert (hash_table=0x101fe338,
    key=0x1 <Address 0x1 out of bounds>, len=0) at gbx_hash.c:216
#4 0x100381d8 in collection_add_key (col=0x101fbb40,
    key=0x1 <Address 0x1 out of bounds>, len=0) at gbx_c_collection.c:70
#5 0x100387f8 in collection_put (_object=0x101fbb40, _param=0x100634b0)
    at gbx_c_collection.c:238
#6 0x1000a1a8 in EXEC_call_native (exec=0x10038754 <collection_put>,
    object=0x101fbb40, type=0, param=0x100634b0) at gbx_exec.c:650
#7 0x1000a78c in EXEC_native () at gbx_exec.c:757
#8 0x1000b0cc in EXEC_spec (special=3, class=0x1005e508, object=0x101fbb40,
    nparam=2, drop=0 '\0') at gbx_exec.c:975
#9 0x1000d8d0 in EXEC_pop_array () at gbx_exec_pop.c:275
#10 0x1000df1c in EXEC_loop () at gbx_exec_loop.c:713
#11 0x10009e88 in EXEC_function_real (keep_ret_value=0 '\0') at gbx_exec.c:550
#12 0x1000af18 in EXEC_public (class=0x101eec10, object=0x0,
    name=0x10041c60 "_init", nparam=0) at gbx_exec.c:932
#13 0x10017728 in CLASS_load_real (class=0x101eec10) at gbx_class_load.c:681
#14 0x1000b534 in EXEC_new () at gbx_exec.c:1118
---Type <return> to continue, or q <r...

Read more...

Revision history for this message
JuanConde (juan-conde) wrote :

Running in debugger mode gdx -g gambas gives no further information; the interpreter exits with the same message:

$ gbx -g gambas
Welcome to the Gambas Debugger.
?
:s
ERROR: #2: Cannot load class 'Project': Unable to load class file
QSettings::sync: filename is null/empty
$

Revision history for this message
JuanConde (juan-conde) wrote :

Running strace gbx gambas from the app directory of the source tree shows that it triies to open app/gambas/.gambas/PROJECT just before giving the error message and crashing.

Creating the .gambas dir and an empty file named PROJECT makes the error message to change into:

ERROR: #2: Cannot load class 'Project': Bad header
*** glibc detected *** free(): invalid next size (fast): 0x1015b1b8 ***
Abortado

So, it seems that gbx expects to find a class file in the mentioned place; on Monday, back my job, I'll look for it in a working (i386) install of gambas on Breeezy.

Revision history for this message
In , Frank Gevaerts (frank-gevaerts) wrote : gambas: still segfaults on powerpc

Package: gambas
Version: 1.0.13-1
Followup-For: Bug #281491

gambas still doesn't work on powerpc. I'll attach the strace output.

Frank

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: powerpc (ppc)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14-1-powerpc
Locale: LANG=C, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages gambas depends on:
ii alien 8.60 install non-native packages with d
ii fakeroot 1.5.6 Gives a fake root environment
ii gambas-doc 1.0.13-1 Free VB-like language
ii gambas-gb-compress 1.0.13-1 The Gambas compression component
ii gambas-gb-db 1.0.13-1 The Gambas database component
ii gambas-gb-debug 1.0.13-1 The debugger helper component for
ii gambas-gb-eval 1.0.13-1 The Gambas expression evaluator co
ii gambas-gb-net 1.0.13-1 The Gambas networking component
ii gambas-gb-net-curl 1.0.13-1 The Gambas advanced networking com
ii gambas-gb-qt 1.0.13-1 The Gambas Qt GUI component
ii gambas-gb-qt-editor 1.0.13-1 The Gambas source code editor comp
ii gambas-gb-qt-ext 1.0.13-1 The Gambas extended Qt GUI compone
ii gambas-gb-sdl 1.0.13-1 The Gambas SDL component
ii gambas-gb-vb 1.0.13-1 The Gambas Visual Basic (tm) compa
ii gambas-gb-xml 1.0.13-1 The Gambas Visual Basic (tm) compa
ii libc6 2.3.5-8 GNU C Library: Shared libraries an

gambas recommends no packages.

-- no debconf information

Revision history for this message
Guillermo Gutiérrez (capitanterrex) wrote : Re: Gambas just segfaults

also gambas is broken in dapper amd64.

Changed in gambas:
status: Unconfirmed → Confirmed
Revision history for this message
In , José L. Redrejo Rodríguez (jredrejo) wrote : merge bugs

severity 281491 important
merge 281491 353136 302998
thanks

Revision history for this message
In , José L. Redrejo Rodríguez (jredrejo) wrote : Re: Bug#281491: gambas: still segfaults on powerpc

These bugs was due to endianess problems in gambas in some
architectures. According to the upstream author, they have been solved
in version 1.0.14.
I don't have available any of these architectures to test it, so please,
check the new 1.0.15 version available in Debian and confirm to me if
the bug has been solved or not.
Thanks

Revision history for this message
In , Frank Gevaerts (frank-gevaerts) wrote :

On Sun, Apr 09, 2006 at 06:01:07PM +0200, José L. Redrejo Rodríguez wrote:
> These bugs was due to endianess problems in gambas in some
> architectures. According to the upstream author, they have been solved
> in version 1.0.14.
> I don't have available any of these architectures to test it, so please,
> check the new 1.0.15 version available in Debian and confirm to me if
> the bug has been solved or not.

It still segfaults. Let me know if I can provide further information.

Frank

> Thanks

--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan

Revision history for this message
In , José L. Redrejo Rodríguez (jredrejo) wrote :

El mar, 11-04-2006 a las 21:46 +0200, Frank Gevaerts escribió:
> On Sun, Apr 09, 2006 at 06:01:07PM +0200, José L. Redrejo Rodríguez wrote:
> > These bugs was due to endianess problems in gambas in some
> > architectures. According to the upstream author, they have been solved
> > in version 1.0.14.
> > I don't have available any of these architectures to test it, so please,
> > check the new 1.0.15 version available in Debian and confirm to me if
> > the bug has been solved or not.
>
> It still segfaults. Let me know if I can provide further information.
>
> Frank
>
> > Thanks
>

Hi Frank, I have being in contact with the upstream author, checking the
build logs and no error has being found for powerpc platform. Neither
the upstream author nor me have access to a powerpc architecture, so
could you send me a backtrace of the crash?

Revision history for this message
Antonio (netbix) wrote : Re: Gambas just segfaults

I have same problem on dapper amd64:

netbix@amd64x2:~$ gambas
sizeof(CLASS) = 256 !
ERROR: #51: Bad archive: Invalid argument

Revision history for this message
In , Frank Gevaerts (frank-gevaerts) wrote : Re: Bug#281491: gambas: still segfaults on powerpc
Download full text (6.4 KiB)

On Fri, Apr 21, 2006 at 08:32:49AM +0200, José L. Redrejo Rodríguez wrote:
> Hi Frank, I have being in contact with the upstream author, checking the
> build logs and no error has being found for powerpc platform. Neither
> the upstream author nor me have access to a powerpc architecture, so
> could you send me a backtrace of the crash?

I finally found time to work on this.
I compiled gambas (from the debian package) with -g, and got two
backtraces : one from GmbCrossword 0.8 (http://gmbcrossword.sf.net), and
one from gambas itself.

gmbcrossword:

gbx: swapping class Global
gbx: swapping class cCword

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 805456736 (LWP 30266)]
CSETTINGS_put (_object=0x10096a48, _param=<value optimized out>) at gbx_c_settings.c:133
133 c = key[i];
(gdb) bt
#0 CSETTINGS_put (_object=0x10096a48, _param=<value optimized out>) at gbx_c_settings.c:133
#1 0x1000680c in EXEC_call_native (exec=0x10, object=0x10096a48, type=0, param=0x10042b38) at gbx_exec.c:650
#2 0x10006b68 in EXEC_native () at gbx_exec.c:758
#3 0x10007164 in EXEC_spec (special=<value optimized out>, class=0x10042b38, object=0x10096a48, nparam=2, drop=0 '\0') at gbx_exec.c:977
#4 0x10008968 in EXEC_pop_array () at gbx_exec_pop.c:275
#5 0x10008da8 in EXEC_loop () at gbx_exec_loop.c:717
#6 0x100065f4 in EXEC_function_real (keep_ret_value=0 '\0') at gbx_exec.c:550
#7 0x1001e35c in main (argc=1, argv=0x7fc818a4) at gbx.c:274

gambas:

(gdb) bt
#0 0x0f458c64 in strncmp () from /lib/tls/libc.so.6
#1 0x10003580 in key_equal_binary (key_comp=0x101153a8 "", key=0x1 <Address 0x1 out of bounds>, len=0) at gbx_hash.c:68
#2 0x100038c0 in hash_table_lookup_node (hash_table=0x101b2268, key=0x1 <Address 0x1 out of bounds>, len=0) at gbx_hash.c:194
#3 0x100039a0 in HASH_TABLE_insert (hash_table=0x101153a8, key=0x1 <Address 0x1 out of bounds>, len=0) at gbx_hash.c:216
#4 0x10021ba4 in collection_add_key (col=0x101b42f0, key=0x1 <Address 0x1 out of bounds>, len=0) at gbx_c_collection.c:70
#5 0x10021ef0 in collection_put (_object=0x101153a8, _param=<value optimized out>) at gbx_c_collection.c:241
#6 0x1000680c in EXEC_call_native (exec=0, object=0x101153a8, type=0, param=0x0) at gbx_exec.c:650
#7 0x10006b68 in EXEC_native () at gbx_exec.c:758
#8 0x10007164 in EXEC_spec (special=<value optimized out>, class=0x1, object=0x101b42f0, nparam=2, drop=0 '\0') at gbx_exec.c:977
#9 0x10008968 in EXEC_pop_array () at gbx_exec_pop.c:275
#10 0x10008da8 in EXEC_loop () at gbx_exec_loop.c:717
#11 0x100065f4 in EXEC_function_real (keep_ret_value=0 '\0') at gbx_exec.c:550
#12 0x1000e4e8 in CLASS_load_real (class=0x101b3cb8) at gbx_class_load.c:702
#13 0x100074c4 in EXEC_new () at gbx_exec.c:1120
#14 0x100090d4 in EXEC_loop () at gbx_exec_loop.c:903
#15 0x100065f4 in EXEC_function_real (keep_ret_value=0 '\0') at gbx_exec.c:550
#16 0x1000e3ec in CLASS_load_without_init (class=0x1008ddd0) at gbx_class_load.c:685
#17 0x1000e4c0 in CLASS_load_real (class=0x101153a8) at gbx_class_load.c:699
#18 0x10006dcc in EXEC_object (val=0x100488e0, class=0x7f8d061c, object=0x7f8d0620, defined=0x7f8d0618 "\001\215\003?\020\b?") at gbx_exec.c:855
#19 0x10007...

Read more...

Revision history for this message
Rick Vargo (rick-vargo-gmail) wrote : Re: Gambas just segfaults
Download full text (3.6 KiB)

Same issue on dapper powerpc.

Valgrind output:
==18507== Memcheck, a memory error detector.
==18507== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==18507== Using LibVEX rev 1471, a library for dynamic binary translation.
==18507== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.
==18507== Using valgrind-3.1.0-Debian, a dynamic binary instrumentation framework.
==18507== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==18507==
==18507== My PID = 18507, parent PID = 6365. Prog and args are:
==18507== /usr/bin/gambas
==18507==
--18507--
--18507-- Command line
--18507-- /usr/bin/gambas
--18507-- Startup, with flags:
--18507-- -v
--18507-- --tool=memcheck
--18507-- --leak-check=full
--18507-- --num-callers=12
--18507-- --log-file=valgrind.log
--18507-- Contents of /proc/version:
--18507-- Linux version 2.6.15-21-powerpc (buildd@adare) (gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5)) #1 Fri Apr 21 16:45:38 UTC 2006
--18507-- Arch and subarch: PPC32, ppc32-int-fp-and-AV
--18507-- Valgrind library directory: /usr/lib/valgrind
--18507-- Reading syms from /lib/ld-2.3.6.so (0x4000000)
--18507-- Reading debug info from /lib/ld-2.3.6.so...
--18507-- ... CRC mismatch (computed 9ABB5F5A wanted 4422E0E1)
--18507-- object doesn't have a symbol table
--18507-- Reading syms from /usr/bin/gbx (0x10000000)
--18507-- object doesn't have a symbol table
--18507-- Reading syms from /usr/lib/valgrind/ppc32-linux/memcheck (0x70000000)
--18507-- object doesn't have a dynamic symbol table
--18507-- Reading suppressions file: /usr/lib/valgrind/default.supp
==18507== Conditional jump or move depends on uninitialised value(s)
==18507== at 0x400230C: (within /lib/ld-2.3.6.so)
==18507== by 0x4011430: (within /lib/ld-2.3.6.so)
==18507==
==18507== Conditional jump or move depends on uninitialised value(s)
==18507== at 0x400233C: (within /lib/ld-2.3.6.so)
==18507== by 0x4011430: (within /lib/ld-2.3.6.so)
==18507==
==18507== Conditional jump or move depends on uninitialised value(s)
==18507== at 0x4001F74: (within /lib/ld-2.3.6.so)
==18507== by 0x40023DC: (within /lib/ld-2.3.6.so)
==18507== by 0x4011430: (within /lib/ld-2.3.6.so)
--18507-- Reading syms from /usr/lib/valgrind/ppc32-linux/vgpreload_core.so (0xFFDF000)
--18507-- Reading syms from /usr/lib/valgrind/ppc32-linux/vgpreload_memcheck.so (0xFFB9000)
--18507-- Reading syms from /lib/libm-2.3.6.so (0xFF24000)
--18507-- Reading debug info from /lib/libm-2.3.6.so...
--18507-- ... CRC mismatch (computed 524C7A40 wanted 755343EE)
--18507-- object doesn't have a symbol table
--18507-- Reading syms from /lib/libdl-2.3.6.so (0xFF01000)
--18507-- Reading debug info from /lib/libdl-2.3.6.so...
--18507-- ... CRC mismatch (computed 124F6265 wanted 80FE5336)
--18507-- object doesn't have a symbol table
--18507-- Reading syms from /lib/libc-2.3.6.so (0xFDA0000)
--18507-- Reading debug info from /lib/libc-2.3.6.so...
--18507-- ... CRC mismatch (computed ABAA4494 wanted FEC191BF)
--18507-- object doesn't have a symbol table
--18507-- REDIR: 0xFE18B1C (rindex) redirected to 0...

Read more...

Revision history for this message
Vassilis Pandis (pandisv) wrote :

The amd64 issue appears to be not a crash. It just doesn't work. It has been filed as bug 46273.

The PPC issue has been also reported to debian, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=281491 . According to Debian, the PPC issue is known to developers and they believe it has been resolved, but it hasn't been. I have contacted upstream myself as well.

Changed in gambas:
status: Unknown → Unconfirmed
Revision history for this message
Vassilis Pandis (pandisv) wrote :

Upstream developer reports that they are aware of the problem, but cannot work on it because they don't have access to a PPC machine. If anybody is willing to provide a ssh account to Benoit Minisini, please contact him. Thanks.

Changed in gambas:
status: New → Fix Released
Changed in gambas:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.