From: <bac...@li...> - 2005-11-25 21:20:20
|
A BUGNOTE has been added to this bug. ====================================================================== http://bugs.bacula.org/bug_view_advanced_page.php?bug_id=0000497 ====================================================================== Reported By: bonkerzbanks Assigned To: ====================================================================== Project: bacula Bug ID: 497 Category: Storage Daemon Reproducibility: always Severity: crash Priority: normal Status: new ====================================================================== Date Submitted: 11-25-2005 12:53 PST Last Modified: 11-25-2005 13:20 PST ====================================================================== Summary: Storage daemon crash when asked to begin backup (filestoreage) Description: Storage daemon segfaults if compiled with optimisations (-O2) compiled with GCC 4.0.1. Possible cause: (stack trace + debug) Around line 469 of stored/reserve.c a for loop is setup with foreach_alist macro. (btw, the "#ifdef the_easy_way" version of this macro doesnt compile on default GCC 4 either. Any special flags to use to allow this?) After this call, the pointer device_name (which points to a valid device name string) is assigned to rctx.device_name. Then the rctx structure is passed to search_res_for_device() but somewhere the rctx.device_name pointer mysteriously looses its value and becomes 0x20. Without optimisations turned on, the code executes as intended. ====================================================================== ---------------------------------------------------------------------- bonkerzbanks - 11-25-2005 13:20 PST ---------------------------------------------------------------------- Additional info: Replacing that foreach__ macro mentioned above with a hand-written version as below allows the program to run with optimisations... for(rctx.device_name=(char*)store->device->first(); rctx.device_name; rctx.device_name(char*)store->device->next()) { Thinking as I typed that... wouldnt a macro be nice here! :P Bug History Date Modified Username Field Change ====================================================================== 11-25-05 12:53 bonkerzbanks New Bug 11-25-05 13:20 bonkerzbanks Bugnote Added: 0001345 ====================================================================== |