Re: [Botan-devel] compiling botan on cygwin linking with windows libraries instead cygwin
Brought to you by:
randombit
|
From: Jack L. <ll...@ra...> - 2004-05-20 23:39:52
|
On Thu, May 20, 2004 at 04:23:57PM -0700, Anthony Carathimas wrote:
> I don't want my program to have the dependence on cygwin so I tried compiling
> using these configurations:
>
> ./configure.pl gcc-cygwin-i586 --noauto --modules=tm_hard
> ./configure.pl gcc-cygwin-i586 --noauto --modules=es_capi,es_win32,tm_hard
> ./configure.pl gcc-cygwin-i586 --noauto --modules=es_capi,tm_hard
>
>
> Botan compiles but my program seg faults. Here is log of running my test
> program in gdb:
>
>
> (gdb) run
> Starting program: /home/Administrator/test.exe
>
>
> ************* Begin testing *************
>
> CryptoLib object count (should be 0): 0
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x005670a2 in std::locale::operator=(std::locale const&) ()
> (gdb) where
> #0 0x005670a2 in std::locale::operator=(std::locale const&) ()
> #1 0x00563c8d in std::ios_base::_M_init() ()
> #2 0x005e0ea9 in std::basic_ios<char, std::char_traits<char>
> >::init(std::basic
> _streambuf<char, std::char_traits<char> >*) ()
> #3 0x004a4fff in Botan::File_EntropySource::slow_poll(unsigned char*,
> unsigned)
> ()
> (gdb) quit
> The program is running. Exit anyway? (y or n) y
>
>
> Any suggestions?
Yow. Give me the versions of gcc, libstdc++, and the Cygwin libs you're using,
I'll see if I can reproduce. You might want to check and see if you're running
the latest Cygwin junk, that's all I've tested on. I've got to say, this looks
an awful lot like a Cygwin or libstdc++ bug. Does the following progrm work on
your system?
--------------- CUT HERE ------------------
#include <fstream>
#include <cstdio>
typedef unsigned int u32bit;
typedef unsigned char byte;
int main()
{
byte output[1024];
u32bit length = sizeof(output);
std::ifstream random_source("/dev/urandom");
random_source.read((char*)output, length);
u32bit read1 = random_source.gcount();
u32bit read2 = random_source.gcount();
std::printf("%d %d\n", read1, read2);
}
--------------- CUT HERE ------------------
I am suspicious about this is either a plain and simple libstdc++ bug (Botan
doesn't touch anything even remotely near the locale code), or a weird
interaction between iostreams and Cygwin's handling of /dev/ psuedo-devices (on
Cygwin there are no block/character devices, the names are interpolated somehow
inside the Cygwin libs). OTOH, if the above works, it's possible I've borked
something up somehow.
>
> It would also be nice if I could use
>
I think your mail got truncated here...
Jack
|