The SO_NOSIGPIPE is OK on macOS

But …
I get quite a few …

[  3%] Building CXX object 
CMakeFiles/rexxapi.dir/rexxapi/client/LocalAPIManager.cpp.o
/Users/enrico/rxapi.svn/rexxapi/client/LocalAPIManager.cpp:302:9: warning: 
delete called on 'ApiConnection' that is abstract but has
      non-virtual destructor [-Wdelete-non-virtual-dtor]
        delete connection;
        ^
/Users/enrico/rxapi.svn/rexxapi/client/LocalAPIManager.cpp:315:5: warning: 
delete called on 'ApiConnection' that is abstract but has
      non-virtual destructor [-Wdelete-non-virtual-dtor]
    delete connection;
    ^
/Users/enrico/rxapi.svn/rexxapi/client/LocalAPIManager.cpp:336:5: warning: 
delete called on 'ApiConnection' that is abstract but has
      non-virtual destructor [-Wdelete-non-virtual-dtor]
    delete connection;
    ^
3 warnings generated.


[ 80%] Building CXX object CMakeFiles/rxapi.dir/rexxapi/server/APIServer.cpp.o
/Users/enrico/rxapi.svn/rexxapi/server/APIServer.cpp:68:5: warning: delete 
called on 'ServerConnectionManager' that is abstract but has
      non-virtual destructor [-Wdelete-non-virtual-dtor]
    delete connectionManager;
    ^
/Users/enrico/rxapi.svn/rexxapi/server/APIServer.cpp:157:13: warning: delete 
called on 'ApiConnection' that is abstract but has
      non-virtual destructor [-Wdelete-non-virtual-dtor]
            delete connection;
            ^
/Users/enrico/rxapi.svn/rexxapi/server/APIServer.cpp:183:25: warning: delete 
called on 'ApiConnection' that is abstract but has
      non-virtual destructor [-Wdelete-non-virtual-dtor]
                        delete connection;
                        ^
/Users/enrico/rxapi.svn/rexxapi/server/APIServer.cpp:209:13: warning: delete 
called on 'ApiConnection' that is abstract but has
      non-virtual destructor [-Wdelete-non-virtual-dtor]
            delete connection;
            ^


Build fails with 

[enrico@enrico-imac rxapi.svn.Release]$make
[  0%] Generating rexx.1.gz
[  0%] Built target rexx_man
[  0%] Generating rxsubcom.1.gz
[  0%] Built target rxsubcom_man
[  2%] Built target class_files
[  2%] Built target ncurses_cls
Scanning dependencies of target rexxapi
[  2%] Building CXX object 
CMakeFiles/rexxapi.dir/rexxapi/client/platform/unix/SysLocalAPIManager.cpp.o
[  2%] Linking CXX shared library bin/librexxapi.dylib
Undefined symbols for architecture x86_64:
  "SysLocalSocketConnection::~SysLocalSocketConnection()", referenced from:
      SysLocalAPIManager::newClientConnection() in SysLocalAPIManager.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bin/librexxapi.5.0.0.dylib] Error 1
make[1]: *** [CMakeFiles/rexxapi.dir/all] Error 2
make: *** [all] Error 2
[enrico@enrico-imac rxapi.svn.Release]$

But if I comment 

ApiConnection *SysLocalAPIManager::newClientConnection()
{
    SysLocalSocketConnection *connection = new SysLocalSocketConnection();

    // open the pipe to the server
    if 
(!connection->connect(SysServerLocalSocketConnectionManager::generateServiceName()))
    {
        // don't leak memory!
        // delete connection;
        throw new ServiceException(SERVER_FAILURE, "Failure connecting to rxapi 
server");
    }
    return connection;
}

The build is  successful,  and at run time I get

[enrico@enrico-imac ooRexx.tests.svn]$lldb -- rexx testOORexx.rex -s -X 
native_api
(lldb) target create "rexx"
Current executable set to 'rexx' (x86_64).
(lldb) settings set -- target.run-args  "testOORexx.rex" "-s" "-X" "native_api"
(lldb) r
Process 9445 launched: '/Users/enrico/rxapi/bin/rexx' (x86_64)
Searching for test containers....
Executing automated test suite
Executing tests from .../enrico/ooRexx.tests.svn/ooRexx/SimpleTests.testGroup
Executing tests from .../ooRexx/extensions/hostemu/hostemu.testGroup
Executing tests from .../extensions/platform/unix/rxunixsys/SysUnix.testGroup
Executing tests from .../ooRexx/extensions/rxsock/socketClass.testGroup
Executing tests from .../ooRexx/extensions/rxregexp/rxregexp.testGroup
Executing tests from .../ooRexx.tests.svn/ooRexx/extensions/json/json.testGroup
Executing tests from .../ooRexx/extensions/rxmath/RxMath.testGroup
Executing tests from .../ooRexx/utilities/rxqueue/rxQueue.testGroup
Process 9445 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION 
(code=EXC_I386_INVOP, subcode=0x0)
    frame #0: 0x00000001003f7ba8 
librexxapi.5.0.0.dylib`ApiConnection::~ApiConnection(this=0x0000000100502bd0) 
at CSStream.hpp:64
   61   {
   62   public:
   63       inline ApiConnection() : errcode(CSERROR_OK), messageBuffer(NULL) { 
}
-> 64       inline ~ApiConnection() { disconnect(); if (messageBuffer != NULL) 
{ free(messageBuffer); } }
   65   
   66       inline CSErrorCodeT getError()
   67       {
Target 0: (rexx) stopped.
(lldb) q
Quitting LLDB will kill one or more processes. Do you really want to proceed: 
[Y/n] 
[enrico@enrico-imac ooRexx.tests.svn]$

Enrico



> On 29 Nov 2018, at 18:57, Erich Steinböck <erich.steinbo...@gmail.com> wrote:
> 
> Re latest commit [r11543]:
> 
> As far as I understand SO_NOSIGPIPE is BSD-only, and not available on Linux.
> The only compatible option seems to be
> signal(SIGPIPE, SIG_IGN);
> 
> _______________________________________________
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel

_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to