> (I tried to post this to some address @ggi-project.org about
> a month ago, but there is still no route to mail.ggi-project.org)

Grr - sorry about that. I'll probably go and get a domain for it myself or
something, if that unfortunate situation persists.

I've forwarded your mail to the LibGGI mailing list for the svgalib
maintainer to fix the bugs.

> I've found some bugs in svgalib target (in libggi 2.0b4 - still present
> in 2.0.1):
> The first is in GGI_svga_setmode (mode.c, line 228): vis->mode->frames
> is used before it's initialized (i.e. tm is copied into vis->mode) - so
> tm->frames should be used here.
> 
> The second is in GGI_svga_checkmode (mode.c, line 369): there should be
> ||, not && in condition.
> 
> Third problem is harder to fix (I think): any program used with libggi
> and svgalib target segfaults on exit (at least with svgalib 1.9.9).
> I think it's because svgalib (1.9.9) sets atexit() on initializing
> (which is done in vga_setmode() or vga_safety_fork()), and libvga.so.1
> is unloaded on ggiClose or ggiExit.
> Possible solution is to add condition in _ggiRemoveDL that doesn't allow
> to unload libvga.so.1 (possibly with svgalib.so) if it was initialized.
> Alternative solution is to unload modules in some function set as
> atexit() before initializing svgalib.

Just an idea: We might be able to catch atexit() calls by making public our
own atexit function ... preferrably present only when the SVGAlib target
is loaded. This would allow to set a global flag like "ignore_atexit_calls"
while the svgalib init routine is running ...

> Attached patch fixes first and second bug.
> 
> 
> -- 
> Jakub Bogusz    http://prioris.mini.pw.edu.pl/~qboosh/
> PLD Team        http://www.pld.org.pl/

> diff -Nru libggi.orig/display/svgalib/mode.c libggi/display/svgalib/mode.c
> --- libggi.orig/display/svgalib/mode.c        Sat Aug 11 09:01:50 2001
> +++ libggi/display/svgalib/mode.c     Mon Aug 13 15:14:58 2001
> @@ -225,7 +225,7 @@
>       priv->frame_size = tm->virt.x * tm->virt.y * modeinfo->bytesperpixel;
>       GGIDPRINT("Setting up DirectBuffers, islinear=%d, frame_size=%d, frames=%d\n",
>                 priv->islinear, priv->frame_size, LIBGGI_MODE(vis)->frames);
> -     for (i=0; priv->islinear && (i < LIBGGI_MODE(vis)->frames); i++) {
> +     for (i=0; priv->islinear && (i < tm->frames); i++) {
>               ggi_directbuffer *buf;
>  
>               _ggi_db_add_buffer(LIBGGI_APPLIST(vis), _ggi_db_get_new());
> @@ -366,7 +366,7 @@
>       /* Only support frames when we can support linear access 
>        * and we have enough video memory. */
>       if (!(vmi->flags & CAPABLE_LINEAR)
> -                     && (vmi->memory < (vmi->bytesperpixel * tm->virt.x * 
> +                     || (vmi->memory < (vmi->bytesperpixel * tm->virt.x * 
>                                          tm->virt.y * tm->frames)))
>       {
>               tm->frames = 1;


-- 
= Andreas Beck                    |  Email :  <[EMAIL PROTECTED]>             =

Reply via email to