Skip to content

Commit 2e37e96

Browse files
committed
Add /crashme for py and js
1 parent 35cec2e commit 2e37e96

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

utils/build/docker/nodejs/express/app.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ app.get('/healthcheck', (req, res) => {
7878
})
7979
})
8080

81+
app.get('/crashme', (req, res) => {
82+
// Endpoint that causes a segmentation fault for crash tracking tests
83+
process.kill(process.pid, 'SIGSEGV')
84+
})
85+
8186
app.post('/waf', uploadToMemory.single('foo'), (req, res) => {
8287
res.send('Hello\n')
8388
})

utils/build/docker/python/flask/app.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def check_and_create_users_table():
253253
# Check if 'users' exists
254254
cur.execute("""
255255
SELECT EXISTS (
256-
SELECT FROM information_schema.tables
256+
SELECT FROM information_schema.tables
257257
WHERE table_name = 'users'
258258
);
259259
""")
@@ -2011,3 +2011,10 @@ def external_request():
20112011
)
20122012
except urllib.error.HTTPError as e:
20132013
return jsonify({"status": int(e.status), "error": repr(e)})
2014+
2015+
@app.route("/crashme", methods=["GET"])
2016+
def crashme():
2017+
"""Endpoint that causes a segmentation fault for crash tracking tests"""
2018+
import ctypes
2019+
ctypes.string_at(0) # This will cause a segmentation fault (SIGSEGV)
2020+
return "This should never be reached"

0 commit comments

Comments
 (0)