Pacman

Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues

This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
Tasklist

FS#10056 - Writing different logfiles

Attached to Project: Pacman
Opened by Georg Grabler (STiAT) - Tuesday, 01 April 2008, 22:16 GMT
Last edited by Dan McGee (toofishes) - Wednesday, 02 April 2008, 01:40 GMT
Task Type Bug Report
Category Backend/Core
Status Closed
Assigned To Dan McGee (toofishes)
Architecture i686
Severity Medium
Priority Normal
Reported Version 3.1.3
Due in Version 3.1.4
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Summary and Info:
When writing different logfiles, using alpm_logaction, setting a new logfile, alpm crashes.

Steps to Reproduce:
Compiled the attaced test program with
gcc test.c -o test -lalpm
using lalpm 3.1.3

Errors:
produces the error (attached test.log)
According backtrace using (see attached file gdb.log)

Symptom:
-> The first log message is written normally
-> The 2nd isn't written at all (strange)
-> On the 3rd call it crashes when calling alpm_option_set_logfile

Addition:
I don't exactly know how gcc handles this, but as i know free() must not automatically set the pointer to NULL. This would make the check for handle->logfile quite unnecessary, unless it's set to NULL in this function, because except re-initializing alpm there is no possibility to do so.

Just in between: I don't know how GCC handles this, but I know that it's not common that free() sets a pointer to NULL, which would mean the alpm_option_set_logfile needs a handle->logfile = NULL after the free(handle->logfile).
   test.c (0.3 KiB)
   test.log (2.4 KiB)
   gdb.log (0.4 KiB)
This task depends upon

Closed by  Dan McGee (toofishes)
Wednesday, 02 April 2008, 01:40 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in commit ab9187d07de03e6545881a72180e76e728317bb9
Comment by Georg Grabler (STiAT) - Tuesday, 01 April 2008, 22:21 GMT
ups, last line double :-) ... but to make sure you know what I mean <sigh>, reports 5 min before bed time :-(.
Comment by Dan McGee (toofishes) - Tuesday, 01 April 2008, 22:48 GMT
This will get fixed in 3.1.4, its a simple oversight with a simple fix.

Loading...