Skip to content

SEGV on multiple semi-parallel clients. #27

Open

Description

@0x10

I used the master branch.
Compile went without problems with g++ 4.7.3:
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.3-4' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --with-system-zlib --enable-objc-gc --with-cloog --enable-cloog-backend=ppl --disable-cloog-version-check --disable-ppl-version-check --enable-multiarch --with-arch-32=i586 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.3 (Debian 4.7.3-4)

I started the webserver with:
gdb webserver

And called multiple clients:
for run in {1..300} ; do
./webclient&
done

And it crashed. Looks like there is a uv_handle missing...

Program received signal SIGSEGV, Segmentation fault.
0x00000000004069d9 in native::base::stream::write(char const*, int, std::function<void (native::error)>) (this=0x642650, buf=0x642588 "HTTP/1.1 200 OK\r\nContent-Length: 8\r\nContent-Type: text/plain\r\n\r\nC++ FTW\n", len=72, callback=...) at ./native/stream.h:75
75 callbacks::store(get()->data, native::internal::uv_cid_write, callback);

(gdb) disassemble
Dump of assembler code for function native::base::stream::write(char const_, int, std::function<void (native::error)>):
...
0x00000000004069d4 <+50>: callq 0x409536 native::base::handle::get<uv_handle_s()>
=> 0x00000000004069d9 <+55>: mov 0x8(%rax),%rax
0x00000000004069dd <+59>: mov -0x50(%rbp),%rdx
0x00000000004069e1 <+63>: mov $0x0,%ecx
0x00000000004069e6 <+68>: mov $0x3,%esi
0x00000000004069eb <+73>: mov %rax,%rdi
0x00000000004069ee <+76>: callq 0x40969b <native::callbacks::store<std::function<void (native::error)> >(void_, int, std::function<void (native::error)> const&, void*)>
...

Activity

  1. sebjameswml commented on Nov 22, 2013

    @sebjameswml
    Contributor

    @0x10 - can you test with my fork of the code at https://github.com/sebjameswml/node.native ?

    Let me know if you still see this problem.

  2. 0x10 commented on Nov 25, 2013

    @0x10
    Author

    As far as I can say, the segfault did not appear anymore. I did some other concurrent/parallel tests and it seems fine.

    What was the problem?

  3. sebjameswml commented on Nov 26, 2013

    @sebjameswml
    Contributor

    It was a memory management problem; same core problem as Issue#28.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions