Raise the stack space to 2MB for secondary threads. It previously used the 512KB system default. Signed-off-by: Mihai Moldovan <ionic@ionic.de> --- sshmasterconnection.cpp | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/sshmasterconnection.cpp b/sshmasterconnection.cpp index c922af2..2626346 100644 --- a/sshmasterconnection.cpp +++ b/sshmasterconnection.cpp @@ -46,6 +46,11 @@ static bool isLibSshInited=false; SshMasterConnection::SshMasterConnection ( QString host, int port, bool acceptUnknownServers, QString user, QString pass, QString key,bool autologin, bool krblogin, QObject* parent ) : QThread ( parent ) { +#if defined ( Q_OS_DARWIN ) + // Mac OS X provides only 512KB stack space for secondary threads. + // As we put a 512KB buffer on the stack later on, we need a bigger stack space. + setStackSize (sizeof (char) * 1024 * 1024 * 2); +#endif this->host=host; this->port=port; this->user=user; @@ -62,7 +67,7 @@ SshMasterConnection::SshMasterConnection ( QString host, int port, bool acceptUn else x2goDebug<<"starting ssh connection without kerberos authentication"<<endl; #endif -kerberos=false; + kerberos=false; } SshMasterConnection::SshMasterConnection ( QString host, int port, bool acceptUnknownServers, QString user, @@ -70,7 +75,9 @@ SshMasterConnection::SshMasterConnection ( QString host, int port, bool acceptUn int remotePort, QString localHost, int localPort, SshProcess* creator, QObject* parent, ONMainWindow* mwd ) : QThread ( parent ) { - +#if defined ( Q_OS_DARWIN ) + setStackSize (sizeof (char) * 1024 * 1024 * 2); +#endif this->host=host; this->port=port; this->user=user; -- 1.7.9
Am 18.02.2012 04:57, schrieb Mihai Moldovan:
Raise the stack space to 2MB for secondary threads. It previously used the 512KB system default.
Signed-off-by: Mihai Moldovan<ionic@ionic.de>
<snip>
Mihai, since you committed an OS X-specific patch: Would you be interested in picking up development of the OS X X2Go-Client? Originally, Mike wanted to take a stab at it, but didn't get around to do it, and Alex won't touch the OS X port unless he gets paid for it.
If you have the necessary skills and the time to keep the OS X port current, I could provide you with a Mac mini for testing. See http://comments.gmane.org/gmane.linux.terminal-server.x2go.devel/2112 and http://comments.gmane.org/gmane.linux.terminal-server.x2go.devel/2347 for the specs & background info.
I bought this Mac specifically so someone skilled enough can work on the X2Go-Client, and it's kind of sad that no one wants to pick up development even though hardware is provided for free/in exchange for a deposit.
I don't have enough Mac users among my clients that paying Alex (or anyone else) to work on it would be economically viable...
-Stefan
Comitted: http://code.x2go.org/gitweb?p=x2goclient.git;a=commitdiff;h=523d81c193cb7b7b... Mike On Sa 18 Feb 2012 04:57:52 CET Mihai Moldovan wrote:
Raise the stack space to 2MB for secondary threads. It previously used the 512KB system default.
Signed-off-by: Mihai Moldovan <ionic@ionic.de>
sshmasterconnection.cpp | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/sshmasterconnection.cpp b/sshmasterconnection.cpp index c922af2..2626346 100644 --- a/sshmasterconnection.cpp +++ b/sshmasterconnection.cpp @@ -46,6 +46,11 @@ static bool isLibSshInited=false; SshMasterConnection::SshMasterConnection ( QString host, int port, bool acceptUnknownServers, QString user, QString pass, QString key,bool autologin, bool krblogin, QObject* parent ) : QThread ( parent ) { +#if defined ( Q_OS_DARWIN )
- // Mac OS X provides only 512KB stack space for secondary threads.
- // As we put a 512KB buffer on the stack later on, we need a bigger stack space.
- setStackSize (sizeof (char) * 1024 * 1024 * 2); +#endif this->host=host; this->port=port; this->user=user; @@ -62,7 +67,7 @@ SshMasterConnection::SshMasterConnection ( QString host, int port, bool acceptUn else x2goDebug<<"starting ssh connection without kerberos authentication"<<endl; #endif -kerberos=false;
- kerberos=false; }
SshMasterConnection::SshMasterConnection ( QString host, int port, bool acceptUnknownServers, QString user, @@ -70,7 +75,9 @@ SshMasterConnection::SshMasterConnection ( QString host, int port, bool acceptUn int remotePort, QString localHost, int localPort, SshProcess* creator, QObject* parent, ONMainWindow* mwd ) : QThread ( parent ) {
+#if defined ( Q_OS_DARWIN )
setStackSize (sizeof (char) * 1024 * 1024 * 2); +#endif this->host=host; this->port=port; this->user=user;
1.7.9
-- DAS-NETZWERKTEAM mike gabriel, dorfstr. 27, 24245 barmissen fon: +49 (4302) 281418, fax: +49 (4302) 281419 GnuPG Key ID 0xB588399B mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de freeBusy: https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xf...
Am 18.02.2012 04:57, schrieb Mihai Moldovan:
Raise the stack space to 2MB for secondary threads. It previously used the 512KB system default.
Signed-off-by: Mihai Moldovan <ionic@ionic.de>
sshmasterconnection.cpp | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/sshmasterconnection.cpp b/sshmasterconnection.cpp index c922af2..2626346 100644 --- a/sshmasterconnection.cpp +++ b/sshmasterconnection.cpp @@ -46,6 +46,11 @@ static bool isLibSshInited=false; SshMasterConnection::SshMasterConnection ( QString host, int port, bool acceptUnknownServers, QString user, QString pass, QString key,bool autologin, bool krblogin, QObject* parent ) : QThread ( parent ) { +#if defined ( Q_OS_DARWIN )
- // Mac OS X provides only 512KB stack space for secondary threads.
- // As we put a 512KB buffer on the stack later on, we need a bigger stack space.
- setStackSize (sizeof (char) * 1024 * 1024 * 2); +#endif this->host=host; this->port=port; this->user=user; @@ -62,7 +67,7 @@ SshMasterConnection::SshMasterConnection ( QString host, int port, bool acceptUn else x2goDebug<<"starting ssh connection without kerberos authentication"<<endl; #endif -kerberos=false;
- kerberos=false; }
SshMasterConnection::SshMasterConnection ( QString host, int port, bool acceptUnknownServers, QString user, @@ -70,7 +75,9 @@ SshMasterConnection::SshMasterConnection ( QString host, int port, bool acceptUn int remotePort, QString localHost, int localPort, SshProcess* creator, QObject* parent, ONMainWindow* mwd ) : QThread ( parent ) {
+#if defined ( Q_OS_DARWIN )
- setStackSize (sizeof (char) * 1024 * 1024 * 2); +#endif this->host=host; this->port=port; this->user=user;
X2Go-Dev mailing list X2Go-Dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/x2go-dev
Hi, It is really nice that somebody want to make x2goclient working on Mac. Unfortunately, building x2goclient for Mac is not enough. There are some features in x2goclient (especially managing of nx-proxy window) which can not be written with Qt methods, but only with system API (libx11 and winapi). In addition, there are many changes from version to version in Mac OS itself. Especially it relevant to X11. The behaviour of X11 can be changed even within the same version of Mac OS with every new version of X11. So, you should be sure, that changes you made in x2goclient working with actual versions of mac and X11. Please be sure also, that changes you making in code of x2go client will not break its functionality on other systems and you always using the #if defined ( Q_OS_DARWIN ) #endif clauses I still plan to rewrite code of x2goclient to make it more understandable for other people and make hacking of it easier. Unfortunately, in moment I have no time for it. regards, -- Oleksandr Shneyder Dipl. Informatik X2go Core Developer Team email: oleksandr.shneyder@obviously-nice.de web: www.obviously-nice.de --> X2go - everywhere@home
Hi Alex
It is really nice that somebody want to make x2goclient working on Mac.
Why "wants"? It actually kinda is... ;)
Unfortunately, building x2goclient for Mac is not enough. There are some features in x2goclient (especially managing of nx-proxy window) which can not be written with Qt methods, but only with system API (libx11 and winapi).
So what? This has never been a problem on Linux, why would it be on OS X?
In addition, there are many changes from version to version in Mac OS itself. Especially it relevant to X11. The behaviour of X11 can be changed even within the same version of Mac OS with every new version of X11.
Luckily, the X11 API is pretty stable from what I have seen. I've been using x2goclient with X11R6.8 before (default Xorg version Apple ships, horribly outdated) up to X11R7.8 (I guess? xorg-server 1.11 which isn't even officially released yet IIRC) and it never broke. nx didn't either. Even other programs like wine or GTK based programs I use every now and then never had any compatibility issues for me. However, I have to admit that my setup is somewhat special and I'd like to test on vanilla stuff too, even including OS X 10.7 (I'm still on 10.6.)
So, you should be sure, that changes you made in x2goclient working with actual versions of mac and X11.
Yeah, I always do. :)
Please be sure also, that changes you making in code of x2go client will not break its functionality on other systems and you always using the #if defined ( Q_OS_DARWIN ) #endif clauses
Sure, anything else would be really stupid and I employed the macro, too, right from the beginning.
I still plan to rewrite code of x2goclient to make it more understandable for other people and make hacking of it easier.
Sounds like a good idea, some parts are difficult to understand and have fragments of previously used approaches to tackle a problem which weren't removed and are thus merely causing confusion when reading the code. As such, allow me one question: SshMasterConnection is using a 512 KByte buffer for I/O operations via SSH. This sounds a little bit high and is probably only useful in LAN environments or over high-speed broadband connections. Anyway, I could live with that. What strikes me odd is allocating this buffer on the stack in the local method. Wouldn't it be better to use a pointer as a class variable, allocate it in the class constructor on the heap via new char[512*1024] and leave it as-is (it will be automatically deleted once the class terminates)? Also, I see with the current implementation as in general, variables/arrays allocated on the stack are not zero-initialized and may contain memory garbage - do we really want this? Class variables are always zero-initialized so that's another good reason to prefer this method.
Thanks for reading this wall of text.
Best regards,
Mihai
Am 22.02.2012 02:30, schrieb Mihai Moldovan:
Hi Alex
- On 20.02.2012 09:14 AM, Oleksandr Shneyder wrote:
It is really nice that somebody want to make x2goclient working on Mac.
Why "wants"? It actually kinda is... ;) great.
Unfortunately, building x2goclient for Mac is not enough. There are some features in x2goclient (especially managing of nx-proxy window) which can not be written with Qt methods, but only with system API (libx11 and winapi).
So what? This has never been a problem on Linux, why would it be on OS X?
Yes, but some one should take care about it. At the moment I have no time for it, especially for testing it on every recent version of Mac OS.
In addition, there are many changes from version to version in Mac OS itself. Especially it relevant to X11. The behaviour of X11 can be changed even within the same version of Mac OS with every new version of X11.
Luckily, the X11 API is pretty stable from what I have seen. I've been using x2goclient with X11R6.8 before (default Xorg version Apple ships, horribly outdated) up to X11R7.8 (I guess? xorg-server 1.11 which isn't even officially released yet IIRC) and it never broke. nx didn't either. Even other programs like wine or GTK based programs I use every now and then never had any compatibility issues for me. However, I have to admit that my setup is somewhat special and I'd like to test on vanilla stuff too, even including OS X 10.7 (I'm still on 10.6.)
nice. At the time when I have developed X2Go client for Mac, command line options of X-Server was changed twice %)
So, you should be sure, that changes you made in x2goclient working with actual versions of mac and X11.
Yeah, I always do. :)
Please be sure also, that changes you making in code of x2go client will not break its functionality on other systems and you always using the #if defined ( Q_OS_DARWIN ) #endif clauses
Sure, anything else would be really stupid and I employed the macro, too, right from the beginning.
I still plan to rewrite code of x2goclient to make it more understandable for other people and make hacking of it easier.
Sounds like a good idea, some parts are difficult to understand and have fragments of previously used approaches to tackle a problem which weren't removed and are thus merely causing confusion when reading the code. As such, allow me one question: SshMasterConnection is using a 512 KByte buffer for I/O operations via SSH. This sounds a little bit high and is probably only useful in LAN environments or over high-speed broadband connections. Anyway, I could live with that. What strikes me odd is allocating this buffer on the stack in the local method. Wouldn't it be better to use a pointer as a class variable, allocate it in the class constructor on the heap via new char[512*1024] and leave it as-is (it will be automatically deleted once the class terminates)? Also, I see with the current implementation as in general, variables/arrays allocated on the stack are not zero-initialized and may contain memory garbage - do we really want this? Class variables are always zero-initialized so that's another good reason to prefer this method.
feel free to fix it. However, I would use a classes provided by Qt (4e QByteArray).
Thanks for reading this wall of text.
Best regards,
Mihai
X2Go-Dev mailing list X2Go-Dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/x2go-dev
Oleksandr Shneyder Dipl. Informatik X2go Core Developer Team
email: oleksandr.shneyder@obviously-nice.de web: www.obviously-nice.de
--> X2go - everywhere@home