monotone

Issue 182: monotone-1.0 fails to build with botan-1.10.x

Reported by Peter Volkov, Sep 6, 2011

This issue was reported here:
https://bugs.gentoo.org/show_bug.cgi?id=380257

monotone-1.0 fails to build with botan-1.10 with the following 
error:

x86_64-pc-linux-gnu-g++  -I.    -I/usr/include/botan-1.10            
-pipe -O2
-march=athlon64-sse3 -ftree-vectorize -Wall -W -Wno-unused -c -o
src/transforms.o src/transforms.cc
src/transforms.cc: In function ‘std::string xform(const string&, 
origin::type)
[with XFM = Botan::Gzip_Compression, std::string = 
std::basic_string<char>]’:
src/transforms.cc:198:1: error: cannot allocate an object of 
abstract type
‘Botan::Gzip_Compression’
src/gzip.hh:36:7: note:   because the following virtual functions 
are pure
within ‘Botan::Gzip_Compression’:
/usr/include/botan-1.10/botan/filter.h:32:20: note:     virtual void
Botan::Filter::write(const byte*, size_t)
src/transforms.cc:198:1: error: cannot allocate an object of 
abstract type
‘Botan::Gzip_Compression’
src/gzip.hh:36:7: note:   since type ‘Botan::Gzip_Compression’ has 
pure virtual
functions
src/transforms.cc: In function ‘std::string xform(const string&, 
origin::type)
[with XFM = Botan::Gzip_Decompression, std::string = 
std::basic_string<char>]’:
src/transforms.cc:199:1: error: cannot allocate an object of 
abstract type
‘Botan::Gzip_Decompression’
src/gzip.hh:60:7: note:   because the following virtual functions 
are pure
within ‘Botan::Gzip_Decompression’:
/usr/include/botan-1.10/botan/filter.h:32:20: note:     virtual void
Botan::Filter::write(const byte*, size_t)
src/transforms.cc:199:1: error: cannot allocate an object of 
abstract type
‘Botan::Gzip_Decompression’
src/gzip.hh:60:7: note:   since type ‘Botan::Gzip_Decompression’ has 
pure
virtual functions
src/transforms.cc: In function ‘void pack(const T&, 
base64<gzip<INNER> >&)’:
src/transforms.cc:214:46: error: cannot allocate an object of 
abstract type
‘Botan::Gzip_Compression’
src/gzip.hh:36:7: note:   since type ‘Botan::Gzip_Compression’ has 
pure virtual
functions
src/transforms.cc:224:31: error: cannot allocate an object of 
abstract type
‘Botan::Gzip_Compression’
src/gzip.hh:36:7: note:   since type ‘Botan::Gzip_Compression’ has 
pure virtual
functions
src/transforms.cc: In function ‘void unpack(const 
base64<gzip<INNER> >&, T&)’:
src/transforms.cc:234:46: error: cannot allocate an object of 
abstract type
‘Botan::Gzip_Decompression’
src/gzip.hh:60:7: note:   since type ‘Botan::Gzip_Decompression’ has 
pure
virtual functions
src/transforms.cc:243:31: error: cannot allocate an object of 
abstract type
‘Botan::Gzip_Decompression’
src/gzip.hh:60:7: note:   since type ‘Botan::Gzip_Decompression’ has 
pure
virtual functions

Comment 1 by Martin von Gagern, Sep 7, 2011

I wrote a fix that should address this. Will attach it, both as a 
diff and as a monotone packet which "mtn read" should be 
able to integrate into your database. The revision is 
754a7a4e12aafce0cf45ab00329f0b6513502066.

Comment 2 by Martin von Gagern, Sep 7, 2011

Just found the review feature and started code review 1 for this 
patch:
https://code.monotone.ca/p/monotone/review/1/
Am I really the first to do this? Or does the target of this link 
depend on the logged in user?

Comment 3 by Martin von Gagern, Sep 7, 2011

Not a complete solution. For one, the runtime botan version check 
has to be adjusted as well. The attached patch does that.

But with the patched mtn installed on my system, I can no longer 
commit. If I try to, it prints the following error:

mtn: misuse: malformed packet: invalid private key data for 
'Martin.vGagern@gmx.net': Decoding error: PKCS #8 private key 
decoding failed

Due to this inability to commit, I cannot send you a new packet 
including the new delta and revision.

Comment 4 by Martin von Gagern, Sep 8, 2011

OK, now I've got it to a point where I can again commit and send you 
the packets. Monotone in several places depends on exceptions even 
for normal behaviour, and botan's exception behaviour changed 
somewhat.

The following tests from "make check" still fail:

unit tests:
 - packet_roundabout (unit test)
func tests:
 - changing_passphrase_of_a_private_key
 - disallowing_persistence_of_passphrase
 - netsync_bind_opt
 - schema_migration_error_recovery
 - ssh_agent
extra tests:
 - bash_completion
 - passphrase-from-file

Comment 5 by Peter Volkov, Sep 11, 2011

bash_completion test failure was already fixed. Other tests fail 
here as well.

Comment 6 by Richard Levitte, Sep 12, 2011

(A small point: when writing a packet, make sure to put the public 
key first...)

Comment 7 by Richard Levitte, Sep 12, 2011

I've read the packet and pushed to the main repo.  Since it sits 
nicely in its own branch, I see nothing wrong with doing so.  I'll 
first verify that it doesn't break with botan 1.8.x (since that's 
still the default in my platform), and will move on to checking with 
botan 1.10 after that.

Comment 8 by Martin von Gagern, Sep 12, 2011

Will put pubkey first in the future. It would be nice if 
http://www.monotone.ca/docs/Using-packets.html were to contain that 
piece of advice as well. It would be even nicer if monotone had a 
single command to bundle up everything required to reproduce current 
head (or named revision) in a given remote repo... Is there such a 
thing?

Otherwise, thanks for taking care of this!

Comment 9 by Richard Levitte, Sep 12, 2011

'make check' with libbotan 1.8.2 (debian packages libbotan1.8-dev 
and libbotan-1.8.2, both at version 1.8.12-1) went through with no 
trouble at all.
Status: Started

Comment 10 by Richard Levitte, Sep 12, 2011

Regarding the lack of information in the manual, please write 
another issue about it, to lessen the risk of it being forgotten.

Comment 11 by Richard Levitte, Mar 3, 2012

I can't believe how long I've let this simmer...  starting on it 
again.  Be back about it later.

Comment 12 by Richard Levitte, Mar 3, 2012

Hmmm, there are a few things that fail...  not sure if they are part 
of this change or something else lacking:

./run_func_tests
 56 packet_roundabout                             FAIL (line 1) 
0:00, 0:00 on CPU
135 changing_passphrase_of_a_private_key          FAIL (line 10) 
0:01, 0:00 on CPU
220 disallowing_persistence_of_passphrase         FAIL (line 10) 
0:01, 0:00 on CPU
506 schema_migration_error_recovery               FAIL (line 17) 
0:00, 0:00 on CPU
528 ssh_agent                                     FAIL (line 333) 
0:12, 0:03 on CPU

./run_extra_tests
  3 buildbot                                      FAIL (line 7) 
0:03, 0:00 on CPU
 10 passphrase-from-file                          FAIL (line 24) 
0:01, 0:00 on CPU

No time to check further for now, will do it in the week that comes.

Comment 13 by J Doe, Apr 20, 2012

I am getting the exact same make error when trying to compile 
monotone.

OS: Slackware64
Monotone: 1.0
Botan: 1.10

Comment 14 by Markus Wanner, Apr 23, 2012

Thanks to Martin for preparing this. I've completed that work and 
committed it to the main branch. I think monotone should now compile 
and work with all versions 1.10.x of Botan (and most of 1.9.y), 
again.
Status: Fixed

Comment 15 by Jeremy Reed, Jan 7, 2013

Can you point to the commit(s)?  I see this issue is closed, but I 
don't see any releases since this was handled in April.  I hit the 
problem today:

src/transforms.cc: In function 'std::string xform(const 
std::string&, origin::type) [with XFM = Botan::Gzip_Compression, 
std::string = std::basic_string<char>]':
src/transforms.cc:198:1: error: cannot allocate an object of 
abstract type 'Botan::Gzip_Compression'
src/gzip.hh:37:4: note:   because the following virtual functions 
are pure within 'Botan::Gzip_Compression':
/usr/pkgsrc/devel/monotone/work/.buildlink/include/botan/filter.h:32:
20: note:  virtual void Botan::Filter::write(const Botan::byte*, 
size_t)

...

Comment 16 by Martin von Gagern, Jan 8, 2013

Apparently merged in 
https://code.monotone.ca/p/monotone/source/commit/f4feb3fdc68e4f95590
9450b2dcb3ff9312dbc9e/

Comment 17 by Martin von Gagern, Jan 8, 2013

https://380257.bugs.gentoo.org/attachment.cgi?id=309903 has a patch 
for this.

Created: 13 years 3 months ago by Peter Volkov

Updated: 11 years 11 months ago

Status: Fixed

Followed by: 5 persons

Labels:
Type:Defect
Priority:Medium

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status