tag 330919 + unreproducible thanks Hi Paul,
Paul van Tilburg escreveu isso aĆ: > Package: libldap-ruby1.8 > Version: 0.9.0-1 > Severity: important > > Executing the following simple program leads to execssive memory use (> > 500MB within seconds): > > ldap.simple_bind(Admin, Pass) do |conn| > conn.search("ou=DNS,#{Root}", LDAP_SCOPE_SUBTREE, > "(|(ildusOwner=bram)(ildusOwner=paul))") do |entry| > puts "dn: #{entry.dn}" > entry.attrs.each do |attr| > entry[attr].each do |val| > puts "#{attr}: #{val}" > end > end > puts > end > end > > However, when "entry[attr].each" is replaced by its (according to the > documentation[1]) aliased version "entry.vals(attr).each" it works > fine. Also "entry.to_ldif" seems to suffer from the same problem. > > Paul > > 1: http://ruby-ldap.sourceforge.net/rdoc/classes/LDAP/Entry.html#M000010 Can you reproduce this problem with the latest version from sid (ruby-ldap 0.9.11-1)? I tried to reproduce it locally, but it seems like your script is not complete. I tried the following code, against a local development LDAP database of mine: ############################################################################ require 'ldap' ldap = LDAP::Conn.new('localhost', 389) ldap.set_option( LDAP::LDAP_OPT_PROTOCOL_VERSION, 3 ) Admin = 'cn=admin,dc=nodomain' Pass = 'test' Root = 'dc=development,dc=nodomain' ldap.simple_bind(Admin, Pass) do |conn| conn.search("ou=Groups,#{Root}", LDAP::LDAP_SCOPE_SUBTREE, "objectclass=posixGroup") do |entry| puts "dn: #{entry.dn}" entry.attrs.each do |attr| entry[attr].each do |val| puts "#{attr}: #{val}" end end puts end end # wait in the end so that I can check htop(1) for the memory usage of the # process $stdin.gets ############################################################################ -- Antonio Terceiro <terce...@debian.org>
signature.asc
Description: Digital signature