View Full Version : AIX 5.1 sendbackup regex "found a bug" error

February 2nd, 2007, 12:08 PM
Hi all,

Working with amanda 2.51p2 on a AIX 5.1 (I know, its old) machine, we get the following error message in the sendbackup.debug output:

# tail sendbackup.20070202040402.debug
sendbackup-gnutar: time 0.034: doing level 0 dump from date: 1970-01-01 0:00:00 GMT
sendbackup: Can't open exclude file /etc/.amanda.excludes (No such file or directory)
sendbackup: time 0.048: spawning /opt/local/libexec/runtar in pipeline
sendbackup: argument list: runtar FakeBackupSet gtar --create --file - --directory /etc --one-file-system --listed-incremental /var/lib/amanda/gnutar-lists/fakehost_etc_0.new --sparse --ignore-failed-read --totals --exclude-from /tmp/amanda/sendbackup._etc.20070202040402.exclude .
sendbackup: time 0.064: started index creator: "/opt/freeware/bin/tar -tf - 2>/dev/null | sed -e 's/^\.//'"
sendbackup-gnutar: time 0.071: /opt/local/libexec/runtar: pid 1212454
sendbackup: time 0.071: started backup
sendbackup: time 0.164: regex "^ *Total bytes written: [0-9][0-9]*": "can't happen" -- you found a bug
sendbackup: time 0.164: pid 1057010 finish time Fri Feb 2 04:04:02 2007
sendbackup: time 0.359: index created successfully

The "can't happen -- you found a bug" error is the kicker. Traced it down to the regcomp() function in regcomp.c.

Gnu tar version is 1.14
Amanda was compiled with xlc 6
Compile options were:
--prefix=/opt/local --with-user=amandaba --with-group=disk \
--without-server --with-bsdtcp-security --sysconfdir=/etc \
--with-index-server=amandaserver.fake.domain --localstatedir=/var/lib/amanda \
--sharedstatedir=/var/lib/amanda \
--with-gnutar-listdir=/var/lib/amanda/gnutar-lists \
--with-gnutar=/opt/freeware/bin/tar --with-ssh-security --disable-shared

I have found that changing the regex from "^ *Total bytes written: [0-9][0-9]*" to "Total bytes written:" works, but then sendbackup fails on the next regex. Is there anything special I need to do to get the regexs working in AIX? Is xlc 6 horrible and I should be beaten for not having a more recent compiler?



February 2nd, 2007, 02:49 PM
Turns out this was caused by a compile-time fix I had made.

The mask BAD is defined both system wide in /usr/include/sys/param.h and the amanda code in regex2.h. This redefinition along with several constants (INT64_MIN/MAX, UINT8_MAX, UINT16_MAX, UINT64_MAX) would cause the build to fail. Unfortunately, unlike the other definitions (which I checked thoroughly) BAD is not defined to the same value. The 'fix' for the INT constants had been to simply comment them out. However, using the system defined new for BAD would cause the regexes to fail. Uncommenting and globally renaming the flag to avoid name collisions fixed the problem.