On 11/1/2022 12:59 PM, Patrick Vansevenant wrote:
I have tried the following :

procedure curl_global_init external "libcurl.dll" cdecl:
  define input  parameter i-init   as long.
  define return parameter p-Return as*integer.*
end procedure.

But that throws the following error in OpenEdge : "/DLL datatype must be one of CHARACTER, BYTE, SHORT, UNSIGNED-SHORT, LONG, FLOAT, or DOUBLE (3383)"/.

I have tried with SHORT and BYTE as return parameter too. But I experience the same issues as with LONG.

We have also written a C++ program and there indeed, there we don't encounter any issues.


Kind regards,
Patrick
---


Op di 1 nov. 2022 om 05:29 schreef Ray Satiro via curl-library <curl-library@lists.haxx.se>:

    On 10/31/2022 11:13 AM, Patrick Vansevenant via curl-library wrote:


    We have been using libcurl.dll for a few years to do almost all
    our HTTP/HTTPS requests in our OpenEdge 11.7 environment (= our
    custom ERP solution).
    For more info about OpenEdge 11.7 see :
    https://www.progress.com/openedge/whats-new-11-7.


    When libcurl.dll 7.84.0 or higher is used in an OpenEdge 11.7
    session, then the OpenEdge session crashes when the libcurl.dll
    is released from memory.

    A .protrace file is generated with the following error :

    */Exception code: C0000005 ACCESS_VIOLATION/*


    With the following small test OpenEdge program (test_libcurl.p)
    we are able to reproduce the issue :


    /* ***************************  Definitions
     ************************** */

    block-level on error undo, throw.

    /* ********************  Preprocessor Definitions
     ******************** */

    procedure curl_global_init external "libcurl.dll" cdecl:
      define input  parameter i-init   as long.
      define return parameter p-Return as long.
    end procedure.

    procedure curl_global_cleanup external "libcurl.dll" cdecl:
    end procedure.

    /* ***************************  Main Block
     *************************** */
    log-manager:logfile-name = "C:\OpenEdge\WRK117\test_libcurl.log".

    &GLOBAL-DEFINE CURL_GLOBAL_NOTHING    0
    &GLOBAL-DEFINE CURL_GLOBAL_SSL        1
    &GLOBAL-DEFINE CURL_GLOBAL_WIN32      2
    &GLOBAL-DEFINE CURL_GLOBAL_ALL ({&CURL_GLOBAL_SSL} +
    {&CURL_GLOBAL_WIN32})
    &GLOBAL-DEFINE CURLE_OK               0

    define variable iReturn     as integer no-undo.
    define variable iCurlHandle as integer no-undo.

    run *curl_global_init*(input {&CURL_GLOBAL_ALL}, output iReturn).

    log-manager:write-message(substitute("curl_global_init returned
    &1.", iReturn)).

    run *curl_global_cleanup*.

    log-manager:close-log().


    We experience no issues with libcurl.dll 7.83.1 and lower.

    Any idea how we can solve the above issue ?


    curl_global_init return value is int not long type. See if you can
    reproduce in C.


Please don't top-post, it makes the conversation hard to follow. [1]

What you have reported is unlikely to be a libcurl issue, since you cannot reproduce in C. I would contact OpenEdge and ask them how to make libcurl work in their programming language.


[1]: https://curl.se/mail/etiquette.html#Do_Not_Top_Post
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html

Reply via email to