in reply to Perl debugger fixes bug, now i've got a perl debugger to get rid of.

Ah - you've got a quantum bug there (a bug that changes under observation/measurement). I suggest reverting to more primitive debugging techniques, i.e. adding "print" statements around the suspected buggy code. Those statements may fix the bug the same way using the debugger does, but at least you'll have removed the debugger from the equation.

Update

Never mind the above advice - your code is too straightforward to be causing the quantum bug. However, I suspect your problem is with using Net::LDAP asynchronously. Try setting "async" to zero - your ldap object may not be completely finished with everything it is attempting to do before you ask it to do something else. This is just a guess, mind you...
  • Comment on Re: Perl debugger fixes bug, now i've got a perl debugger to get rid of.

Replies are listed 'Best First'.
Re: Re: Perl debugger fixes bug, now i've got a perl debugger to get rid of.
by emeitner (Novice) on Feb 22, 2004 at 20:22 UTC
    Yes, I tried standard debugging techniques. The LDAP bind() and search() are where it fails.

    An example of how random it is(with Net::LDAP debugging off):

    emeitner@brule:~/work/perl-ldap$ while : ; do ./simple.pl ; sleep 1; d +one bind(): I/O Error Resource temporarily unavailable bind(): I/O Error Resource temporarily unavailable bind(): I/O Error Resource temporarily unavailable search(): I/O Error Resource temporarily unavailable bind(): I/O Error Resource temporarily unavailable bind(): I/O Error Resource temporarily unavailable search(): I/O Error Resource temporarily unavailable bind(): I/O Error Resource temporarily unavailable bind(): I/O Error Resource temporarily unavailable search(): I/O Error Resource temporarily unavailable bind(): I/O Error Resource temporarily unavailable search(): I/O Error Resource temporarily unavailable

    I DID notice during my investigation that if I use other modules such as Data::Dumper the script will actually work once out of every 20 runs or so.

Re: Re: Perl debugger fixes bug, now i've got a perl debugger to get rid of.
by emeitner (Novice) on Feb 22, 2004 at 20:50 UTC
    Yep, I tried that too. It behaves the same in either sync or async modes.
      Ok... Try putting an explicit $ldap->sync() before your bind() and search() calls.