Giter VIP home page Giter VIP logo

Comments (11)

saghul avatar saghul commented on August 11, 2024

Can you print the values of buf, pbuf and length on the second frame?

from pyuv.

geertj avatar geertj commented on August 11, 2024
(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.

saghul avatar saghul commented on August 11, 2024

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.

geertj avatar geertj commented on August 11, 2024

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.

saghul avatar saghul commented on August 11, 2024

Doh! Can you just paste how the compilation options look like and what compiler you are using? Thanks for the help!

from pyuv.

geertj avatar geertj commented on August 11, 2024

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.

saghul avatar saghul commented on August 11, 2024

Thanks! I'll check with a debian system and the same gcc version, hopefully I can reproduce it.

from pyuv.

bnoordhuis avatar bnoordhuis commented on August 11, 2024

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.

saghul avatar saghul commented on August 11, 2024

Thanks for your input @bnoordhuis, much appreciated!

from pyuv.

saghul avatar saghul commented on August 11, 2024

@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.

geertj avatar geertj commented on August 11, 2024

Latest master fixes the issue. Thanks!

from pyuv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.