[Gambas-user] Segfault with rev 7562

adamnt42 at ...626... adamnt42 at ...626...
Thu Jan 7 05:26:49 CET 2016


I getting a segfault with gbr3.

It happens when running any executable archive including the IDE.

The gdb output is:
Program received signal SIGSEGV, Segmentation fault.
EXEC_special (special=11, class=0x80ac13c, object=0x813e68c, nparam=0, drop=1 '\001') at gbx_exec.c:1649
1649		if (CLASS_DESC_get_type(desc) == CD_STATIC_METHOD)
2: index = 0
1: desc = (CLASS_DESC *) 0x0

The routine in gbx_exec.c is : bool EXEC_special(int special, CLASS *class, void *object, int nparam, bool drop).
The introductory code is:
	CLASS_DESC *desc;
	short index = class->special[special];

	if (index == NO_SYMBOL)
		return TRUE;

	desc = CLASS_get_desc(class, index);

	if (CLASS_DESC_get_type(desc) == CD_STATIC_METHOD)

The problem is that index is 0, this is occurring invariably when an Object[] class is being initialised. The backtrace is:
(gdb) backtrace
#0  0x08078d4e in EXEC_special (special=11, class=0x80ac13c, object=0x813e68c, nparam=0, drop=1 '\001')
    at gbx_exec.c:1649
#1  0x08079acb in EXEC_new () at gbx_exec.c:1947
#2  0x08082ac4 in EXEC_loop () at gbx_exec_loop.c:916
#3  0x08076da5 in EXEC_function_loop () at gbx_exec.c:931
#4  0x0807763f in EXEC_function_real () at gbx_exec.c:895
#5  0x08051168 in CLASS_run_inits (class=0x813a994) at gbx_class_load.c:1287
#6  0x0805120e in CLASS_load_real (class=0x813a994) at gbx_class_load.c:1323
#7  0x08062f15 in ARCHIVE_load_exported_class (arch=0x80c8584, pass=1) at gbx_archive.c:192
#8  0x0807035b in COMPONENT_load_all_finish () at gbx_component.c:147
#9  0x08055da3 in PROJECT_load_finish () at gbx_project.c:486
#10 0x0806530c in init (file=file at ...2861...=0xbfffeeeb "./gambas3.gambas", argc=1, argv=0xbfffecc4) at gbx.c:103
#11 0x0804b390 in main (argc=1, argv=0xbfffecc4) at gbx.c:372

A bit more info:
(gdb) disp class->special
3: class->special = {12, -1, 21, 15, -1, 22, -1, -1, -1, -1, -1, 0}
(gdb) disp special
4: special = 11

i.e.  index = class->special[special] is the last entry in the class->special array.
and then
desc = CLASS_get_desc(class, index);

(gdb) disp desc
5: desc = (CLASS_DESC *) 0x0

Finally, It happens the second time that routine is called. The first call executes properly (the value of the "special" param is 0).

N.B. this is on a clean copy of the gambas source, not our local version.

Any other info needed?

regards
bruce




-- 
B Bruen <adamnt42 at ...3379... (sort of)>




More information about the User mailing list