Jump to content
  • 0

Segfault in script.c because of a script


chriser

Question


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  94
  • Reputation:   4
  • Joined:  01/29/13
  • Last Seen:  

Hi guys,

 

I updated to the latest version last weekend, and i launched the update yesterday.

The server always crashes when this script is executed:

	for(.@i=0;.@i<5;.@i=.@i+1)
	{
		L_Again:
		sleep2 1;
		.@rnd = rand(1,10);
		if(callfunc("inarray",.@rnd,.@qu)) goto L_Again;
		.@qu[.@i] = .@rnd;
		mes ".........";
	}

Here is my full bt:

Program received signal SIGSEGV, Segmentation fault.
0x00000000004e1f9c in get_val.part.41 (data=0x7fffe1ebfc5c, st=0x7fffe66bbea4)
    at script.c:2732
2732						data->u.num = (int)idb_iget(n,reference_getuid(data));
(gdb) bt full
#0  0x00000000004e1f9c in get_val.part.41 (data=0x7fffe1ebfc5c, 
    st=0x7fffe66bbea4) at script.c:2732
        n = 0xfdfdfdfdfdfdfdfd
        name = 0x7dec619 ".@rnd"
        prefix = 46 '.'
        postfix = 100 'd'
        sd = 0x0
#1  get_val (st=0x7fffe66bbea4, data=0x7fffe1ebfc5c) at script.c:2604
        __FUNCTION__ = "get_val"
        __FUNCTION__ = "get_val"
#2  0x00000000004e1748 in conv_num (st=0x7fffe66bbea4, data=0x7fffe1ebfc5c)
    at script.c:2915
        p = 0x7fffffffdd80 " \336\377\377\377\177"
        num = 6336753
        __FUNCTION__ = "conv_num"
        __FUNCTION__ = "conv_num"
#3  0x00000000004dca46 in buildin_jump_zero (st=0x7fffe66bbea4)
    at script.c:13414
        sel = 0
#4  0x00000000005dddf1 in run_func (st=0x7fffe66bbea4) at script.c:3583
        data = 0x7fffe1ebfc2c
        i = 1
        start_sp = 0
        end_sp = 4
        func = 341
#5  0x00000000005382a4 in run_script_main (st=0x7fffe66bbea4) at script.c:3818
        c = C_FUNC
        cmdcount = 655273
        gotocount = 655357
        sd = 0x7fffffffdfb0
        stack = 0x7fffe1c88d0c
#6  0x0000000000537cc7 in run_script_timer (tid=69, tick=77311478, id=150086, 
    data=140737059208868) at script.c:3700
        st = 0x7fffe66bbea4
        node = 0x7fffe1c8904c
        sd = 0x7ec0170
#7  0x0000000000516fda in do_timer (tick=77311528) at timer.c:371
        tid = 69
        diff = -50
        __FUNCTION__ = "do_timer"
#8  main (argc=1, argv=0x7fffffffe408) at core.c:375
        next = 50

I temporarly removed the random array filling and just filled the .@qu array with fixed values, but that can't be the final solution, because this is the index list of questions, which should be random.

My script.c is almost completely stock, i only added one function which is working properly and has nothing to do with that.

Any ideas? 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  94
  • Reputation:   4
  • Joined:  01/29/13
  • Last Seen:  

bump.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  94
  • Reputation:   4
  • Joined:  01/29/13
  • Last Seen:  

bump. getting this error again on a different script now, but i don't know which one.

Program terminated with signal 11, Segmentation fault.
#0  0x00000000004e3149 in get_val.part.41 (data=0x7f76b7074b4c, st=0x7f76b60111ec) at script.c:2733
2733						data->u.num = (int)idb_iget(n,reference_getuid(data));
(gdb) bt full
#0  0x00000000004e3149 in get_val.part.41 (data=0x7f76b7074b4c, st=0x7f76b60111ec) at script.c:2733
        n = 0xfdfdfdfdfdfdfdfd
        name = 0x99e118a ".@id"
        prefix = 46 '.'
        postfix = 100 'd'
        sd = 0x0
#1  get_val (st=0x7f76b60111ec, data=0x7f76b7074b4c) at script.c:2605
        __FUNCTION__ = "get_val"
        __FUNCTION__ = "get_val"
#2  0x00000000004e28f5 in conv_num (st=0x7f76b60111ec, data=0x7f76b7074b4c) at script.c:2916
        p = 0x7fff89f18c80 " \215\361\211\377\177"
        num = 6340990
        __FUNCTION__ = "conv_num"
        __FUNCTION__ = "conv_num"
#3  0x00000000004ddbf3 in buildin_jump_zero (st=0x7f76b60111ec) at script.c:13418
        sel = 0
#4  0x00000000005ee40d in run_func (st=0x7f76b60111ec) at script.c:3584
        data = 0x7f76b7074b1c
        i = 2
        start_sp = 1
        end_sp = 5
        func = 349
#5  0x0000000000528f16 in run_script_main (st=0x7f76b60111ec) at script.c:3819

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  94
  • Reputation:   4
  • Joined:  01/29/13
  • Last Seen:  

bump. anyone? devs?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  94
  • Reputation:   4
  • Joined:  01/29/13
  • Last Seen:  

does noone have a clue about this? o.o

it seems that this functionality causes the crash:

L_Again:
sleep2 1;
.@sth = rand(10);
if(.@sth == 0) goto L_Again;

If .@sth is 0, the server crashes...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...