[CONC-591] C connector ignoring SIGPIPE Created: 2022-05-20 Updated: 2023-12-25 |
|
| Status: | Open |
| Project: | MariaDB Connector/C |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Corey Hickey | Assignee: | Georg Richter |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Debian Unstable |
||
| Description |
|
Hi, I have encountered an issue where a perl script which uses the MariaDB C connector (via DBD::MariaDB or DBD::mysql) ends up ignoring SIGPIPE. This results in problems such as:
I am pretty sure that I tracked this down to code in the C connector introduced in this commit: A backtrace seems to confirm this (note the ignore_sigpipe() at #4):
I filed a bug with DBD::MariaDB first, but word there is that the C connector should not be ignoring SIGPIPE. It seems like this behavior must exist for an intended purpose, but I don't know what that would be. Even if there is a good reason to ignore SIGPIPE, it does have some undesired consequences. Thanks, |
| Comments |
| Comment by Pali [ 2023-08-23 ] |
|
georg any comments for this issue? |
| Comment by Pali [ 2023-11-20 ] |
|
This issue really needs to be fixed in MariaDB C connector. It is really hard or maybe impossible to fix it in the application which uses MariaDB C connector library. I this comment I wrote all details about this issue and how to fix it: |
| Comment by Pali [ 2023-11-20 ] |
|
I think that the fix for MariaDB C connector could be simple. When MSG_NOSIGNAL is supported or SO_NOSIGPIPE is supported or Windows is used then do not call ignore_sigpipe(). This should be enough as MariaDB C connector is already using MSG_NOSIGNAL or SO_NOSIGPIPE when supported to prevent triggering SIGPIPE when writing to disconnected socket. |
| Comment by Pali [ 2023-12-25 ] |