You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Robert Lazarski (Jira)" <ji...@apache.org> on 2026/01/12 22:15:00 UTC

[jira] [Resolved] (AXIS2C-1584) Asynchronous call crashes and memory leaks

     [ https://issues.apache.org/jira/browse/AXIS2C-1584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Lazarski resolved AXIS2C-1584.
-------------------------------------
    Resolution: Fixed

    Add reference counting to axis2_callback to prevent use-after-free and
    memory leaks in async non-blocking operations. The callback is shared
    between the main thread and worker thread, requiring proper lifecycle
    management.
    
    Changes:
    - Add ref counter to axis2_callback struct, initialized to 1
    - Add axis2_callback_increment_ref() for thread-safe ref increment
    - Modify axis2_callback_free() to decrement ref and only free at zero
    - Update op_client worker thread to properly manage callback refs
    - Update svc_client async operations to balance ref counts
    - Handle NULL response in worker thread with error callback
    - Add error checking for axis2_engine_send()


> Asynchronous call crashes and memory leaks
> ------------------------------------------
>
>                 Key: AXIS2C-1584
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-1584
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: core/clientapi
>    Affects Versions: 1.6.0
>         Environment: Ubuntu Linux
>            Reporter: Alex Mantaut
>            Priority: Blocker
>              Labels: asynchronous, memory_leak, non-blocking, patch
>             Fix For: 2.0.0
>
>         Attachments: axis_async.patch, calculatorFinal.tar.gz, echo_non_blocking_tester.zip
>
>
> 1. Fix crash when a non-blocking call results in a timeout.
> 2. Implements an incremental ref system on callbacks to avoid a big memory leak.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: c-dev-help@axis.apache.org