Hi Johannes, Chris,

Thanks to the both of you for progressing troubleshooting of the problem.
A lot of interesting elements are already there but there is something not
clear yet about the nature of this issue:

* The SEGV appears to be in a pthread_getspecific() call while the MySQL
  plugin does not do any pthread-related call. Also a simple inet_ntoa()
  should not do that. Did you by any chance compile the package with the
  --enable-threads option? I don't think so but it's worth asking.

* Within the debugger i can see the following line: "Core was generated
  by `pmacctd: SQL Plugin -- DB Writer (urgent)". An urgent DB Writer can
  be triggered for two reasons - both related to the SQL cache: 1) memory
  is finished so it tries to purge the content of the cache to the DB in
  order to make room to further traffic or 2) the SQL cache size is too
  small for the traffic footprint. The value is expressed in cache entries,
  defaults to 32771 and can be tuned via the 'sql_cache_entries' config
  directive. Can you let me know about this point?

* Falling into an urgent DB writer and having the 'sql_dont_try_update'
  directive set to true can generate the duplicate SQL key message. The
  strange thing about it is that the key is reported truncated in the
  middle of an IP address '[...]-84.38.64.216-79.221.203.'. I actually
  can't think at anything which can originate this behaviour.

* Few days ago we received on this list a report from another user by
  which 'sql_multi_values' was causing a crash. Just to be sure, do you
  mind commenting this out and see if it helps? 

* If none of the above helps, i would suggest to proceed by simplifying
  the SQL-related configuration to a few statements, see if it works. If
  that's the case, then i would add statements back one by one. I would
  start with something like this:

  [ ... ]
  sql_db: pmacct
  sql_table: acct_v4
  sql_table_version: 4
  sql_passwd: verySecret ;)
  sql_user: pmacct
  sql_refresh_time: 60
  sql_history: 5m
  sql_history_roundoff: m
  ports_file: /etc/pmacct/ports
  [ ... ]

Let me know.

Cheers,
Paolo

On Mon, Apr 13, 2009 at 03:43:47PM +0200, Johannes Formann wrote:
> Hello,
> 
> I'll get this kind of error:
> Apr 13 15:27:15 server pmacctd[1341]: ERROR ( default/mysql ): Duplicate
> entry '0-00:1c:c0:74:5b:e9-00:00:0c:07:ac:6a-0-84.38.64.216-79.221.203.'
> for key 1  
> Apr 13 15:27:15 server kernel: pmacctd[1341]: segfault at f7002991 ip
> 00000000f7bfa9ca sp 00000000ffb88334 error 4 in
> libpthread-2.3.6.so[f7bf2000+e000]
> 
> Only when using sql_dont_try_update: true (without the databaseserver is
> stressed too much):
> 
> But I think the configuration is so, this shoudn't happen:
> ! pmacctd configuration
> !
> !
> !
> daemonize: true
> pidfile: /var/run/pmacctd.pid
> syslog: daemon
> !
> ! interested in in and outbound traffic
> !aggregate: src_host,dst_host
> aggregate:
> src_host,dst_host,dst_port,src_port,flows,dst_mac,proto,src_mac,vlan
> ! on this interface
> interface: eth0
> !
> post_tag: 1 
> ! storage methods
> plugins: mysql
> sql_db: pmacct
> sql_table: acct_v4
> sql_table_version: 4 
> sql_passwd: verySecret ;)
> sql_user: pmacct
> ! refresh the db every 5 minute
> sql_refresh_time: 300
> ! reduce the size of the insert/update clause
> sql_optimize_clauses: true
> ! accumulate values in each row for up to 5 minutes
> sql_history: 5m 
> ! create new rows on the minute, hour, day boundaries
> sql_history_roundoff: mhd
> ! Multivalue-Support, bei mysql schneller
> sql_multi_values: 1024000
> 
> ! nur interessante Ports, reduktion der Datenmenge
> ports_file: /etc/pmacct/ports
> ! nur inserts
> !sql_dont_try_update: true
> 
> ! intern puffern
> plugin_buffer_size: 2048
> plugin_pipe_size: 2048000
> 
> Any hints?
> 
> regards
> 
> Johannes
> 
> _______________________________________________
> pmacct-discussion mailing list
> http://www.pmacct.net/#mailinglists

_______________________________________________
pmacct-discussion mailing list
http://www.pmacct.net/#mailinglists

Reply via email to