Bug#747989: Help required

2014-07-04 Thread Yavor Doganov
[ Apologies for replying to myself again. ]

Yavor Doganov wrote:
   - The autorelease pool should be created in the constructor, before
 the first object is allocated.  That's openvpn_plugin_open_v1,

Actually, after looking more into this and reading openvpn-plugin.h, I
see that the upstream patch is correct here.  ctx-config is manually
released in openvpn_plugin_close_v1, so that's perfectly fine.

There are a few other potential issues with initialization -- not
assigning self to the result of super or [self init] and using [self
init] when [super init] should be used.  These are easily fixable.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#747989: Help required

2014-07-04 Thread Alberto Gonzalez Iniesta
On Fri, Jul 04, 2014 at 12:32:06PM +0300, Yavor Doganov wrote:
 [ Apologies for replying to myself again. ]
 
 Yavor Doganov wrote:
- The autorelease pool should be created in the constructor, before
  the first object is allocated.  That's openvpn_plugin_open_v1,
 
 Actually, after looking more into this and reading openvpn-plugin.h, I
 see that the upstream patch is correct here.  ctx-config is manually
 released in openvpn_plugin_close_v1, so that's perfectly fine.
 
 There are a few other potential issues with initialization -- not
 assigning self to the result of super or [self init] and using [self
 init] when [super init] should be used.  These are easily fixable.

Hi Yagor,

Thanks for your help!! I'll apply the patch and do some testing next
week, hopefully closing this.

Cheers,

Alberto

-- 
Alberto Gonzalez Iniesta| Formación, consultoría y soporte técnico
mailto/sip: a...@inittab.org | en GNU/Linux y software libre
Encrypted mail preferred| http://inittab.com

Key fingerprint = 5347 CBD8 3E30 A9EB 4D7D  4BF2 009B 3375 6B9A AA55


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#747989: Help required

2014-07-03 Thread Yavor Doganov
tags 747989 + patch
thanks

Hi,

I'm one of the Debian GNUstep maintainers.  Emilio Pozuelo Monfort
from the Release Team pointed me at this bug.

The conclusions at the upstream bug are mostly correct -- Object in
the new runtime is barebone and you either have to implement all the
basic methods with the new libobjc functions, or you have to use
NSObject as your root object (thus depending on GNUstep Base or Cocoa
on MuckOS X).  It is possible to do the former, but that is too much
work for no apparent benefit.  You could take a look at
gnustep-base/Source/NSObject.m for the complexity involved.  There is
too much room for grave errors, even for the basic things.  And the
code would be even more cluttered with #ifdefs.

The patch there attempts to do the latter, but it is not completely
correct and doesn't work in this form:

  - It overrides NSObject's -init, -retain, -release and -isEqual:.
What you really want is TRObject to become a dummy class fully
inheriting from NSObject.

  - The autorelease pool should be created in the constructor, before
the first object is allocated.  That's openvpn_plugin_open_v1,
as far as I understand the code (but I may be wrong here).  If
there are additional threads created, you need separate pools for
every thread.  AFAICS this is not the case here, right?

  - The pool has to be destroyed in the destructor, after releasing
the last object.  This should be openvpn_plugin_close_v1, but
again, I'm not familiar with the API and do not understand what's
the relationship between this function and openvpn_plugin_func_v1
and when is openvpn_plugin_close_v1 called exactly.

  - The pool is destroyed by sending a -release message.  -drain may
work, but not in all implementations.

  - With the modern runtime, you have two cases only -- Apple and
non-Apple, because '-framework Foundation' will work only on
Apple, and you need GNUstep for all other platforms, not only
GNU/Linux.  That's necessary on Debian too, because we have
GNU/Hurd and GNU/kFreeBSD.

  - The OBJCFLAGS and linker flags are specific to the GNUstep
installation, and may differ drastically.  For example, with
GNUSTEP_INSTALLATION_DOMAIN everything (headers, libraries, tools,
etc.) is installed in ~/GNUstep.  They also differ depending on
the compiler/runtime (for instance, the new GNUstep runtime +
clang) so you'd better resort to gnustep-config for these.  This
will also ensure that they're always correct and you don't have to
adjust your package all the time.

With the attached modified version of the upstream patch the plugin
crashes when I run openvpn as advised at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=641811#72

(gdb) bt
#0  __strlen_ia32 () at
../sysdeps/i386/i686/multiarch/../../i586/strlen.S:94
#1  0xb7b4ccdf in -[LFString initWithCString:] (self=0x80115180, 
_cmd=0xb7b5e798 _OBJC_SELECTOR_TABLE+88, cString=0x0) at
LFString.m:57
#2  0xb7b4fa08 in -[LFAuthLDAPConfig initWithConfigFile:] (
self=0xb7b5e748 _OBJC_SELECTOR_TABLE+8, 
_cmd=0xb7b5c1f8 _OBJC_SELECTOR_TABLE+120, fileName=0x0)
at LFAuthLDAPConfig.m:321
#3  0xb7b49e08 in openvpn_plugin_open_v1 (type=0x800c39bc,
argv=0x800c38e4, 
envp=0x800da19c) at auth-ldap.m:262

That's a general problem with the code -- the check for argv[1] should
be done earlier so that -initWithConfigFile is not called with a NULL
argument and as a result strlen is not called with a NULL argument.
Or the method could first check if the argument is supplied and return
nil immediately if that is not the case.

Running it with the example configuration file:

(gdb) r --dev null --plugin /usr/lib/openvpn/openvpn-auth-ldap.so 
/usr/share/doc/openvpn-auth-ldap/examples/auth-ldap.conf 
Starting program: /usr/sbin/openvpn --dev null --plugin 
/usr/lib/openvpn/openvpn-auth-ldap.so 
/usr/share/doc/openvpn-auth-ldap/examples/auth-ldap.conf
[Thread debugging using libthread_db enabled]
Using host libthread_db library 
/lib/i386-linux-gnu/i686/cmov/libthread_db.so.1.
Fri Jul  4 00:26:56 2014 OpenVPN 2.3.2 i486-pc-linux-gnu [SSL (OpenSSL)] [LZO] 
[EPOLL] [PKCS11] [eurephia] [MH] [IPv6] built on Mar 17 2014
Fri Jul  4 00:26:57 2014 *** WARNING ***: all encryption and 
authentication features disabled -- all data will be tunnelled as cleartext
Fri Jul  4 00:26:57 2014 UDPv4 link local (bound): [undef]
Fri Jul  4 00:26:57 2014 UDPv4 link remote: [undef]

And there it stays continuously, I have to interrupt it with C-c.

Please test and let me know if there are problems/questions.  Thanks.
--- openvpn-auth-ldap-2.0.3.orig/aclocal.m4
+++ openvpn-auth-ldap-2.0.3/aclocal.m4
@@ -1,4 +1,3 @@
-builtin(include,objc.m4)
 builtin(include,pthread.m4)
 builtin(include,platform.m4)
 builtin(include,check.m4)
@@ -23,7 +22,7 @@
 #	Result is cached.
 #
 #	Defines one of the following preprocessor macros:
-#		APPLE_RUNTIME GNU_RUNTIME
+#		APPLE_RUNTIME GNU_RUNTIME MODERN_RUNTIME
 

Bug#747989: Help required

2014-07-03 Thread Yavor Doganov
Yavor Doganov wrote:
   - The OBJCFLAGS and linker flags are specific to the GNUstep
 installation, and may differ drastically.  For example, with
 GNUSTEP_INSTALLATION_DOMAIN everything (headers, libraries, tools,
 etc.) is installed in ~/GNUstep.

I meant with GNUSTEP_INSTALLATION_DOMAIN=USER.

I see that the upstream maintainer objected to the way the autoconf
tests are performed.  The apple runtime test is completely
redundant, because Cocoa is the core of their system so not an
additional dependency.  Using NSObject as the root object will always
work on their platform, regardless of the underlying runtime library.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#747989: Help required

2014-05-14 Thread Alberto Gonzalez Iniesta
tags 747989 + help
thanks

Hi there,

I tried the patch submitted upstream [1] (adding dh_autoreconf and
libgnustep-base-dev build-deps), but I'm still getting segfaults with
current gcc-4.8. I have no idea where to go from here, so if anyone can
help with this it'll be much appreciated.

Regards,

Alberto

[1] https://code.google.com/p/openvpn-auth-ldap/issues/detail?id=31#c16
-- 
Alberto Gonzalez Iniesta| Formación, consultoría y soporte técnico
mailto/sip: a...@inittab.org | en GNU/Linux y software libre
Encrypted mail preferred| http://inittab.com

Key fingerprint = 5347 CBD8 3E30 A9EB 4D7D  4BF2 009B 3375 6B9A AA55


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org