Skip to content

[Bug]: malloc issue when using tools and agent run in a loop #1699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
marklysze opened this issue Apr 23, 2025 · 0 comments
Open

[Bug]: malloc issue when using tools and agent run in a loop #1699

marklysze opened this issue Apr 23, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@marklysze
Copy link
Collaborator

marklysze commented Apr 23, 2025

Describe the bug

I was trying to run an agent with tools using the agent's run method while in a for loop and it was causing some memory allocation issues during the loop. It wasn't consistently at any spot but did happen on around iteration 8 and 12.

Using the GoogleDriveToolkit and one of the tools in it: download_file_from_drive

Here's an output of it - which has some printouts of the run events (the 11/98 was iteration 11 of 98):

[11/98] type='using_auto_reply' content=UsingAutoReplyEvent(uuid=UUID('d286aab8-9e86-4f36-ba53-4a80720a6314'), human_input_mode='TERMINATE', sender='user', recipient='download_agent')

[11/98] type='tool_call' content=ToolCallEvent(uuid=UUID('4f014cd7-ee70-4606-a074-b6384958cf22'), content=None, sender='download_agent', recipient='user', refusal=None, role='assistant', audio=None, function_call=None, tool_calls=[ToolCall(id='call_KtBxbrw92HrWnPAH1d0PcXEn', function=FunctionCall(name='download_file_from_drive', arguments='{"file_info":{"name":"Support Letter.pdf","id":"1UR69JhOMQsNqDOYX1qSndVQvwHT11cFo","mimeType":"application/pdf"},"subfolder_path":"test_folder"}'), type='function')])

[11/98] type='execute_function' content=ExecuteFunctionEvent(uuid=UUID('d00a1b61-6154-4486-81c2-aa757b9f2197'), func_name='download_file_from_drive', call_id='call_KtBxbrw92HrWnPAH1d0PcXEn', arguments={'file_info': {'name': 'Support Letter.pdf', 'id': '1UR69JhOMQsNqDOYX1qSndVQvwHT11cFo', 'mimeType': 'application/pdf'}, 'subfolder_path': 'test_folder'}, recipient='user')

Python(71119,0x324013000) malloc: Incorrect checksum for freed object 0x16a80c400: probably modified after being freed.
Corrupt value: 0xaf3664d4a0779dca
Python(71119,0x324013000) malloc: *** set a breakpoint in malloc_error_break to debug

@davorrunje: If you are refactoring the tools and having a more centralised way of adding tools to agents, you can consider taking the functions parameter off ConversableAgent as that's another interface for adding functions and I think the combination of all these interfaces for adding tools is producing some level of inconsistency.

Steps to reproduce

No response

Model Used

No response

Expected Behavior

No response

Screenshots and logs

No response

Additional Information

No response

@marklysze marklysze added the bug Something isn't working label Apr 23, 2025
@sternakt sternakt assigned davorrunje and unassigned sternakt Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants