www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/08/07/14:35:16

Xref: news2.mv.net comp.os.linux.development.apps:20468 comp.os.msdos.djgpp:6870
Newsgroups: comp.os.msdos.djgpp,comp.os.linux.development.apps
From: dolittle AT weniac DOT math DOT toronto DOT edu (Ed Doolittle)
Subject: Re: Librgx and g++ apps segfault under Linux
Message-ID: <slrn50dh77.g29.dolittle@weniac.math.toronto.edu>
Sender: news AT utcc DOT utoronto DOT ca (News)
Reply-To: dolittle AT math DOT toronto DOT edu
Organization: UTCC Campus Access
References: <DvKL7y DOT D4s AT weniac DOT math DOT toronto DOT edu> <4u4qbm$8rn AT news DOT rwth-aachen DOT de>
Date: Tue, 6 Aug 1996 04:03:05 GMT
Lines: 41
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On 5 Aug 1996 12:44:38 GMT, Hans-Bernhard Broeker 
<broeker AT I_should_put_my_domain_in_etc_NNTP_INEWS_DOMAIN> wrote:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

> Ed Doolittle (dolittle AT weniac DOT math DOT toronto DOT edu) wrote: 

>> Furthermore, the example program cliptest from the Grx package
>> compiled with gcc works fine, but when compiled with g++ it
>> segfaults on exit, which leads me to believe that there is a problem
>> in the interaction between libgrx and g++.

> Could well be that bad, but well known bug of g++ (and only g++, not
> gcc) not correctly handling packed structures. To get closer to it,
> could you (Ed Doolittle, that is) please debug the programs at least
> to that extent that you find out what kind of instructions are
> actually crashing? 

I'm having some trouble running gdb on the graphics programs -- when I
single step through the program, some of the arguments become garbage
(e.g. GrSetMode(9,800,600,256) becomes GrSetMode(0,-10327363,...).
Perhaps it can't handle switching between graphics and text mode. I've
tried redirecting output to another console without any luck. I hope I
can eventually find a way to do it.

However, if I just let the program run under gdb, the segfaults always
occur in __libc_free. The Linux libc 5.3.12 free() is quite demanding;
many programs broke because they would malloc, modify the pointer
returned, and free the modified pointer, which was acceptable under libc
5.2 and earlier. Perhaps that is the problem.

I've been trying to track down all the free()s in libgrx to see if any
of them free modified pointers, but it's quite time consuming work.
Hopefully I'll have more information in a few days. In the meantime,
other suggestions are most welcome.

Ed

--
Ed Doolittle <dolittle AT math DOT toronto DOT edu>
 "Being on time is like being on fire."

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019