Opened 14 years ago

Closed 14 years ago

#22770 closed defect (fixed)

apr 1.3.9 causes svn to crash due to incorrect APR_OFF_T_FMT

Reported by: francis@… Owned by: danielluke (Daniel J. Luke)
Priority: Normal Milestone:
Component: ports Version: 1.8.1
Keywords: Cc:
Port: apr

Description

apr 1.3.9 defines APR_OFF_T_FMT in apr.h as "lld" when the universal variant is not selected. This causes svn 1.6.5 to crash (see attached reproduce.sh).

The attached patch causes APR_OFF_T_FMT to be defined as "ld", which fixes the Subversion crash.

Attachments (3)

apr.diff (1.8 KB) - added by francis@… 14 years ago.
fix
reproduce.sh (345 bytes) - added by francis@… 14 years ago.
svn_2009-12-02-153406_jupiter.crash (11.6 KB) - added by francis@… 14 years ago.

Download all attachments as: .zip

Change History (10)

Changed 14 years ago by francis@…

Attachment: apr.diff added

fix

Changed 14 years ago by francis@…

Attachment: reproduce.sh added

Changed 14 years ago by francis@…

comment:1 Changed 14 years ago by francis@…

Note that this only applies to Snow Leopard - works fine on Leopard.

Also, note that subversion needs to be recompiled after patching and reinstalling apr for the fix to take effect.

comment:2 Changed 14 years ago by jmroot (Joshua Root)

Owner: changed from macports-tickets@… to dluke@…
Port: apr added; devel/apr removed

comment:3 Changed 14 years ago by danielluke (Daniel J. Luke)

Status: newassigned

comment:4 Changed 14 years ago by tobypeterson

This doesn't make sense. apr_off_t is just an off_t, %lld is the correct specifier.

comment:5 Changed 14 years ago by tobypeterson

Easy to test:

#include <stdio.h>
int main() {
	off_t x = 1;
	printf("%ld %lld\n", x, x);
	return 0;
}

comment:6 Changed 14 years ago by tobypeterson

test.c: In function ‘main’:
test.c:8: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘off_t’
test.c: In function ‘main’:
test.c:8: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘off_t’

comment:7 Changed 14 years ago by danielluke (Daniel J. Luke)

Resolution: fixed
Status: assignedclosed

This should now be resolved (r62330) see also #22032 and associated upstream bug.

Note: See TracTickets for help on using tickets.