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

Segfault when called from make #22

Open
ole-tange opened this issue Mar 28, 2015 · 3 comments
Open

Segfault when called from make #22

ole-tange opened this issue Mar 28, 2015 · 3 comments

Comments

@ole-tange
Copy link

Add this to Makefile:

test:
echo > foo
./pxz foo

$ make test
echo > foo
./pxz foo
make: *** [test] Segmentation fault

@waffleking32
Copy link

I ran into this too and it looks like it is caused by 'make' changing the stack size ulimit to unlimited. Here is a repro that doesn't involve 'make'.

touch foo
ulimit -s unlimited
pxz foo

Running with strace give this.

getrlimit(RLIMIT_STACK, {rlim_cur=RLIM64_INFINITY, rlim_max=RLIM64_INFINITY}) = 0
mmap(NULL, 4611686018427392000, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
brk(0)                                  = 0x211e000
brk(0x400000000213f000)                 = 0x211e000
mmap(NULL, 4611686018427523072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
mmap(NULL, 134217728, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x2aaf58c0a000
munmap(0x2aaf58c0a000, 54484992)        = 0
munmap(0x2aaf60000000, 12623872)        = 0
mprotect(0x2aaf5c000000, 135168, PROT_READ|PROT_WRITE) = 0
mmap(NULL, 4611686018427392000, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV (core dumped) +++
Segmentation fault (core dumped)

@waffleking32
Copy link

You can work around this problem in your Makefile like this.

bash -c "ulimit -s 8192; pxz ..."

@ole-tange
Copy link
Author

Good there is a work-around, but it is not intuitive to the user that he should use this work-around. Can it be fixed so pxz does the work-around by itself?

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

2 participants