[Botan-devel] Botan library with Netsieben core dump

Neetu Garg garg_neetu at yahoo.com
Tue Oct 27 01:21:29 EDT 2009


Thanks Jack,

I tried to apply the patch but it resulted in some errors:

Please let me know if I am doing anything wrong here.

Regards,

NG

[root at perf-tools-7 perfstat_8]# patch -p1 < ne7ssh_threads.patch 
can't find file to patch at input line 7
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|;; This buffer is for notes you don't want to save, and for Lisp evaluation.
|;; If you want to create a file, visit that file with C-x C-f,
|;; then enter the text in that file's own buffer.
|
|--- ne7ssh-1.3.1/src/ne7ssh.cpp 2009-05-05 15:24:44.000000000 -0400
|+++ ne7ssh-1.3.1-locking/src/ne7ssh.cpp 2009-10-22 13:05:02.000000000 -0400
--------------------------
File to patch: ./ne7ssh-1.3.1/src/ne7ssh.cpp  
patching file ./ne7ssh-1.3.1/src/ne7ssh.cpp
Hunk #1 succeeded at 16 with fuzz 1.
can't find file to patch at input line 95
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -ur ne7ssh-1.3.1/src/ne7ssh.h ne7ssh-1.3.1-locking/src/ne7ssh.h
|--- ne7ssh-1.3.1/src/ne7ssh.h   2009-02-25 12:32:35.000000000 -0500
|+++ ne7ssh-1.3.1-locking/src/ne7ssh.h   2009-10-22 12:59:11.000000000 -0400
--------------------------
File to patch: ./ne7ssh-1.3.1/src/ne7ssh.cpp
patching file ./ne7ssh-1.3.1/src/ne7ssh.cpp
Hunk #1 FAILED at 30.
Hunk #2 FAILED at 144.
2 out of 2 hunks FAILED -- saving rejects to file ./ne7ssh-1.3.1/src/ne7ssh.cpp.rej







----- Original Message ----
From: Jack Lloyd <lloyd at randombit.net>
To: Botan development list <botan-devel at randombit.net>
Sent: Mon, October 26, 2009 3:31:05 PM
Subject: Re: [Botan-devel] Botan library with Netsieben core dump

On Mon, Oct 26, 2009 at 03:22:54PM -0700, Neetu Garg wrote:

> My code in multithreaded (boost thread) and I am running on Linux. It creates different channel for all threads as specified in multithreaded example 
> of Netsieben library.Sometimes the code 
> runs just fine without any issue. Sometimes it coredumps. I tried checking all the core dumps 
> using gdb and looks like all the coming from Botan library calls.

As best I could tell, it appears ne7ssh is sharing a single RNG object
across all threads without any locking. This is not something that is
going to work out well.

Depending on performance characteristics it may make more sense to
serialize a single PRNG object or use TLS to maintain an RNG per
thread. I've attached a patch that does the former.

If it works for you, let me know and I'll forward it to the Netsieben
developers.

-Jack



      



More information about the botan-devel mailing list