texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] Re: [E-devel] Segfault with Imlib2


From: Joris van der Hoeven
Subject: Re: [Texmacs-dev] Re: [E-devel] Segfault with Imlib2
Date: Wed, 13 Jul 2005 12:42:20 +0200
User-agent: Mutt/1.5.9i

Hi,

I am continuing trying to use Imlib2 in combination with
a static TeXmacs binary.

I got a bit further when using dynamic linking at run time when
using the -fPIC -rdynamic options (I did not need these in the case
of freetype; I don't know why). When doing this, the software does
no longer crash immediately, but no images show up.

I also tried static linking of the effectively used loader libraries
together with libImlib2 (so everything should be statically linked
in that case, right?). However, I still experience problems with
the memory allocation in this situation. Notice that these problems
occur more or less at random times: sometimes I have to load
50 pictures before an actual crash occurs.

For my static TeXmacs distribution, I really need at least dynamic
linking at run time or static linking at compile time to work.
Do you have any other ideas of what I might try? It is very well
possible that I, or you, or we both just don't use the right
compiler/linker options at a certain point. But I am running
out of ideas...

Best wishes, Joris

-----------------------------------------------------------
> > > #0  0x083c39ed in chunk_free (ar_ptr=0x84f0f68, p=0x8be3000) at 
> > > malloc.c:3231
> > > #1  0x083c6311 in __libc_free (mem=0x8becfd8) at malloc.c:3154
> > > #2  0x0835c233 in __imlib_ConsumeImage (im=0x8bc68c0) at image.c:176
> > > #3  0x0835c505 in __imlib_CleanupImageCache () at image.c:381
> > > #4  0x0835d28a in __imlib_FreeImage (im=0x8bc68c0) at image.c:1172
> > > #5  0x0834824a in imlib_free_image () at api.c:1327
> > > #6  0x08190818 in imlib2_image_size (u={rep = 0x8a58458}, address@hidden,
> > > address@hidden) at ./Plugins/Imlib2/imlib2.cpp:123 #7  0x081901a8 in 
> > > image_size
> > > (image={rep = 0x8a58458}, address@hidden, address@hidden) at
> > > ./System/Files/image_files.cpp:145 #8  0x0813d509 in
> > > image_widget_rep::handle_repaint (this=0x8798678, ev=
> > >         {<event_ptr_base> = {rep = 0x8858688}, <No data fields>}) at
> > >         ./Window/Widget/Misc/file_chooser_widget.cpp:323
> > > ...
> > > 
> > > The routine imlib2_image_size is mine. Here it is:
> > > 
> > > -----------------------------------------------------
> > > void
> > > imlib2_image_size (url u, int& w, int& h) {
> > >   if (imlib2_size_cache->contains (u->t)) {
> > >     w= as_int (imlib2_size_cache[u->t][0]);
> > >     h= as_int (imlib2_size_cache[u->t][1]);
> > >   }
> > >   else {
> > >     Imlib_Image image= imlib2_load_image (u);
> > >     if (image) {
> > >       IMLIB2_context_set_image (image);
> > >       w= IMLIB2_image_get_width ();
> > >       h= IMLIB2_image_get_height ();
> > >       IMLIB2_free_image ();
> > >       imlib2_size_cache (u->t)= tuple (as_string (w), as_string (h));
> > >     }
> > >   }
> > > }
> > > -----------------------------------------------------
> > > 
> > > The routines IMLIB2_x are just copies of the corresponding
> > > routines imlib_x (so as to allow for dynamic linking).
> > > For your knowledge, here is also the routine imlib2_load_image:
> > > 
> > > -----------------------------------------------------
> > > static Imlib_Image
> > > imlib2_load_image (url u) {
> > >   url name= resolve (u);
> > >   if (is_none (name))
> > >     name= resolve ("$TEXMACS_PIXMAP_PATH/TeXmacs-gnu.xpm");
> > >   char *_name= as_charp (as_string (name));
> > >   Imlib_Image image;
> > >   image = IMLIB2_load_image (_name);
> > >   delete[] _name;
> > >   return image;
> > > }
> > > -----------------------------------------------------
> > > 
> > > Am I doing something wrong with the memory management?
> > > 
> > > Thanks, Joris
> 
> 
> _______________________________________________
> Texmacs-dev mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/texmacs-dev




reply via email to

[Prev in Thread] Current Thread [Next in Thread]