Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 539308 - app-admin/logrotate-3.8.8: crashes when rotating logs
Summary: app-admin/logrotate-3.8.8: crashes when rotating logs
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: AMD64 FreeBSD
: Normal critical (vote)
Assignee: Gentoo/BSD Team
URL: https://bugs.freebsd.org/bugzilla/sho...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-08 07:49 UTC by henning.f
Modified: 2015-11-26 12:07 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
backported patch from svn (logrotate-3.8.8-qsort_r.patch,2.04 KB, patch)
2015-02-08 07:54 UTC, henning.f
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description henning.f 2015-02-08 07:49:27 UTC
logrotate seems to use qsort_r which is not standardized and has a different argument order on glibc and freebsd. This causes the program to crash when this code is executed.

logrotate.c: In function ‘sortGlobResult’:
logrotate.c:149:2: warning: passing argument 5 of ‘qsort_r’ from incompatible pointer type [enabled by default]
  qsort_r(result->gl_pathv, result->gl_pathc, sizeof(char *), compGlobResult, &d);
  ^
In file included from logrotate.c:13:0:
/usr/include/stdlib.h:284:7: note: expected ‘int (*)(void *, const void *, const void *)’ but argument is of type ‘struct compData *’
 void  qsort_r(void *, size_t, size_t, void *,
       ^


Reproducible: Always

Steps to Reproduce:
1. Have logs that needs rotating
2. logrotate /etc/logrotate.conf
Actual Results:  
pid 78632 (logrotate), uid 250: exited on signal 11

Expected Results:  
My logs are rotated
Comment 1 henning.f 2015-02-08 07:54:50 UTC
Created attachment 395866 [details, diff]
backported patch from svn

Unlike the patch suggested by the freebsd bugzilla, I propose this change which is a backported version of commit 468 in the logrotate svn.
Comment 2 henning.f 2015-03-15 03:27:58 UTC
This issue has been resolved in app-admin/logrotate-3.8.9
Comment 3 Chema Alonso Josa (RETIRED) gentoo-dev 2015-11-26 12:07:34 UTC
Version no longer in the tree. 

Closing