Thread: [Sqlrelay-discussion] mysql 4.1 client segfaults after first successful command
Brought to you by:
mused
From: Guy B. <gbe...@te...> - 2005-08-05 23:00:35
Attachments:
signature.asc
|
I'm doing "export LD_PRELOAD=/usr/lib/libmysql41sqlrelay.so", with mysql 4.1.12 on Fedora Core release 3.92 (Pre-FC4). I can connect to sqlrelay on another host on port 9000, read a bunch of rows out of any table successfully, but immediately after my first query, mysql segfaults. In my sqlr-connection logs I see, corresponding to this segfault, an error as follows: 08/05/2005 15:49:48 PDT connection [12233] : done returning result set data 08/05/2005 15:49:48 PDT connection [12233] : getting command... 08/05/2005 15:49:49 PDT connection [12233] : getting command failed: client sent bad command 08/05/2005 15:49:49 PDT connection [12233] : endingsession... 08/05/2005 15:49:49 PDT connection [12233] : aborting all busy cursors... 08/05/2005 15:49:49 PDT connection [12233] : 0 08/05/2005 15:49:49 PDT connection [12233] : done aborting all busy cursors 08/05/2005 15:49:49 PDT connection [12233] : resetting autocommit behavior... I'd like to figure out how to make multiple queries during a single mysql session, without any unsightly segfaults. Thanks in advance for any help! |
From: vieonet f. <df...@vi...> - 2005-08-07 12:43:41
|
Hello I installed fedora core 4, and intall sqlrelay package FC4. I configure, and start sqlrelay. It started well, creating 3 connection to postgres database. I install the php extension, which is well recocgnised in the php.ini. But when I try to connect to the database, I got hte following message: "could not connect listener". I check in my tmp directory and the socket is well here. please help regards david |
From: David M. <dav...@fi...> - 2005-08-08 00:53:31
|
Are the permissions on the socket and the /tmp directory such that php can access the socket? Also, FC4 comes with selinux enabled by default, it's possible that the security settings for apache are too restrictive. Are you using selinux? I have had problems with selinux restricting so many applications in so many funny ways that I have had to just turn it off until I can study up on it and figure out how to get things working with it. By the way, if someone could point me in the direction of a good selinux tutorial, I'd appreciate it. David Muse dav...@fi... On Sun, 2005-08-07 at 14:43 +0200, vieonet forums wrote: > Hello > > I installed fedora core 4, and intall sqlrelay package FC4. > > I configure, and start sqlrelay. > > It started well, creating 3 connection to postgres database. > > I install the php extension, which is well recocgnised in the php.ini. > > But when I try to connect to the database, I got hte following message: > "could not connect listener". > > I check in my tmp directory and the socket is well here. > > please help > > regards > > david > > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Sqlrelay-discussion mailing list > Sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > |
From: david f. <df...@vi...> - 2005-08-13 10:30:35
|
Hello I made the following change in the sqlrelay.php : function connect($dsninfo, $persistent = false) { $hasloadextension = false; //here I escape a useless loop replacing with the function if(method_exists($this,'loadExtension')) { $hasloadextension = true; } if ($hasloadextension == true) { if (!PEAR::loadExtension('sql_relay')) { return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND); } } else { if (!DB::assertExtension('sql_relay')) { return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND); } } $this->dsn = $dsninfo; $retrytime = 1; $tries = 5; //Here I replace the variable by the array $dsninfo, this escape to allocate useless memory to duplicate variable $this->connection = sqlrcon_alloc($dsninfo['hostspec'], $dsninfo['port'], $dsninfo['socket'], $dsninfo['username'], $dsninfo['password'], $retrytime, $tries); //sqlrcon_debugOn($this->connection); return DB_OK; } regards david |
From: david f. <df...@vi...> - 2005-08-13 10:56:28
|
I got the following error : Warning: Illegal offset type in unset in /usr/share/pear/DB/sqlrelay.php on line 416 the code their is the following : // $sqlrcursor is a prepared query handle $sqlrcursor = (int)$sqlrcursor; 416-> if (!isset($this->prepare_tokens[$sqlrcursor])) { return false; } as you see this is the tested case when a query has been prepared. But concerning the class prepare, it seems that you overwrite the class like that : function prepare($query) { $cursor = sqlrcur_alloc($this->connection); sqlrcur_setResultSetBufferSize($cursor,100); sqlrcur_prepareQuery($cursor, $query); return new DB_sqlrelay_cursor($cursor,$this->connection); } looking at this code we see that you do not call the prepare method describe in common.php. And by it, you do not declare any more a value for ($this->prepare_tokens). I don't sure at 100% but I suppose the matter is there. If you could provide a new version correcting this. thanks in advance regards david |
From: David M. <dav...@fi...> - 2005-08-26 03:24:34
|
I applied your patches and I believe I've fixed this issue now too. You might give http://www.firstworks.com/sqlrelay-0.37pre2.tar.gz a try, or just extract the php pear db driver from src/api/phppeardb/sqlrelay.php from it and try it with the your current version. Dave dav...@fi... On Sat, 2005-08-13 at 12:56 +0000, david forums wrote: > I got the following error : > Warning: Illegal offset type in unset in /usr/share/pear/DB/sqlrelay.php > on line 416 > > the code their is the following : > // $sqlrcursor is a prepared query handle > $sqlrcursor = (int)$sqlrcursor; > 416-> if (!isset($this->prepare_tokens[$sqlrcursor])) { > return false; > } > > as you see this is the tested case when a query has been prepared. > > But concerning the class prepare, it seems that you overwrite the class > like that : > function prepare($query) > { > $cursor = sqlrcur_alloc($this->connection); > sqlrcur_setResultSetBufferSize($cursor,100); > sqlrcur_prepareQuery($cursor, $query); > return new DB_sqlrelay_cursor($cursor,$this->connection); > } > > looking at this code we see that you do not call the prepare method > describe in common.php. > > And by it, you do not declare any more a value for ($this->prepare_tokens). > > > I don't sure at 100% but I suppose the matter is there. > > If you could provide a new version correcting this. > > thanks in advance > > regards > > david > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Sqlrelay-discussion mailing list > Sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > |
From: david f. <df...@vi...> - 2005-11-26 16:07:02
|
I got the folowing error with 0.36.4 version, with pear module working. Fatal error: Uncaught exception 'Exception' with message 'DB Error: unknown error [nativecode=ERREUR: erreur de syntaxe sur ou près de «Monsieur» at character 56 Attempted Query: INSERT INTO civility (l_id,c_libelle,c_id) VALUES (:l_id,:c_libelle,:c_id)] I got the same message with all binds request. I have 2 computer on one the same script work fine but not with the other. It seems that I did not have the same sqlrelay version on both. Please help Regards David |
From: David M. <dav...@fi...> - 2005-08-08 01:53:56
|
Yeah, looks like a bug. I just reproduced it. I'll track it down and get a fix out. David Muse dav...@fi... On Fri, 2005-08-05 at 16:00 -0700, Guy Berliner wrote: > I'm doing "export LD_PRELOAD=/usr/lib/libmysql41sqlrelay.so", with mysql > 4.1.12 on Fedora Core release 3.92 (Pre-FC4). I can connect to sqlrelay > on another host on port 9000, read a bunch of rows out of any table > successfully, but immediately after my first query, mysql segfaults. In > my sqlr-connection logs I see, corresponding to this segfault, an error > as follows: > > 08/05/2005 15:49:48 PDT connection [12233] : done returning result set data > 08/05/2005 15:49:48 PDT connection [12233] : getting command... > 08/05/2005 15:49:49 PDT connection [12233] : getting command failed: > client sent bad command > 08/05/2005 15:49:49 PDT connection [12233] : endingsession... > 08/05/2005 15:49:49 PDT connection [12233] : aborting all busy cursors... > 08/05/2005 15:49:49 PDT connection [12233] : 0 > 08/05/2005 15:49:49 PDT connection [12233] : done aborting all busy cursors > 08/05/2005 15:49:49 PDT connection [12233] : resetting autocommit > behavior... > > I'd like to figure out how to make multiple queries during a single > mysql session, without any unsightly segfaults. Thanks in advance for > any help! > |
From: David M. <dav...@fi...> - 2005-08-08 03:34:48
|
Ok, fixed it. If you're willing to compile from source, here's the fix: edit src/api/mysql/mysql.C and change: unsigned long *mysql_fetch_lengths(MYSQL_RES *result) { return (unsigned long *)result->sqlrcur-> getRowLengths(result->currentrow); } to: unsigned long *mysql_fetch_lengths(MYSQL_RES *result) { return (unsigned long *)result->sqlrcur-> getRowLengths(result->previousrow); } That's the fix. Dave dav...@fi... On Sun, 2005-08-07 at 21:57 -0400, David Muse wrote: > Yeah, looks like a bug. I just reproduced it. I'll track it down and > get a fix out. > > David Muse > dav...@fi... > > On Fri, 2005-08-05 at 16:00 -0700, Guy Berliner wrote: > > I'm doing "export LD_PRELOAD=/usr/lib/libmysql41sqlrelay.so", with mysql > > 4.1.12 on Fedora Core release 3.92 (Pre-FC4). I can connect to sqlrelay > > on another host on port 9000, read a bunch of rows out of any table > > successfully, but immediately after my first query, mysql segfaults. In > > my sqlr-connection logs I see, corresponding to this segfault, an error > > as follows: > > > > 08/05/2005 15:49:48 PDT connection [12233] : done returning result set data > > 08/05/2005 15:49:48 PDT connection [12233] : getting command... > > 08/05/2005 15:49:49 PDT connection [12233] : getting command failed: > > client sent bad command > > 08/05/2005 15:49:49 PDT connection [12233] : endingsession... > > 08/05/2005 15:49:49 PDT connection [12233] : aborting all busy cursors... > > 08/05/2005 15:49:49 PDT connection [12233] : 0 > > 08/05/2005 15:49:49 PDT connection [12233] : done aborting all busy cursors > > 08/05/2005 15:49:49 PDT connection [12233] : resetting autocommit > > behavior... > > > > I'd like to figure out how to make multiple queries during a single > > mysql session, without any unsightly segfaults. Thanks in advance for > > any help! > > > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Sqlrelay-discussion mailing list > Sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > |
From: Guy B. <gbe...@te...> - 2005-08-10 03:22:42
Attachments:
signature.asc
|
Yes, that fixed it. Thank you very much! David Muse wrote: > Ok, fixed it. If you're willing to compile from source, here's the fix: > > edit src/api/mysql/mysql.C and change: > > unsigned long *mysql_fetch_lengths(MYSQL_RES *result) { > return (unsigned long *)result->sqlrcur-> > getRowLengths(result->currentrow); > } > > to: > > unsigned long *mysql_fetch_lengths(MYSQL_RES *result) { > return (unsigned long *)result->sqlrcur-> > getRowLengths(result->previousrow); > } > > That's the fix. > > Dave > dav...@fi... > > > On Sun, 2005-08-07 at 21:57 -0400, David Muse wrote: > >>Yeah, looks like a bug. I just reproduced it. I'll track it down and >>get a fix out. >> >>David Muse >>dav...@fi... >> >>On Fri, 2005-08-05 at 16:00 -0700, Guy Berliner wrote: >> >>>I'm doing "export LD_PRELOAD=/usr/lib/libmysql41sqlrelay.so", with mysql >>>4.1.12 on Fedora Core release 3.92 (Pre-FC4). I can connect to sqlrelay >>>on another host on port 9000, read a bunch of rows out of any table >>>successfully, but immediately after my first query, mysql segfaults. In >>>my sqlr-connection logs I see, corresponding to this segfault, an error >>>as follows: >>> >>>08/05/2005 15:49:48 PDT connection [12233] : done returning result set data >>>08/05/2005 15:49:48 PDT connection [12233] : getting command... >>>08/05/2005 15:49:49 PDT connection [12233] : getting command failed: >>>client sent bad command >>>08/05/2005 15:49:49 PDT connection [12233] : endingsession... >>>08/05/2005 15:49:49 PDT connection [12233] : aborting all busy cursors... >>>08/05/2005 15:49:49 PDT connection [12233] : 0 >>>08/05/2005 15:49:49 PDT connection [12233] : done aborting all busy cursors >>>08/05/2005 15:49:49 PDT connection [12233] : resetting autocommit >>>behavior... >>> >>>I'd like to figure out how to make multiple queries during a single >>>mysql session, without any unsightly segfaults. Thanks in advance for >>>any help! >>> >> >> >> >>------------------------------------------------------- >>SF.Net email is Sponsored by the Better Software Conference & EXPO >>September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices >>Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA >>Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf >>_______________________________________________ >>Sqlrelay-discussion mailing list >>Sql...@li... >>https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion >> > > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Sqlrelay-discussion mailing list > Sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion |
From: david f. <df...@vi...> - 2005-08-08 07:53:55
|
Hi david Good shoot !! It was selinux who made the mess. tx @+ Le Mon, 08 Aug 2005 02:57:31 +0200, David Muse <dav...@fi...> a écrit: > Are the permissions on the socket and the /tmp directory such that php > can access the socket? Also, FC4 comes with selinux enabled by default, > it's possible that the security settings for apache are too restrictive. > Are you using selinux? > > I have had problems with selinux restricting so many applications in so > many funny ways that I have had to just turn it off until I can study up > on it and figure out how to get things working with it. > > By the way, if someone could point me in the direction of a good selinux > tutorial, I'd appreciate it. > > David Muse > dav...@fi... > > On Sun, 2005-08-07 at 14:43 +0200, vieonet forums wrote: >> Hello >> >> I installed fedora core 4, and intall sqlrelay package FC4. >> >> I configure, and start sqlrelay. >> >> It started well, creating 3 connection to postgres database. >> >> I install the php extension, which is well recocgnised in the php.ini. >> >> But when I try to connect to the database, I got hte following message: >> "could not connect listener". >> >> I check in my tmp directory and the socket is well here. >> >> please help >> >> regards >> >> david >> >> >> >> >> ------------------------------------------------------- >> SF.Net email is Sponsored by the Better Software Conference & EXPO >> September 19-22, 2005 * San Francisco, CA * Development Lifecycle >> Practices >> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & >> QA >> Security * Process Improvement & Measurement * >> http://www.sqe.com/bsce5sf >> _______________________________________________ >> Sqlrelay-discussion mailing list >> Sql...@li... >> https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion >> > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle > Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & > QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Sqlrelay-discussion mailing list > Sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > |
From: Firstworks/4access <dav...@fi...> - 2005-08-08 14:38:06
|
Yay! Glad to know that was all it was. Dave On Mon, 2005-08-08 at 09:53 +0200, david forums wrote: > Hi david >=20 > Good shoot !! >=20 >=20 > It was selinux who made the mess. >=20 >=20 > tx >=20 > @+ >=20 >=20 > Le Mon, 08 Aug 2005 02:57:31 +0200, David Muse <david.muse@firstworks.c= om> =20 > a =C3=A9crit: >=20 > > Are the permissions on the socket and the /tmp directory such that ph= p > > can access the socket? Also, FC4 comes with selinux enabled by defau= lt, > > it's possible that the security settings for apache are too restricti= ve. > > Are you using selinux? > > > > I have had problems with selinux restricting so many applications in = so > > many funny ways that I have had to just turn it off until I can study= up > > on it and figure out how to get things working with it. > > > > By the way, if someone could point me in the direction of a good seli= nux > > tutorial, I'd appreciate it. > > > > David Muse > > dav...@fi... > > > > On Sun, 2005-08-07 at 14:43 +0200, vieonet forums wrote: > >> Hello > >> > >> I installed fedora core 4, and intall sqlrelay package FC4. > >> > >> I configure, and start sqlrelay. > >> > >> It started well, creating 3 connection to postgres database. > >> > >> I install the php extension, which is well recocgnised in the php.in= i. > >> > >> But when I try to connect to the database, I got hte following messa= ge: > >> "could not connect listener". > >> > >> I check in my tmp directory and the socket is well here. > >> > >> please help > >> > >> regards > >> > >> david > >> > >> > >> > >> > >> ------------------------------------------------------- > >> SF.Net email is Sponsored by the Better Software Conference & EXPO > >> September 19-22, 2005 * San Francisco, CA * Development Lifecycle =20 > >> Practices > >> Agile & Plan-Driven Development * Managing Projects & Teams * Testin= g & =20 > >> QA > >> Security * Process Improvement & Measurement * =20 > >> http://www.sqe.com/bsce5sf > >> _______________________________________________ > >> Sqlrelay-discussion mailing list > >> Sql...@li... > >> https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > >> > > > > > > > > ------------------------------------------------------- > > SF.Net email is Sponsored by the Better Software Conference & EXPO > > September 19-22, 2005 * San Francisco, CA * Development Lifecycle =20 > > Practices > > Agile & Plan-Driven Development * Managing Projects & Teams * Testing= & =20 > > QA > > Security * Process Improvement & Measurement * http://www.sqe.com/bsc= e5sf > > _______________________________________________ > > Sqlrelay-discussion mailing list > > Sql...@li... > > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > > >=20 >=20 >=20 >=20 > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Pract= ices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing &= QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5= sf > _______________________________________________ > Sqlrelay-discussion mailing list > Sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion >=20 |