Re: x2goclient: segfault

2016-05-15 Thread Rafael Sadowski
On Sun May 15, 2016 at 03:06:45AM +0200, Jeremie Courreges-Anglas wrote:
> Jeremie Courreges-Anglas  writes:
> 
> > Jeremie Courreges-Anglas  writes:
> >
> >> Denis Fondras  writes:
> >>
>  Try to increase your stack size.
>  
>  $ ulimit -s
>  4096
>  $ ulimit -Hs
>  32768
>  
> >>>
> >>> Thank you Jeremie.
> >>>
> >>> $ ulimit -a
> >>> core file size  (blocks, -c) unlimited
> >>> data seg size   (kbytes, -d) 33554432
> >>> file size   (blocks, -f) unlimited
> >>> max locked memory   (kbytes, -l) 2680761
> >>> max memory size (kbytes, -m) 8021032
> >>> open files  (-n) 128
> >>> pipe size(512 bytes, -p) 1
> >>> stack size  (kbytes, -s) 32768
> >>> cpu time   (seconds, -t) unlimited
> >>> max user processes  (-u) 1310
> >>> virtual memory  (kbytes, -v) 33587200
> >>> $ ulimit -s
> >>> 32768
> >>> $ ulimit -Hs
> >>> 32768
> >>>
> >>> Unfortunately :
> >>> Program received signal SIGSEGV, Segmentation fault.
> >>> [Switching to thread 1001830]
> >>> 0x09eb5fe1a0a9 in SshMasterConnection::channelLoop () from
> >>> /usr/ports/pobj/x2goclient-4.0.5.1/x2goclient-4.0.5.1/x2goclient
> >>>
> >>> How can I set higher HARD limit ?
> >>
> >> I doubt that would help, 32MB is already a lot.
> >
> > Actually it looks like the affected function is run by a thread, and
> > threads have their own stack size.  The pthread_attr_setstacksize
> > function can be used to... well, you guessed it.  The problem is, there
> > is no single pthread call in x2goclient (I guess thread management comes
> > from Qt).
> 
> Aaaand it turns out that not only OpenBSD is affected, here's a short
> diff that makes x2goclient run ssh properly.
> 


> 
> 
> -- 
> jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Thanks jca,

committed with update in wip tree:

https://github.com/jasperla/openbsd-wip/commit/2102a738ae6b699038b7585f2e9278a27197451b

Best regards,

Rafael



Re: x2goclient: segfault

2016-05-15 Thread Denis Fondras
On Sun, May 15, 2016 at 03:06:45AM +0200, Jeremie Courreges-Anglas wrote:
> Aaaand it turns out that not only OpenBSD is affected, here's a short
> diff that makes x2goclient run ssh properly.
> 

I am happy to confirm your patch resolves the issue :)
Thank you very much Jeremie.



Re: x2goclient: segfault

2016-05-14 Thread Jeremie Courreges-Anglas
Jeremie Courreges-Anglas  writes:

> Jeremie Courreges-Anglas  writes:
>
>> Denis Fondras  writes:
>>
 Try to increase your stack size.
 
 $ ulimit -s
 4096
 $ ulimit -Hs
 32768
 
>>>
>>> Thank you Jeremie.
>>>
>>> $ ulimit -a
>>> core file size  (blocks, -c) unlimited
>>> data seg size   (kbytes, -d) 33554432
>>> file size   (blocks, -f) unlimited
>>> max locked memory   (kbytes, -l) 2680761
>>> max memory size (kbytes, -m) 8021032
>>> open files  (-n) 128
>>> pipe size(512 bytes, -p) 1
>>> stack size  (kbytes, -s) 32768
>>> cpu time   (seconds, -t) unlimited
>>> max user processes  (-u) 1310
>>> virtual memory  (kbytes, -v) 33587200
>>> $ ulimit -s
>>> 32768
>>> $ ulimit -Hs
>>> 32768
>>>
>>> Unfortunately :
>>> Program received signal SIGSEGV, Segmentation fault.
>>> [Switching to thread 1001830]
>>> 0x09eb5fe1a0a9 in SshMasterConnection::channelLoop () from
>>> /usr/ports/pobj/x2goclient-4.0.5.1/x2goclient-4.0.5.1/x2goclient
>>>
>>> How can I set higher HARD limit ?
>>
>> I doubt that would help, 32MB is already a lot.
>
> Actually it looks like the affected function is run by a thread, and
> threads have their own stack size.  The pthread_attr_setstacksize
> function can be used to... well, you guessed it.  The problem is, there
> is no single pthread call in x2goclient (I guess thread management comes
> from Qt).

Aaaand it turns out that not only OpenBSD is affected, here's a short
diff that makes x2goclient run ssh properly.



patch-src_sshmasterconnection_cpp
Description: Binary data


-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE


Re: x2goclient: segfault

2016-05-14 Thread Jeremie Courreges-Anglas
Jeremie Courreges-Anglas  writes:

> Denis Fondras  writes:
>
>>> Try to increase your stack size.
>>> 
>>> $ ulimit -s
>>> 4096
>>> $ ulimit -Hs
>>> 32768
>>> 
>>
>> Thank you Jeremie.
>>
>> $ ulimit -a
>> core file size  (blocks, -c) unlimited
>> data seg size   (kbytes, -d) 33554432
>> file size   (blocks, -f) unlimited
>> max locked memory   (kbytes, -l) 2680761
>> max memory size (kbytes, -m) 8021032
>> open files  (-n) 128
>> pipe size(512 bytes, -p) 1
>> stack size  (kbytes, -s) 32768
>> cpu time   (seconds, -t) unlimited
>> max user processes  (-u) 1310
>> virtual memory  (kbytes, -v) 33587200
>> $ ulimit -s
>> 32768
>> $ ulimit -Hs
>> 32768
>>
>> Unfortunately :
>> Program received signal SIGSEGV, Segmentation fault.
>> [Switching to thread 1001830]
>> 0x09eb5fe1a0a9 in SshMasterConnection::channelLoop () from
>> /usr/ports/pobj/x2goclient-4.0.5.1/x2goclient-4.0.5.1/x2goclient
>>
>> How can I set higher HARD limit ?
>
> I doubt that would help, 32MB is already a lot.

Actually it looks like the affected function is run by a thread, and
threads have their own stack size.  The pthread_attr_setstacksize
function can be used to... well, you guessed it.  The problem is, there
is no single pthread call in x2goclient (I guess thread management comes
from Qt).

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



Re: x2goclient: segfault

2016-05-14 Thread Jeremie Courreges-Anglas
Denis Fondras  writes:

>> Try to increase your stack size.
>> 
>> $ ulimit -s
>> 4096
>> $ ulimit -Hs
>> 32768
>> 
>
> Thank you Jeremie.
>
> $ ulimit -a
> core file size  (blocks, -c) unlimited
> data seg size   (kbytes, -d) 33554432
> file size   (blocks, -f) unlimited
> max locked memory   (kbytes, -l) 2680761
> max memory size (kbytes, -m) 8021032
> open files  (-n) 128
> pipe size(512 bytes, -p) 1
> stack size  (kbytes, -s) 32768
> cpu time   (seconds, -t) unlimited
> max user processes  (-u) 1310
> virtual memory  (kbytes, -v) 33587200
> $ ulimit -s
> 32768
> $ ulimit -Hs
> 32768
>
> Unfortunately :
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to thread 1001830]
> 0x09eb5fe1a0a9 in SshMasterConnection::channelLoop () from
> /usr/ports/pobj/x2goclient-4.0.5.1/x2goclient-4.0.5.1/x2goclient
>
> How can I set higher HARD limit ?

I doubt that would help, 32MB is already a lot.

Another possible explanation is that buffer is used as a C string but
isn't properly NUL-terminated.  Moving buffer to static storage (bss)
means that it gets initialized with zeroes.

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



Re: x2goclient: segfault

2016-05-14 Thread Denis Fondras
> Try to increase your stack size.
> 
> $ ulimit -s
> 4096
> $ ulimit -Hs
> 32768
> 

Thank you Jeremie.

$ ulimit -a
core file size  (blocks, -c) unlimited
data seg size   (kbytes, -d) 33554432
file size   (blocks, -f) unlimited
max locked memory   (kbytes, -l) 2680761
max memory size (kbytes, -m) 8021032
open files  (-n) 128
pipe size(512 bytes, -p) 1
stack size  (kbytes, -s) 32768
cpu time   (seconds, -t) unlimited
max user processes  (-u) 1310
virtual memory  (kbytes, -v) 33587200
$ ulimit -s
32768
$ ulimit -Hs
32768

Unfortunately :
Program received signal SIGSEGV, Segmentation fault.
[Switching to thread 1001830]
0x09eb5fe1a0a9 in SshMasterConnection::channelLoop () from
/usr/ports/pobj/x2goclient-4.0.5.1/x2goclient-4.0.5.1/x2goclient

How can I set higher HARD limit ?

Denis



Re: x2goclient: segfault

2016-05-14 Thread Jeremie Courreges-Anglas
Denis Fondras  writes:

> Hi,
>
> When launching x2goclient (from openbsd-wip) on amd64/5.9 it segfaults.
> The problem lies with the buffer[] declaration in
> SshMasterConnection::channelLoop(). When the I move it outside of the function
> it works like a charm. Can a dev explain why it maters to be declared inside 
> or
> outside ? (too big for the stack, W^X, something else ?)

Try to increase your stack size.

$ ulimit -s
4096
$ ulimit -Hs
32768

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



Re: x2goclient

2013-12-22 Thread Stuart Henderson
On 2013/12/22 03:15, Predrag Punosevac wrote:
 I noticed that Rafael Sadowski was working on x2goclient
 
 https://github.com/jasperla/openbsd-wip/blob/master/x11/x2goclient/Makefile
 
 Are there any serious technical obstacles to commit the port? Due to
 the fact that NX is no completely proprietary and close source and in
 the light of my rather poor experience with FreeNX server I started
 completely switching to X2Go.
 

the biggest issue is listed in TODO..

| PKGNAME =x2goclient-${VERSION}
| DISTNAME =x2goclient-${VERSION}

just set DISTNAME

| # GPL2

use GPLv2+ or GPLv2 only depending on whether it's v2-or-newer or v2-only

| LIB_DEPENDS =x11/nx/nxproxy \
| security/libssh \
| x11/qt4 \
| databases/openldap \
| print/cups

cups libs are now in the -libs subpackage

| BUILD__DEPENDS =x11/nx/nxproxy \

broken line, should only be one _

| do-install:
| ${INSTALL} ${WRKSRC}/x2goclient ${PREFIX}/bin

should be INSTALL_PROGRAM

(and whitespace in the port Makefile is not to usual standards)



Re: x2goclient

2013-12-22 Thread Predrag Punosevac
Stuart Henderson st...@openbsd.org wrote:

 On 2013/12/22 03:15, Predrag Punosevac wrote:
  I noticed that Rafael Sadowski was working on x2goclient
  
  https://github.com/jasperla/openbsd-wip/blob/master/x11/x2goclient/Makefile
  
  Are there any serious technical obstacles to commit the port? Due to
  the fact that NX is no completely proprietary and close source and in
  the light of my rather poor experience with FreeNX server I started
  completely switching to X2Go.
  

 the biggest issue is listed in TODO..


Thanks Stuart! Unfortunately there are some much more serious things
which were communicated to me privately. I am glad that thing is not in
OpenBSD ports tree.


 | PKGNAME =x2goclient-${VERSION}
 | DISTNAME =x2goclient-${VERSION}

 just set DISTNAME

 | # GPL2

 use GPLv2+ or GPLv2 only depending on whether it's v2-or-newer or v2-only

 | LIB_DEPENDS =x11/nx/nxproxy \
 | security/libssh \
 | x11/qt4 \
 | databases/openldap \
 | print/cups

 cups libs are now in the -libs subpackage

 | BUILD__DEPENDS =x11/nx/nxproxy \

 broken line, should only be one _

 | do-install:
 | ${INSTALL} ${WRKSRC}/x2goclient ${PREFIX}/bin

 should be INSTALL_PROGRAM

 (and whitespace in the port Makefile is not to usual standards)