Re: Threads related SIGSEGV in random.c (diff, v2)

2013-03-14 Thread Antoine Jacoutot
On Thu, Sep 27, 2012 at 12:43:24PM +0300, Alexey Suslikov wrote: Program received signal SIGSEGV, Segmentation fault. [Switching to thread 1006387] 0x0cb33345cf6e in random () at /usr/src/lib/libc/stdlib/random.c:387 387 *fptr += *rptr; Back trace: Thread 10

Re: Threads related SIGSEGV in random.c (diff, v2)

2013-03-14 Thread Ted Unangst
On Thu, Mar 14, 2013 at 14:30, Antoine Jacoutot wrote: FYI I am seeing a somehow similar crash when using sysutils/bacula (both 5.2 and 5.3). It is 100% reproducible on my setup. Obviously painful since it means I cannot run backups anymore... The following is brought to you without testing

Re: Threads related SIGSEGV in random.c (diff, v2)

2013-03-14 Thread Antoine Jacoutot
On Thu, Mar 14, 2013 at 11:41:52AM -0400, Ted Unangst wrote: On Thu, Mar 14, 2013 at 14:30, Antoine Jacoutot wrote: FYI I am seeing a somehow similar crash when using sysutils/bacula (both 5.2 and 5.3). It is 100% reproducible on my setup. Obviously painful since it means I cannot run

Re: Threads related SIGSEGV in random.c (diff, v2)

2013-03-14 Thread Ted Unangst
On Thu, Mar 14, 2013 at 17:24, Antoine Jacoutot wrote: On Thu, Mar 14, 2013 at 11:41:52AM -0400, Ted Unangst wrote: On Thu, Mar 14, 2013 at 14:30, Antoine Jacoutot wrote: FYI I am seeing a somehow similar crash when using sysutils/bacula (both 5.2 and 5.3). It is 100% reproducible on my

Re: Threads related SIGSEGV in random.c (diff, v2)

2013-03-14 Thread Antoine Jacoutot
On Thu, Mar 14, 2013 at 12:48:52PM -0400, Ted Unangst wrote: On Thu, Mar 14, 2013 at 17:24, Antoine Jacoutot wrote: On Thu, Mar 14, 2013 at 11:41:52AM -0400, Ted Unangst wrote: On Thu, Mar 14, 2013 at 14:30, Antoine Jacoutot wrote: FYI I am seeing a somehow similar crash when using

Re: Threads related SIGSEGV in random.c (diff, v2)

2013-03-14 Thread Alexey Suslikov
On Thu, Mar 14, 2013 at 6:48 PM, Ted Unangst t...@tedunangst.com wrote: On Thu, Mar 14, 2013 at 17:24, Antoine Jacoutot wrote: On Thu, Mar 14, 2013 at 11:41:52AM -0400, Ted Unangst wrote: On Thu, Mar 14, 2013 at 14:30, Antoine Jacoutot wrote: FYI I am seeing a somehow similar crash when

Re: Threads related SIGSEGV in random.c (diff, v2)

2012-09-28 Thread Philip Guenther
On Thu, 27 Sep 2012, Alexey Suslikov wrote: On Thursday, September 27, 2012, Alexey Suslikov wrote: On Thursday, September 27, 2012, Philip Guenther wrote: On Thu, 27 Sep 2012, Alexey Suslikov wrote: Removing only local variables part reverts us to previous behavior (i.e. crashes).

Re: Threads related SIGSEGV in random.c (diff, v2)

2012-09-27 Thread Alexey Suslikov
On Thursday, September 27, 2012, Philip Guenther wrote: On Thu, 27 Sep 2012, Alexey Suslikov wrote: Removing only local variables part reverts us to previous behavior (i.e. crashes). My guess is your program is calling srandom(), srandomdev(), initstate() or setstate() as well. Your diff

Threads related SIGSEGV in random.c (diff, v2)

2012-09-27 Thread Alexey Suslikov
On Thursday, September 27, 2012, Alexey Suslikov wrote: On Thursday, September 27, 2012, Philip Guenther wrote: On Thu, 27 Sep 2012, Alexey Suslikov wrote: Removing only local variables part reverts us to previous behavior (i.e. crashes). My guess is your program is calling srandom(),

Re: Threads related SIGSEGV in random.c (diff, v2)

2012-09-26 Thread Alexey Suslikov
Hi. Any news on that? On Friday, September 21, 2012, Alexey Suslikov wrote: On Fri, Sep 21, 2012 at 10:36 AM, Alexey Suslikov alexey.susli...@gmail.com javascript:; wrote: On Wed, Sep 19, 2012 at 10:24 PM, Ted Unangst t...@tedunangst.comjavascript:; wrote: On Wed, Sep 19, 2012 at

Re: Threads related SIGSEGV in random.c (diff, v2)

2012-09-26 Thread Ted Unangst
On Wed, Sep 26, 2012 at 11:18, Alexey Suslikov wrote: Hi. Any news on that? Can we do it without the local variables for speed part? I am not interested in making this function faster.

Re: Threads related SIGSEGV in random.c (diff, v2)

2012-09-26 Thread Alexey Suslikov
On Wed, Sep 26, 2012 at 9:51 PM, Ted Unangst t...@tedunangst.com wrote: On Wed, Sep 26, 2012 at 11:18, Alexey Suslikov wrote: Hi. Any news on that? Can we do it without the local variables for speed part? I am not interested in making this function faster. Removing only local variables

Re: Threads related SIGSEGV in random.c (diff, v2)

2012-09-26 Thread Ted Unangst
On Thu, Sep 27, 2012 at 00:18, Alexey Suslikov wrote: On Wed, Sep 26, 2012 at 9:51 PM, Ted Unangst t...@tedunangst.com wrote: On Wed, Sep 26, 2012 at 11:18, Alexey Suslikov wrote: Hi. Any news on that? Can we do it without the local variables for speed part? I am not interested in making

Re: Threads related SIGSEGV in random.c (diff, v2)

2012-09-26 Thread Philip Guenther
On Thu, 27 Sep 2012, Alexey Suslikov wrote: Removing only local variables part reverts us to previous behavior (i.e. crashes). My guess is your program is calling srandom(), srandomdev(), initstate() or setstate() as well. Your diff doesn't protect the alteration of state, end_ptr, fptr,

Re: Threads related SIGSEGV in random.c

2012-09-21 Thread Alexey Suslikov
On Wed, Sep 19, 2012 at 10:24 PM, Ted Unangst t...@tedunangst.com wrote: On Wed, Sep 19, 2012 at 18:50, Alexey Suslikov wrote: On Wednesday, September 19, 2012, Theo de Raadt wrote: arc4random() is also thread-safe (it has interal locking) and very desirable for other reasons. But no way to

Threads related SIGSEGV in random.c (diff, v2)

2012-09-21 Thread Alexey Suslikov
On Fri, Sep 21, 2012 at 10:36 AM, Alexey Suslikov alexey.susli...@gmail.com wrote: On Wed, Sep 19, 2012 at 10:24 PM, Ted Unangst t...@tedunangst.com wrote: On Wed, Sep 19, 2012 at 18:50, Alexey Suslikov wrote: On Wednesday, September 19, 2012, Theo de Raadt wrote: arc4random() is also

Re: Threads related SIGSEGV in random.c

2012-09-20 Thread Remco
Stefan Sperling wrote: On Wed, Sep 19, 2012 at 10:37:09PM +0300, Alexey Suslikov wrote: Could you guide me how to rebuild/reinstall libc in a proper way? It's easy, just needs 11 steps. This is how I did it: 1) $ cd /usr/src/lib/libc 2) edit files 3) $ make obj 4) $ make clean 5) $

Re: Threads related SIGSEGV in random.c

2012-09-20 Thread Stuart Henderson
On 2012/09/19 22:06, Stefan Sperling wrote: On Wed, Sep 19, 2012 at 10:37:09PM +0300, Alexey Suslikov wrote: Could you guide me how to rebuild/reinstall libc in a proper way? It's easy, just needs 11 steps. This is how I did it: 1) $ cd /usr/src/lib/libc 2) edit files 3) $ make obj 4)

Re: Threads related SIGSEGV in random.c

2012-09-20 Thread Stefan Sperling
On Thu, Sep 20, 2012 at 09:15:42AM +0200, Remco wrote: AFAICT at least the tools in /bin and /sbin are statically linked and would need to be rebuilt to include any changes in libc. That's correct, and it's actually very convenient. If you make some mistake dynamic binaries might no longer be

Re: Threads related SIGSEGV in random.c

2012-09-20 Thread Otto Moerbeek
On Thu, Sep 20, 2012 at 09:42:16AM +0100, Stuart Henderson wrote: On 2012/09/19 22:06, Stefan Sperling wrote: On Wed, Sep 19, 2012 at 10:37:09PM +0300, Alexey Suslikov wrote: Could you guide me how to rebuild/reinstall libc in a proper way? It's easy, just needs 11 steps. This is how I

Re: Threads related SIGSEGV in random.c

2012-09-20 Thread Paul Irofti
On Thu, Sep 20, 2012 at 09:42:16AM +0100, Stuart Henderson wrote: On 2012/09/19 22:06, Stefan Sperling wrote: On Wed, Sep 19, 2012 at 10:37:09PM +0300, Alexey Suslikov wrote: Could you guide me how to rebuild/reinstall libc in a proper way? It's easy, just needs 11 steps. This is how I

Re: Threads related SIGSEGV in random.c

2012-09-20 Thread Stuart Henderson
On 2012/09/20 12:04, Paul Irofti wrote: On Thu, Sep 20, 2012 at 09:42:16AM +0100, Stuart Henderson wrote: On 2012/09/19 22:06, Stefan Sperling wrote: On Wed, Sep 19, 2012 at 10:37:09PM +0300, Alexey Suslikov wrote: Could you guide me how to rebuild/reinstall libc in a proper way?

Re: Threads related SIGSEGV in random.c

2012-09-19 Thread Paul Irofti
On Tue, Sep 18, 2012 at 05:46:55PM -0700, Marco S Hyman wrote: On Sep 18, 2012, at 3:27 PM, Paul Irofti p...@irofti.net wrote: Because most of the guys in the hackingroom didn't get this, the reference is to a book named 'American Gods' by Neil Gaimen. Wednesday is Odin from the Norse

Re: Threads related SIGSEGV in random.c

2012-09-19 Thread Theo de Raadt
arc4random() is also thread-safe (it has interal locking) and very desirable for other reasons. But no way to save state. The last part of this is intentional. Saving the state of pseudo random number generators is a stupid concept from the 80's.

Re: Threads related SIGSEGV in random.c

2012-09-19 Thread Alexey Suslikov
On Wednesday, September 19, 2012, Theo de Raadt wrote: arc4random() is also thread-safe (it has interal locking) and very desirable for other reasons. But no way to save state. The last part of this is intentional. Saving the state of pseudo random number generators is a stupid concept

Re: Threads related SIGSEGV in random.c

2012-09-19 Thread Otto Moerbeek
Op 19 sep. 2012 om 17:28 heeft Theo de Raadt dera...@cvs.openbsd.org het volgende geschreven: arc4random() is also thread-safe (it has interal locking) and very desirable for other reasons. But no way to save state. The last part of this is intentional. Saving the state of pseudo random

Re: Threads related SIGSEGV in random.c

2012-09-19 Thread Alexander Hall
On 09/19/12 10:16, Paul Irofti wrote: On Tue, Sep 18, 2012 at 05:46:55PM -0700, Marco S Hyman wrote: On Sep 18, 2012, at 3:27 PM, Paul Irofti p...@irofti.net wrote: Because most of the guys in the hackingroom didn't get this, the reference is to a book named 'American Gods' by Neil Gaimen.

Re: Threads related SIGSEGV in random.c

2012-09-19 Thread Ted Unangst
On Wed, Sep 19, 2012 at 18:50, Alexey Suslikov wrote: On Wednesday, September 19, 2012, Theo de Raadt wrote: arc4random() is also thread-safe (it has interal locking) and very desirable for other reasons. But no way to save state. The last part of this is intentional. Saving the state of

Re: Threads related SIGSEGV in random.c

2012-09-19 Thread Alexey Suslikov
On Wed, Sep 19, 2012 at 10:24 PM, Ted Unangst t...@tedunangst.com wrote: On Wed, Sep 19, 2012 at 18:50, Alexey Suslikov wrote: On Wednesday, September 19, 2012, Theo de Raadt wrote: arc4random() is also thread-safe (it has interal locking) and very desirable for other reasons. But no way to

Re: Threads related SIGSEGV in random.c

2012-09-19 Thread Stefan Sperling
On Wed, Sep 19, 2012 at 10:37:09PM +0300, Alexey Suslikov wrote: Could you guide me how to rebuild/reinstall libc in a proper way? It's easy, just needs 11 steps. This is how I did it: 1) $ cd /usr/src/lib/libc 2) edit files 3) $ make obj 4) $ make clean 5) $ make 6) pray !!! 7) $ sudo make

Threads related SIGSEGV in random.c

2012-09-18 Thread Alexey Suslikov
Hello tech@. This one being discovered by Roman Kravchuk using Kannel port (see https://github.com/jasperla/openbsd-wip/tree/master/net/kannel). While stress testing, Kannel components die with Program received signal SIGSEGV, Segmentation fault. [Switching to thread 1006387] 0x0cb33345cf6e

Re: Threads related SIGSEGV in random.c

2012-09-18 Thread Theo de Raadt
Standards gods are capricious gods. They are false gods.

Re: Threads related SIGSEGV in random.c

2012-09-18 Thread Philip Guenther
On Tue, 18 Sep 2012, Marc Espie wrote: On Tue, Sep 18, 2012 at 01:39:14PM -0600, Theo de Raadt wrote: Standards gods are capricious gods. They are false gods. Sounds like American gods :) Maybe Standards is the god that no one can remember that Wednesday meets in Las Vegas...

Re: Threads related SIGSEGV in random.c

2012-09-18 Thread Marc Espie
On Tue, Sep 18, 2012 at 01:39:14PM -0600, Theo de Raadt wrote: Standards gods are capricious gods. They are false gods. Sounds like American gods :)

Re: Threads related SIGSEGV in random.c

2012-09-18 Thread Alexey Suslikov
On Tuesday, September 18, 2012, Otto Moerbeek wrote: On Tue, Sep 18, 2012 at 03:32:04PM -0400, Ted Unangst wrote: On Tue, Sep 18, 2012 at 19:40, Alexey Suslikov wrote: This one being discovered by Roman Kravchuk using Kannel port (see

Re: Threads related SIGSEGV in random.c

2012-09-18 Thread Paul Irofti
On Tue, Sep 18, 2012 at 12:55:40PM -0700, Philip Guenther wrote: On Tue, 18 Sep 2012, Marc Espie wrote: On Tue, Sep 18, 2012 at 01:39:14PM -0600, Theo de Raadt wrote: Standards gods are capricious gods. They are false gods. Sounds like American gods :) Maybe Standards is the

Re: Threads related SIGSEGV in random.c

2012-09-18 Thread Marco S Hyman
On Sep 18, 2012, at 3:27 PM, Paul Irofti p...@irofti.net wrote: Because most of the guys in the hackingroom didn't get this, the reference is to a book named 'American Gods' by Neil Gaimen. Wednesday is Odin from the Norse Sagas in that book. Gaiman, not Gaimen. http://www.neilgaiman.com/

Re: Threads related SIGSEGV in random.c

2012-09-18 Thread Ted Unangst
On Wed, Sep 19, 2012 at 00:48, Alexey Suslikov wrote: No, according to posix it should be thread safe. I don't know why, since rand() is one of the exempted functions, but random() is not. Standards gods are capricious gods. I think you should stress *should* here. Looking at the

Re: Threads related SIGSEGV in random.c

2012-09-18 Thread Otto Moerbeek
On Tue, Sep 18, 2012 at 09:45:59PM -0400, Ted Unangst wrote: On Wed, Sep 19, 2012 at 00:48, Alexey Suslikov wrote: No, according to posix it should be thread safe. I don't know why, since rand() is one of the exempted functions, but random() is not. Standards gods are capricious