* Jason Baron <[email protected]> [2010-08-17 10:37:25]:

> On Sat, Aug 14, 2010 at 10:38:27AM +0530, Balbir Singh wrote:
> > >> I have the python wrapper working to a large degree
> > >>
> > >
> > > cool!
> > >
> > >> 1. Please provide input if it works at your end
> > >
> > > hmmm...I'm getting a Segmentation fault, which is coming from the inner
> > > read stats loop. If I comment out the inner loop, I get a correct
> > > listing of the directories.
> > >
> > > Haven't been able to narrow it down more than that yet...using libcgroup
> > > libcgroup-0.36.2-2.fc15.i686. However, my python pkg might be outdated
> > > i'm using: Python 2.6.4. I'll re-test after upgrading.
> > >
> > 
> > Could you please narrow down using gdb and see where the dump is
> > coming from. Are you suggesting that ret, p =
> > cgroup_read_stats_next(p, cg_stat) in python code is causing the
> > problem? python 2.6.4 is good, 2.7 would require movement to the
> > capsule module in python. What version of swig are you using?
> > 
> > Balbir
> 
> Hi,
> 
> so the output from the unmodified script is:
> 
> "
> $ ./try.py 
> 
> Directory /
> 
> :
> Segmentation fault (core dumped)
> "
> 
> running gdb on the resulting core:
> 
> Core was generated by `/usr/bin/python ./try.py'.
> Program terminated with signal 11, Segmentation fault.
> #0  0x002c31b8 in _IO_getdelim (lineptr=0xbf9fb8dc, n=0xbf9fb8d8,
> delimiter=10, fp=0xb776fb78) at iogetdelim.c:58
> 58      _IO_acquire_lock (fp);
> (gdb) bt
> #0  0x002c31b8 in _IO_getdelim (lineptr=0xbf9fb8dc, n=0xbf9fb8d8,
> delimiter=10, fp=0xb776fb78) at iogetdelim.c:58

I am sure the fp here is invalid, does print *fp at frame 0 give
anything useful?

> #1  0x00761b33 in getline (fp=<value optimized out>,
> cgroup_stat=0xa0c6950) at /usr/include/bits/stdio.h:118
> #2  cg_read_stat (fp=<value optimized out>, cgroup_stat=0xa0c6950) at
> api.c:2786
> #3  0x00765f65 in cgroup_read_stats_next (handle=0xbf9fb944,
> cgroup_stat=0xa0c6950) at api.c:2836
> Let me know what additional information I can provide. I did update this
> system to Python 2.7, but I was seeing the same crash with the previous
> 2.6.4. I'm using SWIG Version 2.0.0
>

I am using python 2.6.4 as well, but swig 1.3.40, I've not tried swig
2.0.0. Could you please post the generated wrapper libcgroup_wrap.c?

-- 
        Three Cheers,
        Balbir

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to