python program suddenly generates Unimplemented function error

Questions about Wine on Linux
Post Reply
zwansie
Level 1
Level 1
Posts: 5
Joined: Tue Mar 04, 2025 3:08 pm

python program suddenly generates Unimplemented function error

Post by zwansie »

Hello,
I need help with a WineHQ error. I’m developing a trading bot in Python on a AWS Debian cloud distribution for MetaTrader 5 (MT5). Since MT5 only runs on Windows, I need Wine to run python programs and the MetaTrader5 terminal for my implementation, and so far, there have been no issues. Once a week, I upgrade my installed debian packages and upgrade my Python packages with pip. One of those packages is MetaTrader5, which I upgraded too. Immediately after upgrading, I started my bot again using the following commands

Code: Select all

wine cmd
venv/Scripts/activate.bat
python <path to program>
Then, the following error was presented:

Code: Select all

wine: Call from 00006FFFFF40CF77 to unimplemented function ucrtbase.dll.crealf, aborting
wine: Unimplemented function ucrtbase.dll.crealf called at address 00006FFFFF40CF77 (thread 02d8), starting debugger...
WineDbg attached to pid 02d4
02e4:fixme:dbghelp:elf_search_auxv can't find symbol in module
02e4:fixme:dbghelp:elf_search_auxv can't find symbol in module
wine: Call from 00006FFFFF40CF77 to unimplemented function ucrtbase.dll.crealf, aborting
I tried to attacht the entire log file which is a text file but I'm unable to ('invalid file extension').

The program had been running without problems for about six weeks, so I don't think the error is due to a missing DLL, as the file is present. I am using Wine version 10.0, and using Winetricks to install that DLL didn’t resolve the issue either.

I reinstalled everything from scratch: I removed the Wine configuration directory, uninstalled MT5, and the Windows Python installation that I had previously installed with Wine (I know it’s a bit unusual to install Python with Wine on Linux, but since MT5 only runs on Windows, this is my only option). MT5 terminal as an application starts without problems. It’s just that the MetaTrader5 module for python generates the error if I import it in my program. I downgraded this module it to a lower version, a version for which my program still ran without problems but the error still shows up. When I leave out the line that imports the MetaTrader5 module my program runs fine but of course I lose all the coded functionality.

I have been patiently waiting for the error to disappear, but of course, it hasn’t, and now I’m stuck.

What could be the reason for this error suddenly appearing, preventing me from running my program anymore?

Main question: how do I investigate this?

Hope someone can guide me here.

thanks in advance


kind regards
M
qwertymnb
Level 5
Level 5
Posts: 272
Joined: Sun Jan 17, 2016 4:36 pm

Re: python program suddenly generates Unimplemented function error

Post by qwertymnb »

Hi,

>Call from 00006FFFFF40CF77 to unimplemented function ucrtbase.dll.crealf, aborting
That function is implemented in wine, so this is weird.
Maybe you picked up some (old) native ucrtbase that doesn't have it??
Could you post output of WINEDEBUG=+loaddll wine your_application.exe ?
zwansie
Level 1
Level 1
Posts: 5
Joined: Tue Mar 04, 2025 3:08 pm

Re: python program suddenly generates Unimplemented function error

Post by zwansie »

Hi, thank you so much for helping!
I attached the output in a file. I copied the output per command I entered. Sorry for the pasted mess but I can't attach a txt file so it seems (invalid file extension error).
zwansie
Level 1
Level 1
Posts: 5
Joined: Tue Mar 04, 2025 3:08 pm

Re: python program suddenly generates Unimplemented function error

Post by zwansie »

I can't paste the output completely so I'll only paste the output from the last command:
0160:trace:loaddll:build_module Loaded L"<personal_path>\\Documents\\dev\\AutoSignalTrader\\venvwin\\Scripts\\python.exe" at 0000000140000000: native
0160:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\kernelbase.dll" at 00006FFFFF400000: builtin
0160:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\kernel32.dll" at 00006FFFFFA50000: builtin
0160:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\ucrtbase.dll" at 00006FFFFEA30000: builtin
0160:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\VERSION.dll" at 00006FFFFC4E0000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\python311\\python.exe" at 0000000140000000: native
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\kernelbase.dll" at 00006FFFFF400000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\kernel32.dll" at 00006FFFFFA50000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\ucrtbase.dll" at 00006FFFFEA30000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\VERSION.dll" at 00006FFFFC4E0000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\WS2_32.dll" at 00006FFFFE960000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\msvcrt.dll" at 00006FFFFEF10000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\sechost.dll" at 00006FFFFEE70000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\advapi32.dll" at 00006FFFFF2B0000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\bcrypt.dll" at 00006FFFFBE90000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\python311\\VCRUNTIME140.dll" at 00006FFFFBE60000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\python311\\python311.dll" at 00006FFFFBF00000: native
0168:trace:loaddll:build_module Loaded L"C:\\python311\\python3.dll" at 0000000180000000: native
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\dnsapi.dll" at 00006FFFFB500000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\nsi.dll" at 00006FFFFB4C0000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\IPHLPAPI.DLL" at 00006FFFFB560000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\python311\\DLLs\\_socket.pyd" at 00006FFFFBE30000: native
0168:trace:loaddll:build_module Loaded L"C:\\python311\\DLLs\\select.pyd" at 00006FFFFBE10000: native
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\win32u.dll" at 00006FFFFD570000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\gdi32.dll" at 00006FFFFE0C0000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\user32.dll" at 00006FFFFDAB0000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\CRYPT32.dll" at 00006FFFFAD00000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\python311\\DLLs\\libcrypto-1_1.dll" at 00006FFFFA9A0000: native
0168:trace:loaddll:build_module Loaded L"C:\\python311\\DLLs\\libssl-1_1.dll" at 00006FFFFA8E0000: native
0168:trace:loaddll:build_module Loaded L"C:\\python311\\DLLs\\_ssl.pyd" at 00006FFFFBDD0000: native
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\imm32.dll" at 00006FFFFB6C0000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\python311\\DLLs\\_asyncio.pyd" at 00006FFFFBDA0000: native
0168:trace:loaddll:build_module Loaded L"C:\\python311\\DLLs\\_overlapped.pyd" at 00006FFFFBD80000: native
0168:trace:loaddll:build_module Loaded L"C:\\python311\\DLLs\\_bz2.pyd" at 00006FFFFBD50000: native
0168:trace:loaddll:build_module Loaded L"C:\\python311\\DLLs\\_lzma.pyd" at 00006FFFFB980000: native
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\shcore.dll" at 00006FFFFC520000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\shlwapi.dll" at 00006FFFFC590000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\SHELL32.dll" at 00006FFFFC6D0000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\rpcrt4.dll" at 00006FFFFD7F0000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\combase.dll" at 00006FFFFE3A0000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\coml2.dll" at 00006FFFFD4C0000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\ole32.dll" at 00006FFFFE560000: builtin
0168:trace:loaddll:build_module Loaded L"C:\\python311\\VCRUNTIME140_1.dll" at 00006FFFFA890000: builtin
0168:trace:loaddll:build_module Loaded L"\\venvwin\\Lib\\site-packages\\MetaTrader5\\_core.cp311-win_amd64.pyd" at 00006FFFFB940000: native
0168:trace:loaddll:build_module Loaded L"<personal_path>\\Documents\\dev\\AutoSignalTrader\\venvwin\\Lib\\site-packages\\numpy.libs\\libscipy_openblas64_-43e11ff0749b8cbe0a615c9cf6737e0e.dll" at 00006FFFF90E0000: native
0168:trace:loaddll:build_module Loaded L"<personal_path>\\Documents\\dev\\AutoSignalTrader\\venvwin\\Lib\\site-packages\\numpy.libs\\msvcp140-263139962577ecda4cd9469ca360a746.dll" at 00006FFFF9040000: native
0168:trace:loaddll:build_module Loaded L"<personal_path>\\Documents\\dev\\AutoSignalTrader\\venvwin\\Lib\\site-packages\\numpy\\_core\\_multiarray_umath.cp311-win_amd64.pyd" at 00006FFFFA460000: native
wine: Call from 00006FFFFF40CF77 to unimplemented function ucrtbase.dll.crealf, aborting
wine: Unimplemented function ucrtbase.dll.crealf called at address 00006FFFFF40CF77 (thread 0168), starting debugger...
WineDbg attached to pid 0164
Last edited by zwansie on Thu Mar 06, 2025 12:44 pm, edited 2 times in total.
qwertymnb
Level 5
Level 5
Posts: 272
Joined: Sun Jan 17, 2016 4:36 pm

Re: python program suddenly generates Unimplemented function error

Post by qwertymnb »

The log shows it's using wine's ucrtbase.

Looking into wine's git history it seems crealf is only added last month:
Author: Stéphane Bacri <[email protected]>
Date: Wed Jan 29 17:54:59 2025 +0100
msvcr120: Add crealf() and cimagf() implementation.


So this won't be included in wine-10.0. What version of wine are you using? If 10.0, then try upgrading to 10.1
zwansie
Level 1
Level 1
Posts: 5
Joined: Tue Mar 04, 2025 3:08 pm

Re: python program suddenly generates Unimplemented function error

Post by zwansie »

Ok, thanks for this info. I was really trying to stay away from running stable en dev versions at the same time. Should I use the information on this page: https://gitlab.winehq.org/wine/wine/-/w ... _system.3F? Or can I solve this with wine prefixes i.e. creating ~/.wine-stable and ~/.wine-devel dirs and do something like this WINEPREFIX=~/.wine-stable wine program.exe? I'm gonna try that this weekend. WIll keep you updated.

BTW Is there an explanation why this suddenly popped up? Maybe new versions of the python modules? Because I also used to run my program with wine, not winehq which also suddenly stopped working on another machine.

thanks again
Kind regards
zwansie
Level 1
Level 1
Posts: 5
Joined: Tue Mar 04, 2025 3:08 pm

Re: python program suddenly generates Unimplemented function error

Post by zwansie »

Unfortunately, I wasn't able to experiment with the 10.1 version last weekend. Will try again this week. Will keep you all updated.
qwertymnb
Level 5
Level 5
Posts: 272
Joined: Sun Jan 17, 2016 4:36 pm

Re: python program suddenly generates Unimplemented function error

Post by qwertymnb »

>Unfortunately, I wasn't able to experiment with the 10.1 version last weekend.

I guess you could also fall back to a native ucrtbase. Like "winetricks vcrun2019" or so
zwansie
Level 1
Level 1
Posts: 5
Joined: Tue Mar 04, 2025 3:08 pm

[SOLVED] Re: python program suddenly generates Unimplemented function error

Post by zwansie »

It works! 'winetricks vcrun2019' did the trick. Thank you. I hadn't touched my project in weeks because of this and now I can continue, thanks! Wow, truly amazing..

For others who might want to try the same solution: add component contrib to your /etc/apt/sources.list file, e.g.

Code: Select all

deb http://deb.debian.org/debian bullseye main contrib
then

Code: Select all

sudo apt update
sudo apt install winetricks
winetricks vcrun2019
cheers!
Regards
M
mozaffar
Newbie
Newbie
Posts: 1
Joined: Sat May 10, 2025 3:25 am

Re: python program suddenly generates Unimplemented function error

Post by mozaffar »

i had a almost-every-where like-this problem! ( pyinstaller and python to get build for windows.) winetricks helps me! tnx alot!
another thing i must notice : the version inside debain(11 -bullseye) mirrors doesn't work properly for this! use the last version( now: 20250102).

tnx to you and winetricks friends!
Post Reply