Re: Psycopg2-2.0.6 freezes when imported under FreeBSD-7.0

"Dragos Petre" <[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
James,

I had managed to build it (the patch is necessary to do that so please do
commit it) but my problem was importing it.

I have meanwhile run a ktrace on the python process when importing the
psycopg2 module (please see the full output as attachment - 1.6M!, bottom 30
lines pasted below) - for a layman as myself it looks like it blocks when
calling _umtx_op which leads one to think the issue may be somewhere in the
threading functionality. Google-ing didn't get me any further than that so
any help would be great.

 92181 python2.4 5.811301 CALL  getpid
 92181 python2.4 5.811327 RET   getpid 92181/0x16815
 92181 python2.4 5.811413 CALL  __sysctl(0xbfbfc450,0x2
,0x28824370,0xbfbfc458,0,0)
 92181 python2.4 5.811458 RET   __sysctl 0
 92181 python2.4 5.811487 CALL
__sysctl(0xbfbfc3e4,0x2,0xbfbfc37c,0xbfbfc3ec,0x288210ac,0xd)
 92181 python2.4 5.811559 RET   __sysctl 0
 92181 python2.4 5.811590 CALL
__sysctl(0xbfbfc37c,0x3,0x28823668,0xbfbfc458,0,0)
 92181 python2.4 5.811623 RET   __sysctl 0
 92181 python2.4 5.811664 CALL  thr_self(0x28401500)
 92181 python2.4 5.811690 RET   thr_self 0
 92181 python2.4 5.811716 CALL
mmap(0xbf9ff000,0x1000,PROT_NONE,MAP_ANON,0xffffffff,0,0)
 92181 python2.4 5.811750 RET   mmap -1080033280/0xbfa00000
 92181 python2.4 5.811776 CALL  thr_set_name(0x18701,0x288210f4)
 92181 python2.4 5.811802 RET   thr_set_name 0
 92181 python2.4 5.811823 CALL  rtprio_thread(0,0x18701,0xbfbfc3ec)
 92181 python2.4 5.811876 RET   rtprio_thread 0
 92181 python2.4 5.811903 CALL  sysarch(0xa,0xbfbfc400)
 92181 python2.4 5.811929 RET   sysarch 0
 92181 python2.4 5.811955 CALL
sigprocmask(SIG_SETMASK,0xbfbfc440,0xbfbfc430)
 92181 python2.4 5.811982 RET   sigprocmask 0
 92181 python2.4 5.812007 CALL  sigaction(SIG 32,0xbfbfc3dc,0)
 92181 python2.4 5.812035 RET   sigaction 0
 92181 python2.4 5.812060 CALL  sigprocmask(SIG_SETMASK,0xbfbfc430,0)
 92181 python2.4 5.812087 RET   sigprocmask 0
 92181 python2.4 5.812156 CALL  sigprocmask(SIG_BLOCK,0x281308c0,0xbfbfc47c)
 92181 python2.4 5.812182 RET   sigprocmask 0
 92181 python2.4 5.812208 CALL  sigprocmask(SIG_SETMASK,0x281308d0,0)
 92181 python2.4 5.812234 RET   sigprocmask 0
 92181 python2.4 5.813298 CALL  _umtx_op(0x284053a0,0x8,0x1,0x28405380,0)
 92181 python2.4 23.756523 RET   _umtx_op -1 errno 4 Interrupted system call
 92181 python2.4 23.756688 PSIG  SIGKILL SIG_DFL

All the best,
Dragos.


On Tue, Mar 11, 2008 at 3:46 PM, James Henstridge <[email protected]>
wrote:

> On 11/03/2008, Dragos Petre <[email protected]> wrote:
> > Hi!
> >
> > Complete newbie question here - I would appreciate your help a lot!
> >
> > I have installed psycopg2-2.0.6 under FreeBSD-7.0 (both under python-2.4and
> > python-2.5 - results are similar). When I try to import psycopg2 my
> python
> > prompt freezes (if i try it from a module the result is the same). At
> the
> > bottom of the message is the output when running it in python's verbose
> > mode. The interactive shell freezes at the last line so I have to kill
> it.
>
> There was a recent bug report about getting psycopg2 to compile with
> FreeBSD 7 here:
>    http://www.initd.org/tracker/psycopg/ticket/223
>
> Does applying the patch from that report help?
>
> If not, could you try building psycopg2 from Subversion and seeing if
> that helps (with the patch applied).  Assuming you have subversion
> installed, you should be able to download it with:
>
> svn checkout http://initd.org/svn/psycopg/psycopg2/branches/2_0_x psycopg2
>
> If the patch fixes the problem, I'll commit it.
>
> James.
>
James,

I had managed to build it (the patch is necessary to do that so please do
commit it) but my problem was importing it.

I have meanwhile run a ktrace on the python process when importing the
psycopg2 module (please see below the bottom lines after the import of
libiconv - total output is too long to be accepted by the list mailer,
please let me know if you do need it) - for a layman as myself it looks like
it blocks when calling _umtx_op which leads one to think the issue may be
somewhere in the threading functionality. Google-ing didn't get me any
further than that so any help would be great.


 92181 python2.4 5.795119 RET   read 4096/0x1000
 92181 python2.4 5.795146 CALL
mmap(0,0xf7000,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_NOCORE,0x5,0,0)
 92181 python2.4 5.795211 RET   mmap 679628800/0x28825000
 92181 python2.4 5.795243 CALL
mprotect(0x2891a000,0x1000,PROT_READ|PROT_WRITE|PROT_EXEC)
 92181 python2.4 5.795271 RET   mprotect 0
 92181 python2.4 5.795358 CALL
mprotect(0x2891a000,0x1000,PROT_READ|PROT_EXEC)
 92181 python2.4 5.795398 RET   mprotect 0
 92181 python2.4 5.795424 CALL
mmap(0x2891b000,0x1000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED,0x5,0xf6000,0)
 92181 python2.4 5.795475 RET   mmap 680636416/0x2891b000
 92181 python2.4 5.795565 CALL  close(0x5)
 92181 python2.4 5.795611 RET   close 0
 92181 python2.4 5.795717 CALL
mmap(0,0x960,PROT_READ|PROT_WRITE,MAP_ANON,0xffffffff,0,0)
 92181 python2.4 5.795777 RET   mmap 675278848/0x283ff000
 92181 python2.4 5.796732 CALL  munmap(0x283ff000,0x960)
 92181 python2.4 5.796884 RET   munmap 0
 92181 python2.4 5.797950 CALL
mmap(0,0xc20,PROT_READ|PROT_WRITE,MAP_ANON,0xffffffff,0,0)
 92181 python2.4 5.798055 RET   mmap 675278848/0x283ff000
 92181 python2.4 5.798305 CALL  munmap(0x283ff000,0xc20)
 92181 python2.4 5.798389 RET   munmap 0
 92181 python2.4 5.800590 CALL
mmap(0,0x340,PROT_READ|PROT_WRITE,MAP_ANON,0xffffffff,0,0)
 92181 python2.4 5.800703 RET   mmap 675278848/0x283ff000
 92181 python2.4 5.800882 CALL  munmap(0x283ff000,0x340)
 92181 python2.4 5.800946 RET   munmap 0
 92181 python2.4 5.801528 CALL
mmap(0,0x16a8,PROT_READ|PROT_WRITE,MAP_ANON,0xffffffff,0,0)
 92181 python2.4 5.801618 RET   mmap 680640512/0x2891c000
 92181 python2.4 5.802030 CALL  munmap(0x2891c000,0x16a8)
 92181 python2.4 5.802117 RET   munmap 0
 92181 python2.4 5.805202 CALL
mmap(0,0x6ba8,PROT_READ|PROT_WRITE,MAP_ANON,0xffffffff,0,0)
 92181 python2.4 5.805329 RET   mmap 680640512/0x2891c000
 92181 python2.4 5.806707 CALL  munmap(0x2891c000,0x6ba8)
 92181 python2.4 5.806838 RET   munmap 0
 92181 python2.4 5.808098 CALL
mmap(0,0x260,PROT_READ|PROT_WRITE,MAP_ANON,0xffffffff,0,0)
 92181 python2.4 5.808210 RET   mmap 675278848/0x283ff000
 92181 python2.4 5.808427 CALL  munmap(0x283ff000,0x260)
 92181 python2.4 5.808498 RET   munmap 0
 92181 python2.4 5.809028 CALL
mmap(0,0xef8,PROT_READ|PROT_WRITE,MAP_ANON,0xffffffff,0,0)
 92181 python2.4 5.809107 RET   mmap 675278848/0x283ff000
 92181 python2.4 5.809395 CALL  munmap(0x283ff000,0xef8)
 92181 python2.4 5.809468 RET   munmap 0
 92181 python2.4 5.810582 CALL
mmap(0,0x230,PROT_READ|PROT_WRITE,MAP_ANON,0xffffffff,0,0)
 92181 python2.4 5.810682 RET   mmap 675278848/0x283ff000
 92181 python2.4 5.810833 CALL  munmap(0x283ff000,0x230)
 92181 python2.4 5.810912 RET   munmap 0
 92181 python2.4 5.811169 CALL  sigprocmask(SIG_SETMASK,0x281308d0,0)
 92181 python2.4 5.811214 RET   sigprocmask 0
 92181 python2.4 5.811301 CALL  getpid
 92181 python2.4 5.811327 RET   getpid 92181/0x16815
 92181 python2.4 5.811413 CALL
__sysctl(0xbfbfc450,0x2,0x28824370,0xbfbfc458,0,0)
 92181 python2.4 5.811458 RET   __sysctl 0
 92181 python2.4 5.811487 CALL
__sysctl(0xbfbfc3e4,0x2,0xbfbfc37c,0xbfbfc3ec,0x288210ac,0xd)
 92181 python2.4 5.811559 RET   __sysctl 0
 92181 python2.4 5.811590 CALL
__sysctl(0xbfbfc37c,0x3,0x28823668,0xbfbfc458,0,0)
 92181 python2.4 5.811623 RET   __sysctl 0
 92181 python2.4 5.811664 CALL  thr_self(0x28401500)
 92181 python2.4 5.811690 RET   thr_self 0
 92181 python2.4 5.811716 CALL
mmap(0xbf9ff000,0x1000,PROT_NONE,MAP_ANON,0xffffffff,0,0)
 92181 python2.4 5.811750 RET   mmap -1080033280/0xbfa00000
 92181 python2.4 5.811776 CALL  thr_set_name(0x18701,0x288210f4)
 92181 python2.4 5.811802 RET   thr_set_name 0
 92181 python2.4 5.811823 CALL  rtprio_thread(0,0x18701,0xbfbfc3ec)
 92181 python2.4 5.811876 RET   rtprio_thread 0
 92181 python2.4 5.811903 CALL  sysarch(0xa,0xbfbfc400)
 92181 python2.4 5.811929 RET   sysarch 0
 92181 python2.4 5.811955 CALL
sigprocmask(SIG_SETMASK,0xbfbfc440,0xbfbfc430)
 92181 python2.4 5.811982 RET   sigprocmask 0
 92181 python2.4 5.812007 CALL  sigaction(SIG 32,0xbfbfc3dc,0)
 92181 python2.4 5.812035 RET   sigaction 0
 92181 python2.4 5.812060 CALL  sigprocmask(SIG_SETMASK,0xbfbfc430,0)
 92181 python2.4 5.812087 RET   sigprocmask 0
 92181 python2.4 5.812156 CALL  sigprocmask(SIG_BLOCK,0x281308c0,0xbfbfc47c)
 92181 python2.4 5.812182 RET   sigprocmask 0
 92181 python2.4 5.812208 CALL  sigprocmask(SIG_SETMASK,0x281308d0,0)
 92181 python2.4 5.812234 RET   sigprocmask 0
 92181 python2.4 5.813298 CALL  _umtx_op(0x284053a0,0x8,0x1,0x28405380,0)
 92181 python2.4 23.756523 RET   _umtx_op -1 errno 4 Interrupted system call
 92181 python2.4 23.756688 PSIG  SIGKILL SIG_DFL

Thanks a lot,
Dragos.

_______________________________________________
Psycopg mailing list
Psycopg-IAPFreCvJWPBWskQ1e/[email protected]
http://lists.initd.org/mailman/listinfo/psycopg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.