Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: libcod on Arch Linux

  1. #1
    Mossaderator
    Join Date
    Nov 2012
    Posts
    299
    Thanks
    55
    Thanked 215 Times in 140 Posts

    libcod on Arch Linux

    Hi, i am trying to get libcod (with mysql) working on Arch Linux.
    I am using mariadb as mysql server.

    If you have got 64bit Arch. Then download the mysql client files from there. (delete libmysqlclient.so and libmysqlclient.so.18 and copy libmysqlclient.so.18.0.0 2 times and rename them as the 2 files you removed)
    https://www.archlinux.org/packages/e...mariadbclient/

    My startup line (no new lines otherwise the preloads are ignored)
    Code:
    LD_LIBRARY_PATH=/path/to/libs/:/path/to/libs/mysql LD_PRELOAD=/path/to/libs/libcod2_1_3.so ./cod2_lnxded +set dedicated "2" +exec server.cfg +map_rotate
    But now after starting cod2 it crashes. I am using my own build from source. (also kung's build from 30 August crashes)

    Error message from dmesg
    Code:
    [80191.481300] cod2_lnxded[6964]: segfault at 4 ip 00000000f770a37b sp 00000000ffae0820 error 4 in libcod2_1_3.so[f7702000+12000]
    Last edited by Mitch; 09-25-2013 at 05:17 PM.

  2. #2
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    Neuromatrix
    Posts
    1,396
    Thanks
    1,294
    Thanked 704 Times in 492 Posts
    since the instruction pointer (ip) is only valid in your .so, you need to upload it
    thats hilliariaraisouslyy

  3. #3
    Mossaderator
    Join Date
    Nov 2012
    Posts
    299
    Thanks
    55
    Thanked 215 Times in 140 Posts
    Quote Originally Posted by kung foo man View Post
    since the instruction pointer (ip) is only valid in your .so, you need to upload it
    I had to rebuild it, because i deleted it again when i was testing your build.
    Attached Files Attached Files

  4. #4
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    Neuromatrix
    Posts
    1,396
    Thanks
    1,294
    Thanked 704 Times in 492 Posts
    By the IP, it might be gsc_utils_ClientCommand() which is crashing, can you test it without this callback?

    Can you specify where it is crashing? Is libcod able to print some messages before crash or can't it start at all?
    thats hilliariaraisouslyy

  5. #5
    Mossaderator
    Join Date
    Nov 2012
    Posts
    299
    Thanks
    55
    Thanked 215 Times in 140 Posts
    Quote Originally Posted by kung foo man View Post
    By the IP, it might be gsc_utils_ClientCommand() which is crashing, can you test it without this callback?

    Can you specify where it is crashing? Is libcod able to print some messages before crash or can't it start at all?
    When i comment my persistence gsc out of my callbacksetup then it doesn't give me a segmentation fault. But when i add:

    Code:
    std\io::print("TEST");
    Then it crashes again.

  6. #6
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    Neuromatrix
    Posts
    1,396
    Thanks
    1,294
    Thanked 704 Times in 492 Posts
    Can you try to add many normal printf's to this function in https://github.com/kungfooman/libcod...master/gsc.cpp ?


    PHP Code:
    int cdecl_injected_closer()
    {
        
    int function;
        
    int playerid
    printf by printf you will get nearer to the buggy function.
    thats hilliariaraisouslyy

  7. #7
    Mossaderator
    Join Date
    Nov 2012
    Posts
    299
    Thanks
    55
    Thanked 215 Times in 140 Posts
    Quote Originally Posted by kung foo man View Post
    Can you try to add many normal printf's to this function in https://github.com/kungfooman/libcod...master/gsc.cpp ?


    PHP Code:
    int cdecl_injected_closer()
    {
        
    int function;
        
    int playerid
    printf by printf you will get nearer to the buggy function.
    It crashes here:
    PHP Code:
    printf("scriptengine> test b3\n");
        
        
        if (!
    stackGetParamInt(0, &function))
        {
            
    printf("scriptengine> ERROR: closer(): param \"function\"[0] has to be an integer!\n");
            return 
    0;
        }

        
    printf("scriptengine> test b4\n"); 
    It only shows 'scriptengine> test b3' and not the other 2 messages. (commenting the printf ...ERROR: closer().. out doesn't show the 'test b4' message.)
    Last edited by Mitch; 09-26-2013 at 09:09 PM.

  8. #8
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    Neuromatrix
    Posts
    1,396
    Thanks
    1,294
    Thanked 704 Times in 492 Posts
    The function is in https://github.com/kungfooman/libcod...master/gsc.cpp

    PHP Code:
    // todo: check if the parameter really exists (number_of_params)
    int stackGetParamInt(int paramint *value)
    {
        
    //printf("stackGetParamInt() start...");
        
    aStackElement *scriptStack = *(aStackElement**)getStack();
        
    aStackElement *arg scriptStack param;
        if (
    arg->type != STACK_INT)
            return 
    0;
        *
    value = (int)arg->offsetData;
        
    //printf("... end\n");
        
    return 1;

    Now check in detail where it is crashing
    thats hilliariaraisouslyy

  9. #9
    Mossaderator
    Join Date
    Nov 2012
    Posts
    299
    Thanks
    55
    Thanked 215 Times in 140 Posts
    Quote Originally Posted by kung foo man View Post
    The function is in https://github.com/kungfooman/libcod...master/gsc.cpp

    PHP Code:
    // todo: check if the parameter really exists (number_of_params)
    int stackGetParamInt(int paramint *value)
    {
        
    //printf("stackGetParamInt() start...");
        
    aStackElement *scriptStack = *(aStackElement**)getStack();
        
    aStackElement *arg scriptStack param;
        if (
    arg->type != STACK_INT)
            return 
    0;
        *
    value = (int)arg->offsetData;
        
    //printf("... end\n");
        
    return 1;

    Now check in detail where it is crashing
    PHP Code:
    int stackGetParamInt(int paramint *value)
    {
        
    //printf("stackGetParamInt() start...");
        
    printf("scriptengine> test c1\n");
        
    aStackElement *scriptStack = *(aStackElement**)getStack();
        
    printf("scriptengine> test c2\n");
        
    aStackElement *arg scriptStack param;
        
    printf("scriptengine> test c3\n");
        if (
    arg->type != STACK_INT)
            return 
    0;
        
    printf("scriptengine> test c4\n");
        *
    value = (int)arg->offsetData;
        
    printf("scriptengine> test c5\n");
        
    //printf("... end\n");
        
    return 1;

    It prints c1, c2 and c3.

  10. #10
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    Neuromatrix
    Posts
    1,396
    Thanks
    1,294
    Thanked 704 Times in 492 Posts
    It can be either the dereferencing of value for writing (would be very strange) or the dereferencing of arg for reading.

    Try:


    PHP Code:
    printf("scriptengine> test c4 value=%.8x scriptStack=%.8x arg=%.8x\n"valuescriptStackarg); 
    thats hilliariaraisouslyy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •