OTP R13B01 odbc

Paul Oliver puzza007@REDACTED
Thu Sep 3 12:24:23 CEST 2009


More info in case it rings any bells...

Using strace to monitor erl/odbcserver causes odbc:connect to *work*.  The
odbcserver process starts up and connects to both the supervisor prot and
the worker port.  Adding logging to odbcserver seems to show that when not
being viewed with strace (or having pman run), the main function in
odbcserver is never run!  Is there a reason it wouldn't even get this far?

The logging we've added to odbcserver.c is:

int main(void)
{
    FILE *fh;
    byte *msg = NULL;
    char *temp = NULL, *supervisor_port = NULL, *odbc_port = NULL;
    size_t length;
#ifdef WIN32
    _setmode(_fileno( stdin),  _O_BINARY);
#endif

*      fh = fopen("/tmp/odbc.log", "a");
    fprintf(fh, "Start main...\n");
    fflush(fh);
    fclose(fh);*

[snip]

#if defined WIN32 || defined USE_IPV4
/* Currently only an old windows compiler is supported so we do not have
ipv6
  capabilities */
static SOCKET connect_to_erlang(const char *port, int is_sup)
{
    SOCKET sock;
    struct sockaddr_in sin;
    FILE *fh;
    int conn_ret;

*    if (is_sup)
      fh = fopen("/tmp/sup.log", "a");
    else
      fh = fopen("/tmp/odbc.log", "a");

    fprintf(fh, "connect_to_erlang call to \"socket\"\n");
    fflush(fh);
*
I'm running on Linux foobar 2.6.24-24-server #1 SMP Tue Aug 18 16:51:43 UTC
2009 x86_64 GNU/Linux

Thanks!
Paul.

On Tue, Sep 1, 2009 at 3:38 PM, Paul Oliver<puzza007@REDACTED> wrote:
> Hi all,
>
> I'm experiencing an odd issue with the odbc application under OTP R13B.
>
> If I run start a connection *after* starting pman, it works.  However,
> if I don't run pman, I get a connection timeout!  See my erl shell
> session below.  I've added logging to the odbcserver port and in the
> latter case it doesn't seem to start at all.
>
> Does anyone know what the problem could be?
>
> Thanks,
> Paul.
>
> Eshell V5.7.2  (abort with ^G)
> 1>  odbc:start().
> ok
> 2> odbc:connect("DSN=inftest",[]).
>
> =ERROR REPORT==== 1-Sep-2009::14:20:24 ===
> ** Generic server <0.40.0> terminating
> ** Last message in was {<0.33.0>,
>                        {connect,[1,1,2,1,1,"DSN=inftest"],on,on},
>                        infinity}
> ** When Server state == {state,#Port<0.547>,
>                               {<0.33.0>,#Ref<0.0.0.37>},
>
<0.33.0>,undefined,on,undefined,undefined,on,
>                               connecting,undefined,0,
>                               [#Port<0.545>,#Port<0.546>],
>                               undefined,undefined}
> ** Reason for termination ==
> ** timeout
> {error,connection_closed}
> 3>
>
> But:
>
> 1> odbc:start().
> ok
> 2> pman:start().
> <0.42.0>
> 3>  odbc:connect("DSN=inftest",[]).
> {ok,<0.54.0>}
>


More information about the erlang-questions mailing list