Well, not much data here.
I can only see that something in MySQL causes a memory-related problem.
You can try to debug it this way: build both MySQL and Pinba with --enable-debug (it's --with-debug for MySQL)
and run MySQL with valgrind:
valgrind --tool=memcheck --leak-check=yes --num-callers=30 --show-reachable=yes --log-file=/tmp/mysql.log /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var --user=mysql --log-error=/usr/local/mysql/var/mysqld.log --pid-file=/usr/local/mysql/var/thinkpad.pid --socket=/usr/local/mysql/var/mysql.sock --port=3306
(you may need to change the paths)
Send me that /tmp/mysql.log after the crash.
--
Wbr,
Antony Dovgal
---
http://pinba.org - realtime statistics for PHP
> ==23535== Invalid write of size 1
> ==23535== at 0x4C28504: memcpy (mc_replace_strmem.c:402)
> ==23535== by 0x8540B05: pinba_update_report4_add(_pinba_report*,
> _pinba_stats_record const*) (data.cc:311)
> ==23535== by 0x8542871: pinba_update_reports_add
> (_pinba_stats_record const*) (data.cc:1246)
> ==23535== by 0x85464FF: pinba_merge_pools() (pool.cc:450)
> ==23535== by 0x854515D: pinba_stats_main(void*) (pool.cc:498)
> ==23535== by 0x4E333B9: start_thread (in /lib/libpthread-2.9.so)
> ==23535== by 0x6350FCC: clone (in /lib/libc-2.9.so)
> ==23535== Address 0x18540b95 is not stack'd, malloc'd or (recently)
> free'd
Unfortunately, this part doesn't make much sense (to me) either..
There is a check right before memcpy() to make sure the data fits the buffer
(and if it doesn't, we truncate it), so it doesn't matter how long your script names are,
Pinba stores only 128 first symbols.
Could you plz send me the full log?
Also what's your version of Judy, your OS and you architecture?
Can you reproduce the crash reliably?
Could you check if the following patch fixes it for you?
http://dev.daylessday.org/diff/pinba_memcpy_static.diff
Yes, I've taken care of those, too.
Thanks again for the report.
Just a quick nerd note.
hostname record size, which is defined in pinba_types.h in pinba engine
#define PINBA_HOSTNAME_SIZE 17
is kinda low for some cases
of course it's easy to change the value there (and in extension part
if needed we more than 32 symbols in hostname)
but it's not an everyday thing regular user do.
probably it would be better to increase this limit?
what do you think?
Best Regards,
Evgeniy Potapov
eapo...@gmail.com
IIRC there are no hard-coded limits in the extension, what do you mean?
> but it's not an everyday thing regular user do.
>
> probably it would be better to increase this limit?
> what do you think?
Maybe.
What makes me uncertain it's that you're the first to ask about it,
therefore it doesn't seem to be a problem for others.
But keeping this number low helps to keep memory consumption lower.
Can you explain why did you need to raise this limit?
correct me if I'm wrong but I know the only one reason when it really
matters - if you have static buffer for this ;)
>
> Can you explain why did you need to raise this limit?
From the user point of view 64 should be quite OK for the hostname. To
be limited with 17 is a very big surprise. Why not 15? or 13?
--
wbr,
fisher
Sure, it's static and it's used for each & every record, so +15 bytes to this buffer
means increasing overall memory consumption on pinba_request_pool_size*15 bytes (18Mb in our particular case).
>> Can you explain why did you need to raise this limit?
>
>>From the user point of view 64 should be quite OK for the hostname. To
> be limited with 17 is a very big surprise. Why not 15? or 13?
It's as easy as 16 (a good round number, yes) + 1 for the null terminator =)
It would be great to have a method to change the hostname, like this:
pinba_hostname_set('bla-bla-bla').
This method suppose to change the hostname on the right one or on the
readable alias.
--
Nikolay Didenko
Added, feel free to test the snapshot.
Diff: http://github.com/tony2001/pinba_extension/commit/20a01074f4046e27a902b0bfd7800210debf5063
Snapshot: http://pinba.org/files/snapshots/pinba_extension-latest.tar.gz
The hostname is now reset to the result of gethostname() on each request startup,
so that custom hostname set in the current request won't affect the following ones.
Thank you!
--
Best regards,
Nikolay Didenko.