netpbm BUG: librle.a, undefined symbol pm_error, patch

News and discussion about development of the Debian OS itself

netpbm BUG: librle.a, undefined symbol pm_error, patch

Postby slackguy » 2015-08-31 16:26

Hi could you please reportbug this someone?

Netpbm has undefined symbols in at least one major lib (since before 2010 i find).

When I link (xli, or gnome-libs, anything) to librle.a I get "pm_error undefined". Using objdump -a -x librle.a i see it isn't and hasn't been since before year 2010.

libnetpbm.{so,a} defines function pm_error(fmt,...) (netpbm-current/lib/) but it never was defined in librle (netpbm/current/urt), defined just as fprintf(stderr,...); !!

# ------------------------------

cd "urt/"

for x in rle_getrow.c rle_putcom.c
do
[ ! -f $x.old ] && {
cp $x $x.old
cat << EOF | ed || true
r $x
%s/pm_error[(]/fprintf(stderr,/
wq $x
EOF
}
done

cd "$pwd/"


# ----------------------------------------------
apply such a recursive directory patch with:
$ patch -p0 << foo.diff

# ----------------------------------------------
diff -Naur netpbm-10.35.77.orig/urt/rle_getrow.c netpbm-10.35.77/urt/rle_getrow.c
--- netpbm-10.35.77.orig/urt/rle_getrow.c 2006-08-18 23:12:28.000000000 -0400
+++ netpbm-10.35.77/urt/rle_getrow.c 2015-08-31 12:12:46.000000000 -0400
@@ -149,7 +149,7 @@
MALLOCARRAY(maptemp, 2 * maplen);
if ( the_hdr->cmap == NULL || maptemp == NULL )
{
- pm_error("Malloc failed for color map of size %d*%d "
+ fprintf(stderr,"Malloc failed for color map of size %d*%d "
"in rle_get_setup, reading '%s'",
the_hdr->ncmap, (1 << the_hdr->cmaplen),
the_hdr->file_name );
@@ -175,7 +175,7 @@

if ( comment_buf == NULL )
{
- pm_error("Malloc failed for comment buffer of size %d "
+ fprintf(stderr,"Malloc failed for comment buffer of size %d "
"in rle_get_setup, reading '%s'",
comlen, the_hdr->file_name );
return RLE_NO_SPACE;
@@ -190,7 +190,7 @@
MALLOCARRAY(the_hdr->comments, i);
if ( the_hdr->comments == NULL )
{
- pm_error("Malloc failed for %d comment pointers "
+ fprintf(stderr,"Malloc failed for %d comment pointers "
"in rle_get_setup, reading '%s'",
i, the_hdr->file_name );
return RLE_NO_SPACE;
diff -Naur netpbm-10.35.77.orig/urt/rle_putcom.c netpbm-10.35.77/urt/rle_putcom.c
--- netpbm-10.35.77.orig/urt/rle_putcom.c 2006-08-18 23:12:28.000000000 -0400
+++ netpbm-10.35.77/urt/rle_putcom.c 2015-08-31 12:12:46.000000000 -0400
@@ -115,7 +115,7 @@
old_comments = the_hdr->comments;
MALLOCARRAY(the_hdr->comments, i);
if (the_hdr->comments == NULL)
- pm_error("Unable to allocate memory for comments");
+ fprintf(stderr,"Unable to allocate memory for comments");
the_hdr->comments[--i] = NULL;
the_hdr->comments[--i] = value;
for (--i; i >= 0; --i)
User avatar
slackguy
 
Posts: 91
Joined: 2014-11-29 03:22

Return to Debian Development

Who is online

Users browsing this forum: No registered users and 1 guest

fashionable