Results 1 to 5 of 5

Thread: Segfault with libcod/mysql

  1. #1
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts

    Segfault with libcod/mysql

    Hey,

    I got a CoD2 installation kind of running from IzNoGoDs tutorial with libcod/mysql.
    Im using the linux 1.3 cracked lnxded file and compiled libcod myself on Ubuntu 14.04.4, x64.
    Also I got a running mysql-server on this machine, and can connect to the server and the mysql server fromother pc's as well (also through external IP's)

    When I try to run mysql, I'll get a segfault right after mysql_query()

    PHP Code:
    init()
    {
        
    wait 5;

        
    level.mysqlHandle mysql_reuse_connection();

        if( !
    isDefinedlevel.mysqlHandle ) )
        {
            
    hostname "1.2.3.4";
            
    username "bla";
            
    password "*******";
            
    database "games_cod2";
            
    port 3306;

            
    mysqlHandle mysql_init();
            
    mysqlResult mysql_real_connectmysqlHandle hostname username password database port );

            if( !
    mysqlResult )
            {
                
    iprintln"errno 1 = " mysql_errnomysqlHandle ) );
                
    iprintln"errno 2 = " mysql_errnomysqlHandle ) );

                
    mysql_closemysqlHandle );

                return;
            }

            
    level.mysqlHandle mysqlHandle;
        }

        
    iprintln"mysqlHandle: " level.mysqlHandle );

        
    queryString "INSERT INTO table3 ( lol ) VALUES ( 'LOLoLOL' )";

        
    querryErrorExists mysql_querylevel.mysqlHandle queryString );

        
    wait 1// I DO NOT GET HERE

        
    if( querryErrorExists )
        {
            
    iprintln"error in mysql_query" );

            return;
        }

        
    // skipped rest 
    the last lines in the terminal:

    PHP Code:
    WARNINGNon-localized Game Message string is not allowed to have letters in itMust be changed over to a localized string"mysqlHandle: 168752976"
    ./s.shline 2319809 Segmentation fault      (core dumpedLD_PRELOAD="./libcod/bin/libcod2_1_3.so" $cod $args 
    The table exists, and it also inserts the record in it as expected.

    Am I missing something?

    (If you need more infos, pls tell me how, its like my first time on lnx)

  2. #2
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    Well, it seems to be I'm missing some backticks here and there.
    PHP Code:
    "INSERT INTO `table3` ( `lol` ) VALUES ( `LOLoLOL` )" 
    I used regular single quotes before, without success. maybe my innocent mind was polluted by some windows formatting in SSMS. *insert Kappa-meme here*

  3. #3
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Next time display the actual error, it helps a lot
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  4. #4
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    Quote Originally Posted by IzNoGoD View Post
    Next time display the actual error, it helps a lot
    This was all I got in the terminal.
    Where is the full error located at? Maybe I've overlooked something

  5. #5
    Private Whiskas's Avatar
    Join Date
    Jan 2015
    Posts
    84
    Thanks
    69
    Thanked 20 Times in 17 Posts
    Quote Originally Posted by serthy View Post
    This was all I got in the terminal.
    Where is the full error located at? Maybe I've overlooked something
    dmesg command(linux) contains interesting informations.

Posting Permissions

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