Re: sqrt FPE's and fclose errors

s-sumi@trc.rwcp.or.jp
Fri, 20 Mar 1998 00:53:53 +0900


Hi.

>>>>> "Tom" == Tom Browder <tbrowde@asi-fwb.com> writes:
Tom> On a DEC alpha with RH 5.0, I get a segv
Tom> using fclose.

Tom> This is the simplest prog which causes the segv:

Tom> #include <stdio.h>
Tom> main()
Tom> {
Tom> FILE *fp;

Tom> fp = fopen("t", "w");
Tom> fclose(fp);
Tom> }

Tom> If I compile it with
Tom> gcc prob.c
Tom> it works; but if I use
Tom> g++ prob.cc
Tom> it bombs!
Tom> Suggestions?

Miss-matching _IO_dump_t structure between libc.a and libstd++.a
causes this problem.

It seems that configuration program of libg++/libio does not work well.
Fix this problem, and re-compilation of libg++ is needed.

In libg++-2.7.2/libio directory, the entry of _IO_dump_t structure
defined in libioP.h.
=========================
*** libg++ ***
_G_USING_THUNKS is not defined.

#define JUMP_FIELD(TYPE, NAME) struct { short delta1, delta2; TYPE pfn; } NAME

struct _IO_jump_t {
JUMP_FIELD(_G_size_t, __dummy);
#ifdef _G_USING_THUNKS
JUMP_FIELD(_G_size_t, __dummy2);
#endif
JUMP_FIELD(_IO_finish_t, __finish);
.....
JUMP_FIELD(_IO_close_t, __close);
JUMP_FIELD(_IO_stat_t, __stat);
=========================

In glibc-2.0.6/libio/ directory, the entry of _IO_dump_t structure
defined in libioP.h.
=========================
*** libc ***
_G_USING_THUNKS is defined.

#define JUMP_FIELD(TYPE, NAME) TYPE NAME

struct _IO_jump_t {
JUMP_FIELD(_G_size_t, __dummy);
#ifdef _G_USING_THUNKS
JUMP_FIELD(_G_size_t, __dummy2);
#endif
JUMP_FIELD(_IO_finish_t, __finish);
.....
JUMP_FIELD(_IO_close_t, __close);
JUMP_FIELD(_IO_stat_t, __stat);
===================================
-----
Shinji Sumimoto E-Mail: s-sumi@trc.rwcp.or.jp
Real World Computing Partnership