|
From: Bob D. <bd...@si...> - 2006-08-10 21:02:32
|
All, Hopefully this will be the last RLIB release before 2.0. Let me know if you find any bugs. - Fix Crashes (Me, Zoltan) - "do_break" - Output Parameter - Support cursors w/ forward only navigation (Me, Zoltan) - CSV Data Source (Me) - Valid XHTML HTML Output (Me, Al) - RPDF Compression (Zoltan) - OSX Build/Link Fixes http://rlib.sicom.com | http://rlib.sf.net - Bob -- |
|
From: Zoltan B. <zb...@du...> - 2006-09-10 09:07:01
Attachments:
rpdf-read-fix.patch
|
Hi, the stricter compiler and function attributes on Fedora Core 6 Test3 gave me warnings in rpdf, which turn out to be real bugs: ignored value returned by read() and write() can cause incomplete picture file read-in in rpdf/rpdf.c or incomplete PDF writeout rpdf/test.c. Also, a static function rpdf_error() isn't used anywhere, I made it inaccessible to the preprocessor with #if 0 for now. Patch attached, please review. Best regards, Zolt=E1n Bob Doan =EDrta: > All, > > Hopefully this will be the last RLIB release before 2.0. Let me know i= f > you find any bugs. > > - Fix Crashes (Me, Zoltan) > - "do_break" - Output Parameter=20 > - Support cursors w/ forward only navigation (Me, Zoltan) > - CSV Data Source (Me) > - Valid XHTML HTML Output (Me, Al) > - RPDF Compression (Zoltan) > - OSX Build/Link Fixes > > http://rlib.sicom.com | http://rlib.sf.net > > - Bob > =20 |
|
From: Zoltan B. <zb...@du...> - 2006-09-10 11:44:10
|
Hi, I cannot recreate the PDF documentation: $ make ... docbook2pdf -d docbook-utils.dsl book.sgm Using catalogs: /etc/sgml/sgml-docbook-3.1-1.0-30.1.cat Using stylesheet: /home/zozo/rpmbuild/BUILD/rlib-1.3.7/doc/docbook-utils.= dsl Working on: /home/zozo/rpmbuild/BUILD/rlib-1.3.7/doc/book.sgm jade:/home/zozo/rpmbuild/BUILD/rlib-1.3.7/doc/docbook-utils.dsl:17:96:W:=20 cannot generate system identifier for public text "-//Norman=20 Walsh//DOCUMENT DocBook Print Stylesheet//EN" jade:/home/zozo/rpmbuild/BUILD/rlib-1.3.7/doc/docbook-utils.dsl:75:37:E:=20 no style-specification or external-specification with ID "DOCBOOK" jade:/home/zozo/rpmbuild/BUILD/rlib-1.3.7/doc/docbook-utils.dsl:1031:19:E= :=20 reference to undefined variable "$bold-seq$" jade:/home/zozo/rpmbuild/BUILD/rlib-1.3.7/doc/docbook-utils.dsl:1029:17:E= :=20 reference to undefined variable "$charseq$" jade:/home/zozo/rpmbuild/BUILD/rlib-1.3.7/doc/docbook-utils.dsl:1027:17:E= :=20 reference to undefined variable "$mono-seq$" jade:/home/zozo/rpmbuild/BUILD/rlib-1.3.7/doc/docbook-utils.dsl:1025:20:E= :=20 reference to undefined variable "$italic-mono-seq$" jade:/home/zozo/rpmbuild/BUILD/rlib-1.3.7/doc/docbook-utils.dsl:1023:18:E= :=20 reference to undefined variable "$mono-seq$" jade:/home/zozo/rpmbuild/BUILD/rlib-1.3.7/doc/docbook-utils.dsl:1021:17:E= :=20 reference to undefined variable "$bold-seq$" jade:/home/zozo/rpmbuild/BUILD/rlib-1.3.7/doc/docbook-utils.dsl:1019:19:E= :=20 reference to undefined variable "$bold-mono-seq$" jade:/home/zozo/rpmbuild/BUILD/rlib-1.3.7/doc/docbook-utils.dsl:1017:22:E= :=20 reference to undefined variable "$bold-seq$" jade:/home/zozo/rpmbuild/BUILD/rlib-1.3.7/doc/docbook-utils.dsl:1015:18:E= :=20 reference to undefined variable "$bold-seq$" jade:/home/zozo/rpmbuild/BUILD/rlib-1.3.7/doc/docbook-utils.dsl:1013:19:E= :=20 reference to undefined variable "$italic-seq$" jade:/home/zozo/rpmbuild/BUILD/rlib-1.3.7/doc/docbook-utils.dsl:1011:18:E= :=20 reference to undefined variable "$bold-seq$" jade:/home/zozo/rpmbuild/BUILD/rlib-1.3.7/doc/docbook-utils.dsl:1009:20:E= :=20 reference to undefined variable "$bold-seq$" ... I get this even running this manually, so default docbook-utils.dsl is us= ed: $ docbook2pdf book.sgm Using catalogs: /etc/sgml/sgml-docbook-3.1-1.0-30.1.cat Using stylesheet:=20 /usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl#print Working on: /home/zozo/rpmbuild/BUILD/rlib-1.3.7/doc/book.sgm jade:/usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl:9:96:W:=20 cannot generate system identifier for public text "-//Norman=20 Walsh//DOCUMENT DocBook Print Stylesheet//EN" jade:/usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl:39:37:E: no=20 style-specification or external-specification with ID "DOCBOOK" jade:/usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl:496:19:E:=20 reference to undefined variable "$italic-seq$" jade:/usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl:495:17:E:=20 reference to undefined variable "$charseq$" jade:/usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl:494:17:E:=20 reference to undefined variable "$mono-seq$" jade:/usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl:493:20:E:=20 reference to undefined variable "$italic-mono-seq$" jade:/usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl:492:18:E:=20 reference to undefined variable "$mono-seq$" jade:/usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl:491:17:E:=20 reference to undefined variable "$bold-seq$" jade:/usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl:490:19:E:=20 reference to undefined variable "$bold-mono-seq$" jade:/usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl:489:22:E:=20 reference to undefined variable "$bold-seq$" jade:/usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl:488:18:E:=20 reference to undefined variable "$bold-seq$" jade:/usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl:487:19:E:=20 reference to undefined variable "$italic-seq$" jade:/usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl:486:18:E:=20 reference to undefined variable "$bold-seq$" ... Anyone know how to solve it? I found this solution on Google but it didn't help: # xmlcatalog /etc/sgml/catalog "-//Norman Walsh//DOCUMENT DocBook Print=20 Stylesheet//EN" No entry for PUBLIC -//Norman Walsh//DOCUMENT DocBook Print Stylesheet//E= N # /usr/bin/install-catalog --add /etc/sgml/dsssl-stylesheets-1.79.cat=20 /usr/share/sgml/docbook/dsssl-stylesheets-1.79/catalog install-catalog: addition of=20 /usr/share/sgml/docbook/dsssl-stylesheets-1.79/catalog in=20 /etc/sgml/dsssl-stylesheets-1.79.cat install-catalog: addition of /etc/sgml/dsssl-stylesheets-1.79.cat in=20 /etc/sgml/catalog # xmlcatalog /etc/sgml/catalog "-//Norman Walsh//DOCUMENT DocBook Print=20 Stylesheet//EN" /usr/share/sgml/docbook/dsssl-stylesheets-1.79/print/docbook.dsl Zoltan Boszormenyi =EDrta: > Hi, > > the stricter compiler and function attributes > on Fedora Core 6 Test3 gave me warnings > in rpdf, which turn out to be real bugs: > ignored value returned by read() and write() > can cause incomplete picture file read-in in > rpdf/rpdf.c or incomplete PDF writeout > rpdf/test.c. Also, a static function rpdf_error() > isn't used anywhere, I made it inaccessible > to the preprocessor with #if 0 for now. > > Patch attached, please review. > > Best regards, > Zolt=E1n > > Bob Doan =EDrta: >> All, >> >> Hopefully this will be the last RLIB release before 2.0. Let me know = if >> you find any bugs. >> >> - Fix Crashes (Me, Zoltan) >> - "do_break" - Output Parameter - Support cursors w/ forward only=20 >> navigation (Me, Zoltan) >> - CSV Data Source (Me) >> - Valid XHTML HTML Output (Me, Al) >> - RPDF Compression (Zoltan) >> - OSX Build/Link Fixes >> >> http://rlib.sicom.com | http://rlib.sf.net >> >> - Bob >> =20 > > -----------------------------------------------------------------------= - > > diff -ur rlib-1.3.7.orig/rpdf/rpdf.c rlib-1.3.7/rpdf/rpdf.c > --- rlib-1.3.7.orig/rpdf/rpdf.c 2006-08-10 22:53:27.000000000 +0200 > +++ rlib-1.3.7/rpdf/rpdf.c 2006-09-09 23:39:20.000000000 +0200 > @@ -111,6 +111,7 @@ > =20 > #define DEGREE_2_RAD(x) (x*M_PI/180.0) > =20 > +#if 0 > static void rpdf_error(const gchar *fmt, ...) { > va_list vl; > gchar *result =3D NULL; > @@ -124,6 +125,7 @@ > } > return; > } > +#endif > =20 > static GString * obj_printf(GString *obj, const gchar *fmt, ...) { > va_list vl; > @@ -1065,10 +1067,12 @@ > gboolean rpdf_image(struct rpdf *pdf, gdouble x, gdouble y, gdouble wi= dth, gdouble height, gint image_type, gchar *file_name) { > struct rpdf_page_info *page_info =3D pdf->page_info[pdf->current_page= ]; > gint fd; > - gint size; > + off_t size, pos; > gint read_spot =3D 0; > gboolean loop =3D TRUE; > struct rpdf_images *image; > + ssize_t readbytes; > + > if(file_name =3D=3D NULL) > return FALSE; > =09 > @@ -1088,8 +1092,19 @@ > image->data =3D g_malloc(size); > image->image_type =3D image_type; > image->length =3D size; > -=09 > - read(fd, image->data, size); > + pos =3D 0; > + while (size > 0) { > + readbytes =3D read(fd, image->data + pos, size); > + if (readbytes > 0) { > + pos +=3D readbytes; > + size -=3D readbytes; > + } else { > + g_free(image->data); > + g_free(image); > + close(fd); > + return FALSE; > + } > + } > close(fd); > =20 > if(image_type =3D=3D RPDF_IMAGE_PNG) { > diff -ur rlib-1.3.7.orig/rpdf/test.c rlib-1.3.7/rpdf/test.c > --- rlib-1.3.7.orig/rpdf/test.c 2006-05-23 19:18:37.000000000 +0200 > +++ rlib-1.3.7/rpdf/test.c 2006-09-09 23:43:06.000000000 +0200 > @@ -33,6 +33,9 @@ > } > =20 > int main(int argc, char **argv) { > + ssize_t byteswritten; > + size_t count, pos; > + > struct rpdf *pdf =3D rpdf_new(); > rpdf_new_page(pdf, RPDF_PAPER_LEGAL, RPDF_LANDSCAPE); > /* rpdf_set_font(pdf, "Times-Italic", "MacRomanEncoding", 30.0); */ > @@ -78,7 +81,14 @@ > =09 > /* rpdf_image(pdf, 1, 1, 100, 100, RPDF_IMAGE_JPEG, "logo.jpg"); */ > rpdf_finalize(pdf); > - write(1, pdf->out_buffer, pdf->size); > + pos =3D 0; > + while (pos < pdf->size) { > + byteswritten =3D write(1, pdf->out_buffer + pos, pdf->size - pos); > + if (byteswritten > 0) > + pos +=3D byteswritten; > + else > + break; /* ignore the error */ > + } > rpdf_free(pdf);=09 > return 0; > } > =20 > -----------------------------------------------------------------------= - > > -----------------------------------------------------------------------= -- > Using Tomcat but need to do more? Need to support web services, securit= y? > Get stuff done quickly with pre-integrated technology to make your job = easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geron= imo > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > -----------------------------------------------------------------------= - > > _______________________________________________ > Rlib-devel mailing list > Rli...@li... > https://lists.sourceforge.net/lists/listinfo/rlib-devel > =20 |
|
From: Bob D. <bd...@si...> - 2006-09-13 19:40:01
Attachments:
rlib.patch
|
Hey, Actually you can't subtract size in that routine like that because it will cause stuff below to fail and no images will make it to the report. Attached is my version of it (committed) Thanks! - Bob On Sun, 2006-09-10 at 11:06 +0200, Zoltan Boszormenyi wrote: > Hi, >=20 > the stricter compiler and function attributes > on Fedora Core 6 Test3 gave me warnings > in rpdf, which turn out to be real bugs: > ignored value returned by read() and write() > can cause incomplete picture file read-in in > rpdf/rpdf.c or incomplete PDF writeout > rpdf/test.c. Also, a static function rpdf_error() > isn't used anywhere, I made it inaccessible > to the preprocessor with #if 0 for now. >=20 > Patch attached, please review. >=20 > Best regards, > Zolt=C3=A1n >=20 > Bob Doan =C3=ADrta: > > All, > > > > Hopefully this will be the last RLIB release before 2.0. Let me know= if > > you find any bugs. > > > > - Fix Crashes (Me, Zoltan) > > - "do_break" - Output Parameter=20 > > - Support cursors w/ forward only navigation (Me, Zoltan) > > - CSV Data Source (Me) > > - Valid XHTML HTML Output (Me, Al) > > - RPDF Compression (Zoltan) > > - OSX Build/Link Fixes > > > > http://rlib.sicom.com | http://rlib.sf.net > > > > - Bob > > =20 >=20 --=20 |
|
From: William K. V. <wk...@us...> - 2006-09-13 20:50:19
|
Hi, Sorry, I should have said something earlier. The system calls of "read" or "write" returning zero is not an error (they return "-1", which necessitated the ssize_t type), so the comparisons should have been ">= 0". In practice it rarely happens unless you are doing network programming, during network congestion you will frequently get a "0" return. I didn't supply a patch however if you'd like I can. HTH, William. On Wed, 2006-09-13 at 13:39, Bob Doan wrote: > Actually you can't subtract size in that routine like that because it > will cause stuff below to fail and no images will make it to the report. > > Attached is my version of it (committed) > On Sun, 2006-09-10 at 11:06 +0200, Zoltan Boszormenyi wrote: > > the stricter compiler and function attributes > > on Fedora Core 6 Test3 gave me warnings > > in rpdf, which turn out to be real bugs: > > ignored value returned by read() and write() > > can cause incomplete picture file read-in in > > rpdf/rpdf.c or incomplete PDF writeout > > rpdf/test.c. Also, a static function rpdf_error() > > isn't used anywhere, I made it inaccessible > > to the preprocessor with #if 0 for now. > > |
|
From: Zoltan B. <zb...@du...> - 2006-09-13 21:51:35
|
Hi, the code in rpdf specifically opens a disk file, and read() returning 0 usually means end of file. And rpdf doesn't use O_NONBLOCK on the file it opens, so this case might be an error, e.g. someone truncated the file while you were reading it. It's best to stop reading and treat it as an error. Best regards, Zolt=E1n William K. Volkman =EDrta: > Hi, > Sorry, I should have said something earlier. The > system calls of "read" or "write" returning zero is not an > error (they return "-1", which necessitated the ssize_t type), > so the comparisons should have been ">=3D 0". In practice > it rarely happens unless you are doing network programming, > during network congestion you will frequently get a "0" > return. I didn't supply a patch however if you'd like I > can. > > HTH, > William. > > On Wed, 2006-09-13 at 13:39, Bob Doan wrote: > =20 >> Actually you can't subtract size in that routine like that because it >> will cause stuff below to fail and no images will make it to the repor= t. >> >> Attached is my version of it (committed) >> On Sun, 2006-09-10 at 11:06 +0200, Zoltan Boszormenyi wrote: >> =20 >>> the stricter compiler and function attributes >>> on Fedora Core 6 Test3 gave me warnings >>> in rpdf, which turn out to be real bugs: >>> ignored value returned by read() and write() >>> can cause incomplete picture file read-in in >>> rpdf/rpdf.c or incomplete PDF writeout >>> rpdf/test.c. Also, a static function rpdf_error() >>> isn't used anywhere, I made it inaccessible >>> to the preprocessor with #if 0 for now. >>> >>> =20 > > > > -----------------------------------------------------------------------= -- > Using Tomcat but need to do more? Need to support web services, securit= y? > Get stuff done quickly with pre-integrated technology to make your job = easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geron= imo > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > _______________________________________________ > Rlib-devel mailing list > Rli...@li... > https://lists.sourceforge.net/lists/listinfo/rlib-devel > > =20 |
|
From: William K. V. <wk...@us...> - 2006-09-13 22:03:36
|
Hi Zoltan, On Wed, 2006-09-13 at 15:51, Zoltan Boszormenyi wrote: > the code in rpdf specifically opens a disk file, > and read() returning 0 usually means > end of file. And rpdf doesn't use O_NONBLOCK > on the file it opens, so this case might be an error, > e.g. someone truncated the file while you were > reading it. It's best to stop reading and treat it > as an error. Ahh...your right. I've been programming mostly with O_NONBLOCK lately so run into read returning zero all the time, and having to check EOF explicitly. Sorry for the noise. Cheers, William. >=20 > Best regards, > Zolt=C3=A1n >=20 > William K. Volkman =C3=ADrta: > > Hi, > > Sorry, I should have said something earlier. The > > system calls of "read" or "write" returning zero is not an > > error (they return "-1", which necessitated the ssize_t type), > > so the comparisons should have been ">=3D 0". In practice > > it rarely happens unless you are doing network programming, > > during network congestion you will frequently get a "0" > > return. I didn't supply a patch however if you'd like I > > can. > > > > HTH, > > William. > > > > On Wed, 2006-09-13 at 13:39, Bob Doan wrote: > > =20 > >> Actually you can't subtract size in that routine like that because i= t > >> will cause stuff below to fail and no images will make it to the rep= ort. > >> > >> Attached is my version of it (committed) > >> On Sun, 2006-09-10 at 11:06 +0200, Zoltan Boszormenyi wrote: > >> =20 > >>> the stricter compiler and function attributes > >>> on Fedora Core 6 Test3 gave me warnings > >>> in rpdf, which turn out to be real bugs: > >>> ignored value returned by read() and write() > >>> can cause incomplete picture file read-in in > >>> rpdf/rpdf.c or incomplete PDF writeout > >>> rpdf/test.c. Also, a static function rpdf_error() > >>> isn't used anywhere, I made it inaccessible > >>> to the preprocessor with #if 0 for now. > >>> > >>> =20 > > > > > > > > ---------------------------------------------------------------------= ---- > > Using Tomcat but need to do more? Need to support web services, secur= ity? > > Get stuff done quickly with pre-integrated technology to make your jo= b easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache Ger= onimo > > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&d= at=3D121642 > > _______________________________________________ > > Rlib-devel mailing list > > Rli...@li... > > https://lists.sourceforge.net/lists/listinfo/rlib-devel > > > > =20 |