Comments (11)
Can you print the values of buf, pbuf and length on the second frame?
from pyuv.
(gdb) frame 2
#2 FS_func_write (obj=<optimized out>, args=<optimized out>, kwargs=<optimized out>) at src/fs.c:2247
2247 memcpy(buf, pbuf, length);
(gdb) p buf
$1 = 0x6ce450 "\250\027\333R6"
(gdb) p pbuf
$2 = 0x7fff00000000 <Address 0x7fff00000000 out of bounds>
(gdb) p length
$3 = <optimized out>
from pyuv.
Can you please build the extension with debug symbols and show me the backtrace again? You can just do ./build_inplace -g, that should do it.
from pyuv.
I actually had to add this to setup.py: extra_compile_args = ['-O0', '-g']
. Otherwise it didn't work.
The problem is, it isn't segfaulting when compiled without optimization.... Unfortunately I am running out of time. I just tested on Amazon EC2, and I am able to reproduce the issue on the standard Fedora 17 image (ami-2ea50247 in us-east-1). So if you wanted you could fire up your own instance and see if you can troubleshoot it there...
from pyuv.
Doh! Can you just paste how the compilation options look like and what compiler you are using? Thanks for the help!
from pyuv.
See below. This system is a Fedora 18 system but I get the same result on F17.
$ sh build_inplace
running build_ext
No need to build libuv.
building 'pyuv' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DMODULE_VERSION=0.9.4.dev -DLIBUV_REVISION=ba83510 -I/usr/include/python2.7 -Ideps/libuv/include -c src/pyuv.c -o build/temp.linux-x86_64-2.7/src/pyuv.o -O0 -g
In file included from /usr/include/limits.h:26:0,
from /usr/lib/gcc/x86_64-redhat-linux/4.7.2/include/limits.h:169,
from /usr/lib/gcc/x86_64-redhat-linux/4.7.2/include/syslimits.h:7,
from /usr/lib/gcc/x86_64-redhat-linux/4.7.2/include/limits.h:34,
from /usr/include/python2.7/Python.h:19,
from src/pyuv.h:7,
from src/pyuv.c:2:
/usr/include/features.h:330:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
gcc -pthread -shared -Wl,-z,relro build/temp.linux-x86_64-2.7/src/pyuv.o deps/libuv/libuv.a -L/usr/lib64 -lpython2.7 -lrt -o /home/geertj/Source/pyuv/pyuv.so
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.7.2/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --disable-build-with-cxx --disable-build-poststage1-with-cxx --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.7.2 20121109 (Red Hat 4.7.2-8) (GCC)
from pyuv.
Thanks! I'll check with a debian system and the same gcc version, hopefully I can reproduce it.
from pyuv.
If I were to hazard a guess, I'd say that you need to add -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64.
from pyuv.
Thanks for your input @bnoordhuis, much appreciated!
from pyuv.
@geertj can you try latest master? I managed to reproduce the fix on my Debian machine. FWIW I could only reproduce it with gcc 4.7, but not 4.6.
from pyuv.
Latest master fixes the issue. Thanks!
from pyuv.
Related Issues (20)
- Support abstract socket addresses in Pipe.bind/Pipe.connect HOT 2
- Test errors on OSX HOT 1
- pip installation failure on Windows 10 HOT 1
- preexec_fn on Process.spawn HOT 1
- tcp readed data has other bytes than expected HOT 4
- error AttributeError: 'pyuv._cpyuv.Signal' object has no attribute 'unref' HOT 1
- AttributeError: 'pyuv._cpyuv.Prepare' object has no attribute 'unref' HOT 1
- Tasks scheduled via loop.queue_work() HOT 2
- how to bind port both ipv4 and ipv6 HOT 4
- pyuv UDP multi-NIC, Send A-IP? and Recv B-IP? HOT 6
- Pip install breaking in MacOS HOT 8
- Documentation points to old libuv link
- install error on Mac with Homebrew python 3.8.3 HOT 2
- try_write on Pipe gives 'resource temporarily unavailable'
- No wheels for py >= 3.7 HOT 2
- Use `Py_SET_REFCNT(self, refcnt);` instead of `Py_REFCNT(self) = refcnt;`. HOT 11
- pyuv doesn't compile with Python 3.10 HOT 3
- An error in Poll handles example HOT 3
- Push the new versions to PyPI HOT 5
- src/handle.c:17:21: error: lvalue required as left operand of assignment HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyuv.