Since you are using xdebug 2 final, I would like to note that the last version I tested with protoeditor was xdebug 2.0 beta 5. The current version of this debugger doesn't work well with the last releases of protoeditor. You can try the repository version of protoeditor, maybe it could help.
But for now, the best I can do is ask: do you have a backtrace? Or, can you give some steps to execute so I can replicate the crash in my machine?
Thiago
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I would try to compile it myself, but I can't compile the CVS checkout.
make -f Makefile.cvs
*** YOU'RE USING autoconf (GNU Autoconf) 2.61.
*** KDE requires autoconf 2.52, 2.53 or 2.54
make[1]: *** [cvs] Error 1
make: *** [all] Error 2
I had to comment out some lines in admin/cvs.sh to get it to work. Even though there is /usr/bin/autoconf-2.5x, that binary's --version output still says 2.6. So, I don't know what Mandriva did to their backwards compatibility, but I think that just checking for the "-2.5x" in the binary's name should be enough checking for the admin/cvs.sh script.
Well, i started out this post by saying that I couldn't get it configured, but now it's configured, but it still won't build.
Also, i can't just run "build project" in kdevelop.
Here is the last output from make:
if /bin/sh ../../../libtool --silent --mode=compile --tag=CXX g++ -DHAVE_CONFIG_H -I. -I. -I../../.. -I../../../. -I../../../src/settings -I/usr/lib/qt3//include -I. -DQT_THREAD_SUPPORT -D_REENTRANT -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -W -Wpointer-arith -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -O2 -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common -MT sitesettingsdialog.lo -MD -MP -MF ".deps/sitesettingsdialog.Tpo" \
-c -o sitesettingsdialog.lo `test -f 'sitesettingsdialog.cpp' || echo './'`sitesettingsdialog.cpp; \
then mv -f ".deps/sitesettingsdialog.Tpo" ".deps/sitesettingsdialog.Plo"; \
else rm -f ".deps/sitesettingsdialog.Tpo"; exit 1; \
fi
sitesettingsdialog.h:57: error: ISO C++ forbids declaration of 'QComboBox' with no type
sitesettingsdialog.h:57: error: expected ';' before '*' token
sitesettingsdialog.cpp: In constructor 'SiteSettingsDialog::SiteSettingsDialog(QWidget*, const char*)':
sitesettingsdialog.cpp:97: error: 'm_cbDebuggerClient' was not declared in this scope
sitesettingsdialog.cpp: In member function 'void SiteSettingsDialog::populate(const QString&, const QString&, const QString&, const QString&, const QString&, const QString&)':
sitesettingsdialog.cpp:150: error: 'm_cbDebuggerClient' was not declared in this scope
sitesettingsdialog.cpp: In member function 'QString SiteSettingsDialog::debuggerClient()':
sitesettingsdialog.cpp:191: error: 'm_cbDebuggerClient' was not declared in this scope
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The latest CVS doesn't crash, but it also doesn't debug xdebug 2.0
the m_socket in xdnet.cpp never seems to signal readyRead(). In XDNet::slotBufferRead() i have "kdDebug() << "ready read xdnet..." << endl;" and it never outputs to the console.
but XDNet::slotIncomingConnection(Qsocket) does run.
... in fact, everything seems to run twice. Whenever i load up the browser i get two messages (messages that I added) for incoming connections:
protoeditor: incoming socket: port= 9000
protoeditor: slot XD started ...
protoeditor: started debugger
protoeditor: incoming socket: port= 9000
protoeditor: slot XD started ...
protoeditor: started debugger
One last thing, I think the trigger for Xdebug is XDEBUG_SESSION_START=session_id, not XDEBUG_START_SESSION. I don't know if they changed this in the latest 2.0.0 or not, but when I run with "start_session", nothing happens and when I run with "session_start" my browser has a connection problem and all my debug starts printing to the protoeditor console window. So I think the words need to be flipped. Also, I called my session id for xdebug "protoeditor" in my source.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Oh my god!
I'm sorry I wasn't more precise before about the repository. But I'm using /subversion/ for a long time now, and that's where the last version is. CVS head is about 2 years old now ;)
I will disable the CVS service from SF so this doesn't happen again.
Thiago
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
>> QSocket::getch() returns -1 if there's nothing to be read, not 0.
That's correct. However, these loops were written this way based on DBGp protocol.
For every xml document Xdebug sends, a string number is prefixed informing the size of that document. If you run tcpdump, you might see Xdebug sending something like that:
That dot between the document size (456) and the start of the xml is the 0 char I'm looking for in the first inner loop. When that loop leaves, the buffer var should contain "456". I use that number latter to create another buffer (data) and read again from socket until 456 chars are read, wich is the size of the document, and that is all it needs to create a valid dom object and process this iteration. At the end, I check m_socket->bytesAvailable() to start all over again, if there is more data to read (wich means, another xml document).
What is your status now? Are you able to debug normally?
PS: The following code doesn't get me in a infinite loop:
Okay, I get it. You're scanning for a null or newline or some character dictated by the protocol. The only problem is, my setup always spews out -1 from getch(), start to finish.
I do kdDbg() << m_socket->getch() << endl; inside that loop and it's just infinite "-1"s.
I guess that means that the stream isn't buffered properly? I don't really know. I have kde 3.5.6 and qt 3.3.8
When I change it to less than 0 everything works fine.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm on mandriva 2007.1 and protoeditor keeps crashing when Xdebug tries to connect to it
xdebug 2.0.0 final
protoeditor 1.1beta3 i686 rpm
php 5.2.1
I did an strace on protoeditor and I can see a string that says "Hi, this is xdebug 2.0.0" before the crash.
Hello,
thanks for the feedback.
Since you are using xdebug 2 final, I would like to note that the last version I tested with protoeditor was xdebug 2.0 beta 5. The current version of this debugger doesn't work well with the last releases of protoeditor. You can try the repository version of protoeditor, maybe it could help.
But for now, the best I can do is ask: do you have a backtrace? Or, can you give some steps to execute so I can replicate the crash in my machine?
Thiago
I would try to compile it myself, but I can't compile the CVS checkout.
make -f Makefile.cvs
*** YOU'RE USING autoconf (GNU Autoconf) 2.61.
*** KDE requires autoconf 2.52, 2.53 or 2.54
make[1]: *** [cvs] Error 1
make: *** [all] Error 2
I had to comment out some lines in admin/cvs.sh to get it to work. Even though there is /usr/bin/autoconf-2.5x, that binary's --version output still says 2.6. So, I don't know what Mandriva did to their backwards compatibility, but I think that just checking for the "-2.5x" in the binary's name should be enough checking for the admin/cvs.sh script.
Well, i started out this post by saying that I couldn't get it configured, but now it's configured, but it still won't build.
Also, i can't just run "build project" in kdevelop.
Here is the last output from make:
if /bin/sh ../../../libtool --silent --mode=compile --tag=CXX g++ -DHAVE_CONFIG_H -I. -I. -I../../.. -I../../../. -I../../../src/settings -I/usr/lib/qt3//include -I. -DQT_THREAD_SUPPORT -D_REENTRANT -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -W -Wpointer-arith -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -O2 -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common -MT sitesettingsdialog.lo -MD -MP -MF ".deps/sitesettingsdialog.Tpo" \
-c -o sitesettingsdialog.lo `test -f 'sitesettingsdialog.cpp' || echo './'`sitesettingsdialog.cpp; \
then mv -f ".deps/sitesettingsdialog.Tpo" ".deps/sitesettingsdialog.Plo"; \
else rm -f ".deps/sitesettingsdialog.Tpo"; exit 1; \
fi
sitesettingsdialog.h:57: error: ISO C++ forbids declaration of 'QComboBox' with no type
sitesettingsdialog.h:57: error: expected ';' before '*' token
sitesettingsdialog.cpp: In constructor 'SiteSettingsDialog::SiteSettingsDialog(QWidget*, const char*)':
sitesettingsdialog.cpp:97: error: 'm_cbDebuggerClient' was not declared in this scope
sitesettingsdialog.cpp: In member function 'void SiteSettingsDialog::populate(const QString&, const QString&, const QString&, const QString&, const QString&, const QString&)':
sitesettingsdialog.cpp:150: error: 'm_cbDebuggerClient' was not declared in this scope
sitesettingsdialog.cpp: In member function 'QString SiteSettingsDialog::debuggerClient()':
sitesettingsdialog.cpp:191: error: 'm_cbDebuggerClient' was not declared in this scope
OOH!, I am an elite hax0r, here is my diff
Index: src/settings/widgets/sitesettingsdialog.h
RCS file: /cvsroot/protoeditor/protoeditor/src/settings/widgets/sitesettingsdialog.h,v
retrieving revision 1.5
diff -u -r1.5 sitesettingsdialog.h
--- src/settings/widgets/sitesettingsdialog.h 27 Jun 2005 23:10:22 -0000 1.5
+++ src/settings/widgets/sitesettingsdialog.h 2 Aug 2007 19:21:20 -0000
@@ -21,6 +21,7 @@
#define SITESETTINGSDIALOG_H
#include <kdialogbase.h>
+#include <qcombobox.h>
class KLineEdit;
class QSpinBox;
Okay, here are some updates.
The latest CVS doesn't crash, but it also doesn't debug xdebug 2.0
the m_socket in xdnet.cpp never seems to signal readyRead(). In XDNet::slotBufferRead() i have "kdDebug() << "ready read xdnet..." << endl;" and it never outputs to the console.
but XDNet::slotIncomingConnection(Qsocket) does run.
... in fact, everything seems to run twice. Whenever i load up the browser i get two messages (messages that I added) for incoming connections:
protoeditor: incoming socket: port= 9000
protoeditor: slot XD started ...
protoeditor: started debugger
protoeditor: incoming socket: port= 9000
protoeditor: slot XD started ...
protoeditor: started debugger
One last thing, I think the trigger for Xdebug is XDEBUG_SESSION_START=session_id, not XDEBUG_START_SESSION. I don't know if they changed this in the latest 2.0.0 or not, but when I run with "start_session", nothing happens and when I run with "session_start" my browser has a connection problem and all my debug starts printing to the protoeditor console window. So I think the words need to be flipped. Also, I called my session id for xdebug "protoeditor" in my source.
Oh my god!
I'm sorry I wasn't more precise before about the repository. But I'm using /subversion/ for a long time now, and that's where the last version is. CVS head is about 2 years old now ;)
I will disable the CVS service from SF so this doesn't happen again.
Thiago
QSocket::getch() returns -1 if there's nothing to be read, not 0.
change
while((ch = m_socket->getch()) != 0)
into
while((ch = m_socket->getch()) > 0)
in xdnet.cpp around line 217
The same change needs to happen in the latest code from subversion as well.
if I print "ch" to the console inside that loop in xdnet.cpp (around like 410) I get an infinite loop of -1. So changing that to > 0 works.
Also, spelling "dbgp" correctly is harder than it looks in the php.ini.
>> QSocket::getch() returns -1 if there's nothing to be read, not 0.
That's correct. However, these loops were written this way based on DBGp protocol.
For every xml document Xdebug sends, a string number is prefixed informing the size of that document. If you run tcpdump, you might see Xdebug sending something like that:
456.<?xml version="1.0" encoding="iso-8859-1"?><init xmlns="urn:debugger_protocol_v1" .....</init>
That dot between the document size (456) and the start of the xml is the 0 char I'm looking for in the first inner loop. When that loop leaves, the buffer var should contain "456". I use that number latter to create another buffer (data) and read again from socket until 456 chars are read, wich is the size of the document, and that is all it needs to create a valid dom object and process this iteration. At the end, I check m_socket->bytesAvailable() to start all over again, if there is more data to read (wich means, another xml document).
What is your status now? Are you able to debug normally?
PS: The following code doesn't get me in a infinite loop:
while((ch = m_socket->getch()) != 0) {
std::cerr << ch;
buffer += ch
}
std::cerr << "last " << ch << " <<end xml size>>" << std::endl;
Thanks for the interest,
Thiago
Okay, I get it. You're scanning for a null or newline or some character dictated by the protocol. The only problem is, my setup always spews out -1 from getch(), start to finish.
I do kdDbg() << m_socket->getch() << endl; inside that loop and it's just infinite "-1"s.
I guess that means that the stream isn't buffered properly? I don't really know. I have kde 3.5.6 and qt 3.3.8
When I change it to less than 0 everything works fine.
>>I do kdDbg() << m_socket->getch() << endl; inside that loop and it's just infinite "-1"s.
And, what do you get before the infinite "-1"s?