[GH-ISSUE #376] Monolog segfault with BIG message. #131

Closed
opened 2026-03-04 02:12:27 +03:00 by kerem · 3 comments
Owner

Originally created by @lyrixx on GitHub (Jun 12, 2014).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/376

Of course, It's a bad idea to log BIG message, I will remove this log call from my code.
But this call github.com/Seldaek/monolog@25b16e8019/src/Monolog/Formatter/LineFormatter.php (L111) can segfault.

The same issue appear in Symfony few month ago, see https://github.com/symfony/symfony/pull/10231

Originally created by @lyrixx on GitHub (Jun 12, 2014). Original GitHub issue: https://github.com/Seldaek/monolog/issues/376 Of course, It's a bad idea to log BIG message, I will remove this log call from my code. But this call https://github.com/Seldaek/monolog/blob/25b16e801979098cb2f120e697bfce454b18bf23/src/Monolog/Formatter/LineFormatter.php#L111 can segfault. The same issue appear in Symfony few month ago, see https://github.com/symfony/symfony/pull/10231
kerem 2026-03-04 02:12:27 +03:00
  • closed this issue
  • added the
    Bug
    label
Author
Owner

@Seldaek commented on GitHub (Jun 15, 2014):

Did you actually experience it segfaulting? Because unless you have really a laaarge set of blank lines in the message I think that regex should do ok, it's very simple.

<!-- gh-comment-id:46111604 --> @Seldaek commented on GitHub (Jun 15, 2014): Did you actually experience it segfaulting? Because unless you have really a laaarge set of blank lines in the message I think that regex should do ok, it's very simple.
Author
Owner

@Seldaek commented on GitHub (Jun 15, 2014):

Besides I am not so sure what else we could do, except maybe a dumber str_replace in case the strlen() is bigger than X

<!-- gh-comment-id:46111616 --> @Seldaek commented on GitHub (Jun 15, 2014): Besides I am not so sure what else we could do, except maybe a dumber str_replace in case the strlen() is bigger than X
Author
Owner

@lyrixx commented on GitHub (Jun 15, 2014):

yes, yes. I did experience this segault (on prod). I use this hack to find the segfault, then I commented the line, and then everything went fine.

But as PHP died, I not sure about the line. But in the output, The lastes calls were inside monolog

<!-- gh-comment-id:46111848 --> @lyrixx commented on GitHub (Jun 15, 2014): yes, yes. I did experience this segault (on prod). I use this [hack](https://gist.github.com/lyrixx/17074868cdfabd4c783e) to find the segfault, then I commented the line, and then everything went fine. But as PHP died, I not sure about the line. But in the output, The lastes calls were inside monolog
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#131
No description provided.