facebook / facebook/hhvm

Exceeding ImageMagick time limit crashes proxygen server

Open
#8,053 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
18.7k
Forks
3.1k
Avg merge
1h 47m
Merged PRs (30d)
2

Description

### HHVM Version
HipHop VM 3.23.2 (rel)

### Standalone code, or other way to reproduce the problem
1. Set time limit with $HOME/.config/ImageMagick/policy.xml
````

````

2. crash.hh
````
scaleImage(2000, 2000, true);
$image->setImageFormat("jpeg");
$image->writeImage('big2.jpg');
````

3. start the server and load crash.hh
````
hhvm -m server -p 8080
````

### Expected result
Throw ImagickException, error uncaught, http 500, etc...

### Actual result
1. stdout: `hhvm: time limit exceeded Operation canceled @ fatal/cache.c/GetImagePixelCache/1507. `
2. Server stops responding to new connections
3. Sometimes segfaults
4. Sometimes stdout `"Shutdown state=2, a/q/e/p 1/0/1/0, RSS=113Mb"` repeatedly

````
ProcessID: 7281
ThreadID: 140025878542080
ThreadPID: 7284
Name: /usr/bin/env
Type: Segmentation fault
Runtime: hhvm
Version: 1511206599_661801426
DebuggerCount: 0

# 0 0000000000d68886
# 1 0000000000fc3742
# 2 00007f5a70776390
# 3 00000000019beb0a
# 4 0000000000fce8f5
# 5 00000000012021b1
# 6 00007f5a6ae98c80
# 7 00007f5a7076c6ba
# 8 00007f5a6a5fe3dd
````

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.