[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql-win32
Subject:    mysql_init causes crash under cygwin
From:       Fabrice Marchal <fmarchal () inf ! ethz ! ch>
Date:       2004-02-24 16:11:24
Message-ID: 403B77AC.2060306 () inf ! ethz ! ch
[Download RAW message or body]

Hi,
I still have problems with mysql under cygwin. This very simple code 
crashes,
maybe it is a problem of gcc-3.3.1 because the problem disappears when
mysql_init is outside a new( ) call. Note that the code crashes *after*
the creator Connection() returns. It is impossible to trace the bug
with gdb and the stackdump reports a "corrupted stack"....not very helpful

#include <mysql.h>
#include <iostream>
using namespace std;

class Connection{
    MYSQL* mqlh;
public:
  Connection(){
    mqlh = mysql_init( NULL );
    cout << "OK" << endl;
  }
};

int main( int argc, char** args ){
    Connection* con = new Connection();
    // crashes here
}

-- 
========================================================================
Fabrice Marchal           http://www.inf.ethz.ch/~marchal 
fabrice.marchal@ieee.org  marchal@inf.ethz.ch         +41-(0)1-632-56-79
ETH Zurich, CoLab Computational Laboratory        FAX:+41-(0)1-632-17-03
========================================================================



-- 
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe:    http://lists.mysql.com/win32?unsub=mysql-win32@progressive-comp.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic