Re: [kde-freebsd] [KDE/Mac] [CODE] Multithreaded SIGSEGV signal handling, please examine

2011-09-25 Thread Jonas Bähr

Hi,

Am 25.09.2011 um 01:37 schrieb Michael Pyne:


 [...]
With that said I don't think the code uses as many POSIX options as  
the rest
of KSharedDataCache (e.g. process-shared mutexes as unimplemented on  
Mac OS X)

but I wanted to give a chance for you guys to test the prototype code
beforehand and let me know if there's problems.

You'll want to compile with something like this:
$CXX -O2 -o sigcatcher -lrt -pthread sigcatcher.cpp


Here is the first issue: librt doesn't exist here (Mac OS X 10.5  
Leopard).

However, the code compiles without the -lrt.
$ g++ -O2 -o sigcatcher -pthread sigcatcher.cpp
$ g++ --version
i686-apple-darwin9-g++-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5493)

Make sure optimization is enabled to ensure volatile is used where  
it's

needed. Assuming everything works right you should get output like:

$ ./sigcatcher
Hello, World!
Got a result of 1
Exited thread
$


The next problem is, that sem_init(..) isn't implemented here.
$ ./sigcatcher
Error: sem_init: Function not implemented
$

It seems that only named semaphores are implemented.
I've changed this part of your code to use sem_open(..) instead [see  
attachment] and then I get the expected result:


sigcatcher-sem_open.cpp
Description: Binary data




$ g++ -O2 -o sigcatcher-sem_open -pthread sigcatcher-sem_open.cpp
$ ./sigcatcher-sem_open
Hello, World!
Got a result of 1
Exited thread
$

bye,
Jonas



If you want to see the signal handler in action there's a couple of  
lines you

can uncomment (just grep for uncomment to find where).

Obviously any other feedback on possible issues is appreciated as  
well, but
basically I'd like to catch any portability issues early this time  
instead of

after-the-fact.

Please CC me on any replies as I'm not subscribed.

Regards,
- Michael  
Pynesigcatcher.cpp___

kde-...@kde.org
List Information: https://mail.kde.org/mailman/listinfo/kde-mac
KDE/Mac Information: 
http://techbase.kde.org/index.php?title=Projects/KDE_on_Mac_OS_X


___
kde-freebsd mailing list
kde-freebsd@kde.org
https://mail.kde.org/mailman/listinfo/kde-freebsd
See also http://freebsd.kde.org/ for latest information


Re: [kde-freebsd] [KDE/Mac] [CODE] Multithreaded SIGSEGV signal handling, please examine

2011-09-25 Thread Kurt Hindenburg

On Sep 25, 2011, at 8:34 AM, Jonas Bähr wrote:

 Hi,
 
 Am 25.09.2011 um 01:37 schrieb Michael Pyne:
 
 [...]
 With that said I don't think the code uses as many POSIX options as the rest
 of KSharedDataCache (e.g. process-shared mutexes as unimplemented on Mac OS 
 X)
 but I wanted to give a chance for you guys to test the prototype code
 beforehand and let me know if there's problems.
 
 You'll want to compile with something like this:
 $CXX -O2 -o sigcatcher -lrt -pthread sigcatcher.cpp
 
 Here is the first issue: librt doesn't exist here (Mac OS X 10.5 Leopard).
 However, the code compiles without the -lrt.
 $ g++ -O2 -o sigcatcher -pthread sigcatcher.cpp
 $ g++ --version
 i686-apple-darwin9-g++-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5493)
 
 Make sure optimization is enabled to ensure volatile is used where it's
 needed. Assuming everything works right you should get output like:
 
 $ ./sigcatcher
 Hello, World!
 Got a result of 1
 Exited thread
 $
 
 The next problem is, that sem_init(..) isn't implemented here.
 $ ./sigcatcher
 Error: sem_init: Function not implemented
 $
 
 It seems that only named semaphores are implemented.
 I've changed this part of your code to use sem_open(..) instead [see 
 attachment] and then I get the expected result:
 sigcatcher-sem_open.cpp
 
 
 $ g++ -O2 -o sigcatcher-sem_open -pthread sigcatcher-sem_open.cpp
 $ ./sigcatcher-sem_open
 Hello, World!
 Got a result of 1
 Exited thread
 $

Same results as Jonas on Lion.

i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) 
(LLVM build 2335.15.00)

Kurt


___
kde-freebsd mailing list
kde-freebsd@kde.org
https://mail.kde.org/mailman/listinfo/kde-freebsd
See also http://freebsd.kde.org/ for latest information


Re: [kde-freebsd] [KDE/Mac] [CODE] Multithreaded SIGSEGV signal handling, please examine

2011-09-25 Thread Michael Pyne
On Sunday, September 25, 2011 14:34:49 you wrote:
 The next problem is, that sem_init(..) isn't implemented here.
 $ ./sigcatcher
 Error: sem_init: Function not implemented
 $
 
 It seems that only named semaphores are implemented.
 I've changed this part of your code to use sem_open(..) instead [see
 attachment] and then I get the expected result:

For the application in question named synchronization primitives are non-
ideal. Does Mac OS X support a plain pthread_mutex? If so that would work fine 
(and probably even the Qt primitives will work OK).

Also, could you test whether a SIGSEGV is actually caught and handled 
correctly? My email last night was wishy-washy about that but the 
sigsetjmp/siglongjmp stuff is closer to hocus-pocus than most programs are 
likely to get and it would be nice to know if that works or not.

Regards,
 - Michael Pyne

signature.asc
Description: This is a digitally signed message part.
___
kde-freebsd mailing list
kde-freebsd@kde.org
https://mail.kde.org/mailman/listinfo/kde-freebsd
See also http://freebsd.kde.org/ for latest information


Re: [kde-freebsd] ports/156901: [patch] devel/cmake breaks with CC containing spaces

2011-09-25 Thread Alberto Villa
On Sat, Sep 24, 2011 at 7:47 PM, Dominic Fandrey kamik...@bsdforen.de wrote:
 No problem. Knowing where I stand makes it a lot easier for me, so
 thanks for telling me!

thank you for the work you have done so far, quite a big one! we'll
let you know when there is time for this
-- 
Alberto Villa, FreeBSD committer avi...@freebsd.org
http://people.FreeBSD.org/~avilla
___
kde-freebsd mailing list
kde-freebsd@kde.org
https://mail.kde.org/mailman/listinfo/kde-freebsd
See also http://freebsd.kde.org/ for latest information