Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault for concurrent > 1 #43

Closed
joshuamorris3 opened this issue Dec 12, 2015 · 6 comments
Closed

Segmentation fault for concurrent > 1 #43

joshuamorris3 opened this issue Dec 12, 2015 · 6 comments

Comments

@joshuamorris3
Copy link

This is related in part to my PR #42. Once I did get siege built in the docker-alpine base, when I ran siege with more than 1 concurrent users it would seg fault. I tried using gdb to get the backtrace (bt or where), but no trace was available. When I tried using the debian:jessie docker image as the base, I could use apt-get install siege (no build needed) and that worked just fine.

To recreate the segmentation fault:

  1. docker run --rm -it alpine sh
  2. Add the build dependencies: apk add --update alpine-sdk
  3. wget http://download.joedog.org/siege/siege-latest.tar.gz
  4. tar -zxvf siege-latest.tar.gz
  5. cd siege-3.1.3
  6. ./configure
  7. Add #include <sys/types.h> below line 24 of src/hash.c
  8. make
  9. Run the following: siege -r 1 -c 2 www.google.com
@JoeDog
Copy link
Owner

JoeDog commented Dec 12, 2015

Would you mind testing this:

http://download.joedog.org/siege/beta/siege-3.1.4-beta2.tar.gz

(That version also includes an overhaul of cookie handling, namely stored
persistence)

Jeff

On Sat, Dec 12, 2015 at 12:29 AM, Josh notifications@github.com wrote:

This is related in part to my PR #42
#42. Once I did get siege built in
the docker-alpine base, when I ran siege with more than 1 concurrent users
it would seg fault. I tried using gdb to get the backtrace (bt or where),
but no trace was available. When I tried using the debian:jessie docker
image as the base, I could use apt-get install siege (no build needed) and
that worked just fine.

To recreate the segmentation fault:

  1. docker run --rm -it alpine sh
  2. Add the build dependencies: apk add --update alpine-sdk
  3. wget http://download.joedog.org/siege/siege-latest.tar.gz
  4. tar -zxvf siege-latest.tar.gz
  5. cd siege-3.1.3
  6. ./configure
  7. Add #include below line 24 of src/hash.c
  8. make
  9. Run the following: siege -r 1 -c 2 www.google.com


Reply to this email directly or view it on GitHub
#43.

@joshuamorris3
Copy link
Author

Actually worse if I try it with the version you requested. Now it seg faults with concurrent = 1. I went back and tried it again with 3.1.3 and it behaved as I specified, with concurrent = 1 it works, > 1 and it seg faults.

@JoeDog
Copy link
Owner

JoeDog commented Dec 15, 2015

I'm not sure what do. I don't have docker-alpine (honestly, I'm not even
sure what that is.)

J.

On Sun, Dec 13, 2015 at 1:57 AM, Josh notifications@github.com wrote:

Actually worse if I try it with the version you requested. Now it seg
faults with concurrent = 1. I went back and tried it again with 3.1.3 and
it behaved as I specified, with concurrent = 1 it works, > 1 and it seg
faults.


Reply to this email directly or view it on GitHub
#43 (comment).

@joshuamorris3
Copy link
Author

No problem. Thanks for trying, for now I can use a debian docker image. It's much larger (170MB vs. 20MB), but it works. Docker alpine (https://github.com/gliderlabs/docker-alpine / http://alpinelinux.org/about/) is a minimal linux distro to make small Docker images. I might ask the Alpine guys if they've come across something similar. It's probably just a missing package.

@JoeDog
Copy link
Owner

JoeDog commented Dec 15, 2015

Let me know what you find out.

J.

On Tue, Dec 15, 2015 at 2:38 PM, Josh notifications@github.com wrote:

No problem. Thanks for trying, for now I can use a debian docker image.
It's much larger (170MB vs. 20MB), but it works. Docker alpine (
https://github.com/gliderlabs/docker-alpine /
http://alpinelinux.org/about/) is a minimal linux distro to make small
Docker images. I might ask the Alpine guys if they've come across something
similar. It's probably just a missing package.


Reply to this email directly or view it on GitHub
#43 (comment).

@jstarcher
Copy link

jstarcher commented Feb 16, 2017

Here is the trace:

Program terminated with signal SIGSEGV, Segmentation fault.
Core was generated by `siege -d1 -r10 -c25 example.com'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f3aa8a7539e in new_socket (C=C@entry=0x7f3aaa39d060, hostparam=<optimized out>, portparam=portparam@entry=80) at sock.c:193
193	  memcpy(&cli.sin_addr, hp->h_addr, hp->h_length);
[Current thread is 1 (LWP 118)]

Valgrind:

/ # valgrind siege -r1 -c1 example.com
==14== Memcheck, a memory error detector
==14== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==14== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==14== Command: siege -r1 -c1 example.com
==14==
==14== Invalid free() / delete / delete[] / realloc()
==14==    at 0x4C939EA: free (vg_replace_malloc.c:530)
==14==    by 0x405792D: ??? (in /lib/ld-musl-x86_64.so.1)
==14==  Address 0x4e9b180 is in a rw- mapped file /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so segment
==14==
==15== Warning: invalid file descriptor 1009024139 in syscall close()
==15== Invalid read of size 1
==15==    at 0x403E271: ??? (in /lib/ld-musl-x86_64.so.1)
==15==    by 0xFFEFFED17: ???
==15==    by 0xC88949C1894D5148: ???
==15==  Address 0xc88949c1894d5141 is not stack'd, malloc'd or (recently) free'd
==15==
==15==
==15== Process terminating with default action of signal 11 (SIGSEGV)
==15==  General Protection Fault
==15==    at 0x403E271: ??? (in /lib/ld-musl-x86_64.so.1)
==15==    by 0xFFEFFED17: ???
==15==    by 0xC88949C1894D5148: ???
==15==
==15== HEAP SUMMARY:
==15==     in use at exit: 771 bytes in 4 blocks
==15==   total heap usage: 4 allocs, 2 frees, 771 bytes allocated
==15==
==15== LEAK SUMMARY:
==15==    definitely lost: 0 bytes in 0 blocks
==15==    indirectly lost: 0 bytes in 0 blocks
==15==      possibly lost: 0 bytes in 0 blocks
==15==    still reachable: 771 bytes in 4 blocks
==15==         suppressed: 0 bytes in 0 blocks
==15== Rerun with --leak-check=full to see details of leaked memory
==15==
==15== For counts of detected and suppressed errors, rerun with: -v
==15== ERROR SUMMARY: 3 errors from 2 contexts (suppressed: 0 from 0)
==14== Warning: invalid file descriptor -1 in syscall close()
** SIEGE 4.0.3rc4
** Preparing 1 concurrent users for battle.
The server is now under siege...
==14==
==14== Process terminating with default action of signal 11 (SIGSEGV)
==14==  Bad permissions for mapped region at address 0x4085EC8
==14==    at 0x1134BF: cookies_header (cookies.c:172)
==14==
==14== Process terminating with default action of signal 11 (SIGSEGV)
==14==  Bad permissions for mapped region at address 0x4085E70
==14==    at 0x4A8D609: _vgnU_freeres (vg_preloaded.c:83)
==14==
==14== HEAP SUMMARY:
==14==     in use at exit: 114,804 bytes in 46 blocks
==14==   total heap usage: 1,300 allocs, 1,256 frees, 859,639 bytes allocated
==14==
==14== LEAK SUMMARY:
==14==    definitely lost: 424 bytes in 2 blocks
==14==    indirectly lost: 0 bytes in 0 blocks
==14==      possibly lost: 0 bytes in 0 blocks
==14==    still reachable: 114,380 bytes in 44 blocks
==14==         suppressed: 0 bytes in 0 blocks
==14== Rerun with --leak-check=full to see details of leaked memory
==14==
==14== For counts of detected and suppressed errors, rerun with: -v
==14== ERROR SUMMARY: 2 errors from 1 contexts (suppressed: 0 from 0)
Segmentation fault

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants