[MXS-28] bugzillaId-433: Logging don't include assert information Created: 2014-01-16  Updated: 2019-12-19  Resolved: 2015-05-02

Status: Closed
Project: MariaDB MaxScale
Component/s: Core
Affects Version/s: None
Fix Version/s: 1.1.1

Type: Bug Priority: Minor
Reporter: Timofey Turenko Assignee: Timofey Turenko
Resolution: Fixed Votes: 0
Labels: None
Environment:

Linux



 Description   

This is imported from bugzilla item http://bugs.mariadb.com/show_bug.cgi?id=433

Description Vilho Raatikka 2014-05-16 20:49:27 UTC
Logging is not useful in cases where MaxScale asserts on user site. Assertions should print line number and file and possible some additional information to log files because standard outputs are often lost but logs are persistent.



 Comments   
Comment by Dipti Joshi (Inactive) [ 2015-03-09 ]

This is comment history imported from bugzilla:

Comment 1 Hartmut Holzgraefe 2014-08-15 01:08:51 UTC
Problem is that there are only signal() handers for SIGINT, SIGHUP, SIGTERM

There are no handlers for SIGABRT (raised by failed assert()) or SIGSEGV/SIGBUS, SIGILL, SIGFPE, so assertions and hard crashes due to segmentation faults, bus errors, illegal instructions floating point errors terminate the maxscale process without putting anything into the logs ...

Comment 2 Hartmut Holzgraefe 2014-08-15 12:08:36 UTC
Ignore the previous comment on signal handlers, they are an issue as they prevent reason for termniantion being loged, but that is a different story ...

What's needed here is a redefinition of assert() that uses the log_manager instead of simply printing to stderr indeed ...

Also assert()s brute force termination of the whole process by calling abort() may not necessarily be the right way here, calling shutdown_server() may be better in most assertion failure situations?

(the ndbcluster storage engine e.g. has a ndb_require() call that is used throughout the code instead of assert() ...)

Comment 3 Mark Riddoch 2014-09-12 09:34:09 UTC
Please check this is only an issue with debug builds

Comment by markus makela [ 2015-05-02 ]

Added assert information to log manager. Debug asserts now also flush all logs to disk before doing the assertion.

Comment by Timofey Turenko [ 2015-05-12 ]

verified by manual checking. It is hard to implement automatic test for it and it is not really needed for minor logging issue.

Generated at Thu Feb 08 03:56:14 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.