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 on large POST body #10

Open
mnutt opened this issue Aug 26, 2021 · 0 comments
Open

Segfault on large POST body #10

mnutt opened this issue Aug 26, 2021 · 0 comments

Comments

@mnutt
Copy link

mnutt commented Aug 26, 2021

I'm seeing a segfault when POSTing with a large-ish (400KB) content body when running a pillow server on qt 5.10. The segfault I get is:

#0  0x00007ffff4c1e77e in Pillow::HttpConnectionPrivate::initialize (this=0x60400000b080) at HttpConnection.cpp:146
#1  0x00007ffff4c1cac8 in Pillow::HttpConnection::initialize (this=0x600600007f60, inputDevice=0x6004002e5f10, outputDevice=0x6004002e5f10) at HttpConnection.cpp:664
#2  0x00007ffff4c10064 in Pillow::HttpServer::incomingConnection (this=0x7fffffffe330, socketDescriptor=12) at HttpServer.cpp:92
#3  0x00007ffff7f4a4b0 in QTcpServerPrivate::readNotification (this=0x60200000f940) at socket/qtcpserver.cpp:221
#4  0x00007ffff7f54441 in QReadNotifier::event (this=<optimized out>, e=<optimized out>) at socket/qnativesocketengine.cpp:1274
#5  0x00007ffff1735f3c in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x6006000075a0, e=0x7fffffffde80) at kernel/qapplication.cpp:3732
#6  0x00007ffff173d070 in QApplication::notify (this=0x7fffffffe270, receiver=0x6006000075a0, e=0x7fffffffde80) at kernel/qapplication.cpp:3491
#7  0x00007ffff0d66d25 in QCoreApplication::notifyInternal2 (receiver=0x6006000075a0, event=event@entry=0x7fffffffde80) at kernel/qcoreapplication.cpp:1050
#8  0x00007ffff0dbaa0e in QCoreApplication::sendEvent (event=0x7fffffffde80, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:234
#9  socketNotifierSourceDispatch (source=0x601600009830) at kernel/qeventdispatcher_glib.cpp:106
#10 0x00007fffeb3afe14 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007fffeb3b0058 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#12 0x00007fffeb3b00fc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#13 0x00007ffff0db9ddc in QEventDispatcherGlib::processEvents (this=0x60060000cfd0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#14 0x00007fffe5483451 in QPAEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /opt/qt510/plugins/platforms/libheadless.so
#15 0x00007ffff0d652ab in QEventLoop::exec (this=this@entry=0x7fffffffe0a0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#16 0x00007ffff0d6dc14 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1338
#17 0x0000000000453e1a in main (argc=1, argv=0x7fffffffe4b8) at main.cpp:130

The line: https://github.com/acossette/pillow/blob/master/pillowcore/HttpConnection.cpp#L146

When this happens, the first request actually completes successfully but the following request is the one that segfaults. I've debugged it, and it looks like _requestBuffer.data_ptr()->size is already zero so I'm not sure why setting it to zero again might be an issue?

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

1 participant