monit dies with "raised in StringBuffer_free at src/util/StringBuffer.c:103"
On monit 5.16 we get:
raised in StringBuffer_free at src/util/StringBuffer.c:103
when monit try to restart our tomcat after it detects a "java.lang.OutOfMemoryError" in catalina.out.
If I comment:
# if match "java.lang.OutOfMemoryError" then restart
then monit is able to start properly.
Comments (7)
-
reporter -
reporter - edited description
-
repo owner -
assigned issue to
- edited description
-
assigned issue to
-
repo owner I’m unable to reproduce the problem … tried the current 5.27.0 development head (https://bitbucket.org/tildeslash/monit/src/master/)
If you can still reproduce the problem, please can you run monit in debugger and get a backtrace?:
gdb monit (gdb) run -vI ... when it aborts: (gdb) bt
-
I’m getting this exception using a file content match. Here’s the gist: https://gist.github.com/geewiz/cd873e4589096d4afe280dcf73dfae73
-
repo owner - changed status to resolved
Fixed: Issue
#519: Monit may crash if the file check with a restart action on content match is used and this file has some dependant services at the same time.Backtrace with hardware watchdog on ml->log:
(gdb) c Continuing.
Thread 1 "monit" hit Hardware watchpoint 3: *$2
Old value = { used = 36, length = 512, buffer = 0x0, compressedBuffer = 0x0 } New value = { used = 1325400066, length = 512, buffer = 0x0, compressedBuffer = 0x0 } 0x00007ffff75ba95e in ?? () from /lib/x86_64-linux-gnu/libasan.so.5 (gdb) bt #0 0x00007ffff75ba95e in ?? () from /lib/x86_64-linux-gnu/libasan.so.5
#10x00007ffff769b799 in free () from /lib/x86_64-linux-gnu/libasan.so.5#20x000055555591f0b8 in StringBuffer_free (S=0x606000000c40) at src/util/StringBuffer.c:111#30x0000555555859a38 in _checkMatch (s=0x616000001280) at src/validate.c:1169#4check_file (s=0x616000001280) at src/validate.c:1705 #5 0x00005555557cf89f in _check (s=0x616000001280) at src/control.c:201#6_doStart (s=s@entry=0x616000000380) at src/control.c:231#70x00005555557d0a58 in _doDepend (s=s@entry=0x616000001280, action=action@entry=Action_Start, unmonitor=unmonitor@entry=false) at src/control.c:389#80x00005555557d15ef in control_service (S=<optimized out>, A=A@entry=Action_Restart) at src/control.c:481#90x00005555557d3f35 in _handleAction (E=0x6070000005d0, A=<optimized out>) at src/event.c:329#100x00005555557d5a55 in _handleEvent (E=0x6070000005d0, S=0x616000001280) at src/event.c:381 #11 Event_post (service=0x616000001280, id=<optimized out>, state=<optimized out>, action=<optimized out>, s=<optimized out>) at src/event.c:459#120x00005555558599db in _checkMatch (s=0x616000001280) at src/validate.c:1167#13check_file (s=0x616000001280) at src/validate.c:1705#140x000055555584befd in validate () at src/validate.c:1502#150x0000555555785edd in do_default () at src/monit.c:588#16do_action (arguments=0x603000000280) at src/monit.c:417#17main (argc=<optimized out>, argv=<optimized out>) at src/monit.c:175 (gdb) c Continuing. 'dependant' start: '/usr/bin/true' [Detaching after vfork from child process 1119186] 'dependant' failed to start (exit status 0) -- no outputDEBUG: ml->log=(nil) -- before StringBuffer_free AssertException: S && *S raised in StringBuffer_free at src/util/StringBuffer.c:108
Thread 1 "monit" received signal SIGABRT, Aborted. GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb) bt #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#10x00007ffff650e859 in __GI_abort () at abort.c:79#20x0000555555781138 in vLogAbortHandler (s=0x5555559b4960 "%s: %s\n raised in %s at %s:%d\n", ap=<optimized out>) at src/log.c:334#30x00005555559178cc in System_abort (e=e@entry=0x5555559b4960 "%s: %s\n raised in %s at %s:%d\n") at src/system/System.c:78#40x00005555559070f6 in Exception_throw (e=0x555555bfb0e0 <AssertException>, func=func@entry=0x5555559b8600 <__func.6022> "StringBuffer_free", file=file@entry=0x5555559b8040 "src/util/StringBuffer.c", line=line@entry=108, cause=cause@entry=0x5555559b80c0 "S && *S") at src/exceptions/Exception.c:104 #5 0x000055555591f118 in StringBuffer_free (S=0x606000000c40) at src/util/StringBuffer.c:111#60x0000555555859a38 in _checkMatch (s=0x616000001280) at src/validate.c:1169#7check_file (s=0x616000001280) at src/validate.c:1705#80x000055555584befd in validate () at src/validate.c:1502#90x0000555555785edd in do_default () at src/monit.c:588#10do_action (arguments=0x603000000280) at src/monit.c:417 #11 main (argc=<optimized out>, argv=<optimized out>) at src/monit.c:175→ <<cset a2713ac76cc4>>
-
Wow, that was quick! I appreciate your efforts, thank you.
- Log in to comment
On monit 5.20 I get: [CET Dec 10 15:21:34] critical : AssertException: S && *S raised in StringBuffer_free at src/util/StringBuffer.c:107