Crashing when updating acados

Hi,
i have updated matlab and reinstalled acados.

All the script that previosly works now make crashing matlab and also before crashing i have this error that previously doesn’t appears:

Error using casadi.Function (line 5595)
Error in Function::Function for ‘a_lat’ [MXFunction] at …/casadi/core/function.cpp:280:
…/casadi/core/function_internal.cpp:147: Error calling MXFunction::init for ‘a_lat’:
…/casadi/core/mx_function.cpp:413: a_lat::init: Initialization failed since variables [c7, c8, c9, c10, c11, c12, c13, c14, c15] are
free. These symbols occur in the output expressions but you forgot to declare these as inputs. Set option ‘allow_free’ to allow free
variables.

Waiting for your reply

This are the log crash:

MATLAB Log File: C:\Users\tredi\AppData\Local\Temp\matlab_crash_dump.28536-1


MATLAB Log File


         Access violation detected at 2024-12-19 11:03:19 +0100

Configuration:
Crash Decoding : Disabled - No sandbox or build area path
Crash Mode : continue (default)
Default Encoding : UTF-8
Deployed : false
Graphics Driver : Uninitialized hardware
Graphics card 1 : NVIDIA ( 0x10de ) NVIDIA GeForce RTX 3050 Laptop GPU Version 32.0.15.6614 (2024-11-6)
Graphics card 2 : Advanced Micro Devices, Inc. ( 0x1002 ) AMD Radeon™ Graphics Version 31.0.12044.3 (2022-10-25)
Java Version : Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot™ 64-Bit Server VM mixed mode
MATLAB Architecture : win64
MATLAB Entitlement ID : 1849657
MATLAB Root : C:\Program Files\MATLAB\R2024b
MATLAB Version : 24.2.0.2806996 (R2024b) Update 3
OpenGL : hardware
Operating System : Microsoft Windows 11 Home
Process ID : 28536
Processor ID : x86 Family 25 Model 80 Stepping 0, AuthenticAMD
Session Key : fc234273-fe9d-49d2-924f-e571bcaa7e62
Window System : Version 10.0 (Build 22631)

Fault Count: 1

Abnormal termination:
Access violation

Current Thread: ‘MCR 0 interpreter thread’ id 13840

Register State (from fault):
RAX = 0000021b3aac9948 RBX = 0000000000000000
RCX = 90003400c9e6a15d RDX = 0000021b3cd77430
RSP = 0000005e4b4f78b0 RBP = 0000021b514bff10
RSI = 00000000000000f0 RDI = 0000021b3cd773a0

R8 = 00007ffce433cf30 R9 = 0000005e4b4f7878
R10 = 000000000000001c R11 = 00000000000001f0
R12 = 0000000000000010 R13 = 0000021b3aacfde8
R14 = 0000021b3aac9858 R15 = 0000021b285dd068

RIP = 00000000008932c0 EFL = 00010246

CS = 0033 FS = 0053 GS = 002b

Stack Trace (from fault):
[ 0] 0x00000000008932c0 C:\Users\tredi\acados\examples\acados_matlab_octave\autonomous_cars_rc\c_generated_code\acados_ocp_solver_Dynamicbicycle_model_abs.dll+00078528 Dynamicbicycle_model_abs_acados_get_nlp_plan+00014816
[ 1] 0x00000000008d5cae C:\Users\tredi\acados\examples\acados_matlab_octave\autonomous_cars_rc\c_generated_code\acados_ocp_solver_Dynamicbicycle_model_abs.dll+00351406 ocp_nlp_set+00141534
[ 2] 0x0000000069a84b94 C:\Users\tredi\acados\examples\acados_matlab_octave\autonomous_cars_rc\build\ocp_get.mexw64+00019348 ocp_nlp_get+00000036
[ 3] 0x0000000069a8223b C:\Users\tredi\acados\examples\acados_matlab_octave\autonomous_cars_rc\build\ocp_get.mexw64+00008763 mexFunction+00003723
[ 4] 0x00007ffcbf6c6149 C:\Program Files\MATLAB\R2024b\bin\win64\libmex.dll+00680265 mexfile::Inspector::needs_upgrade+00023801
[ 5] 0x00007ffcbf6c9152 C:\Program Files\MATLAB\R2024b\bin\win64\libmex.dll+00692562 MexRetrieveVersion+00009074
[ 6] 0x00007ffcbf6c92c7 C:\Program Files\MATLAB\R2024b\bin\win64\libmex.dll+00692935 MexRetrieveVersion+00009447
[ 7] 0x00007ffcbf6c94b8 C:\Program Files\MATLAB\R2024b\bin\win64\libmex.dll+00693432 MexRetrieveVersion+00009944
[ 8] 0x00007ffcbf6ab6b8 C:\Program Files\MATLAB\R2024b\bin\win64\libmex.dll+00571064 mexUnlock+00018024
[ 9] 0x00007ffcbf332a48 C:\Program Files\MATLAB\R2024b\bin\win64\m_dispatcher.dll+01190472 Mfh_file::dispatch_file_common+00000152
[ 10] 0x00007ffcbf331909 C:\Program Files\MATLAB\R2024b\bin\win64\m_dispatcher.dll+01186057 Mfh_error::lookup+00012425
[ 11] 0x00007ffcbf33299d C:\Program Files\MATLAB\R2024b\bin\win64\m_dispatcher.dll+01190301 Mfh_file::dispatch+00000045
[ 12] 0x00007ffcbed9753d C:\Program Files\MATLAB\R2024b\bin\win64\libmwlxemainservices.dll+00423229 coretypes::array::Array<MathWorks::String::detail::StringArrayVariant,MathWorks::String::detail::StringArrayPolicy,coretypes::array::ArrayTypeListMathWorks::String::detail::StringArrayVariant >::resize+00351613
[ 13] 0x00007ffcbeda639e C:\Program Files\MATLAB\R2024b\bin\win64\libmwlxemainservices.dll+00484254 coretypes::array::Array<MathWorks::String::detail::StringArrayVariant,MathWorks::String::detail::StringArrayPolicy,coretypes::array::ArrayTypeListMathWorks::String::detail::StringArrayVariant >::resize+00412638
[ 14] 0x00007ffcbb730fe6 C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+06361062 MathWorks::lxe::ReadOnlyXvaluePtr::operator=+00006966
[ 15] 0x00007ffcbb732e2b C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+06368811 MathWorks::lxe::ReadOnlyXvaluePtr::operator=+00014715
[ 16] 0x00007ffcbb65e7e8 C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+05498856 MathWorks::lxe::XvalueFactory::XvalueDeleter::XvalueDeleter+00225192
[ 17] 0x00007ffcbb67dbc9 C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+05626825 MathWorks::lxe::XvalueFactory::XvalueDeleter::XvalueDeleter+00353161
[ 18] 0x00007ffcbb415f76 C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+03104630 MathWorks::lxe::LXEConstants::IsIfElse+00547062
[ 19] 0x00007ffcbb41a162 C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+03121506 MathWorks::lxe::LXEConstants::IsY+00012018
[ 20] 0x00007ffcbb417983 C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+03111299 MathWorks::lxe::LXEConstants::IsY+00001811
[ 21] 0x00007ffcbb41b265 C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+03125861 MathWorks::lxe::LXEConstants::IsY+00016373
[ 22] 0x00007ffcbb41b513 C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+03126547 MathWorks::lxe::LXEConstants::IsY+00017059
[ 23] 0x00007ffcbb41ae7e C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+03124862 MathWorks::lxe::LXEConstants::IsY+00015374
[ 24] 0x00007ffcbb4170c6 C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+03109062 MathWorks::lxe::LxeTypes::GetTypeXvalueOf+00000262
[ 25] 0x00007ffcbb513e67 C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+04144743 MathWorks::lxe::SetEngineImplUnlinkFlagForAllCallsOnStack+00049303
[ 26] 0x00007ffcbb5179e5 C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+04159973 MathWorks::lxe::SetEngineImplUnlinkFlagForAllCallsOnStack+00064533
[ 27] 0x00007ffcbee99816 C:\Program Files\MATLAB\R2024b\bin\win64\libmwlxemainservices.dll+01480726 FeatureTestObservableWorkspace+00212358
[ 28] 0x00007ffcbed8f783 C:\Program Files\MATLAB\R2024b\bin\win64\libmwlxemainservices.dll+00391043 coretypes::array::Array<MathWorks::String::detail::StringArrayVariant,MathWorks::String::detail::StringArrayPolicy,coretypes::array::ArrayTypeListMathWorks::String::detail::StringArrayVariant >::resize+00319427
[ 29] 0x00007ffcbed8edd3 C:\Program Files\MATLAB\R2024b\bin\win64\libmwlxemainservices.dll+00388563 coretypes::array::Array<MathWorks::String::detail::StringArrayVariant,MathWorks::String::detail::StringArrayPolicy,coretypes::array::ArrayTypeListMathWorks::String::detail::StringArrayVariant >::resize+00316947
[ 30] 0x00007ffcbed919e2 C:\Program Files\MATLAB\R2024b\bin\win64\libmwlxemainservices.dll+00399842 coretypes::array::Array<MathWorks::String::detail::StringArrayVariant,MathWorks::String::detail::StringArrayPolicy,coretypes::array::ArrayTypeListMathWorks::String::detail::StringArrayVariant >::resize+00328226
[ 31] 0x00007ffcbf332a48 C:\Program Files\MATLAB\R2024b\bin\win64\m_dispatcher.dll+01190472 Mfh_file::dispatch_file_common+00000152
[ 32] 0x00007ffcbf331909 C:\Program Files\MATLAB\R2024b\bin\win64\m_dispatcher.dll+01186057 Mfh_error::lookup+00012425
[ 33] 0x00007ffcbf33299d C:\Program Files\MATLAB\R2024b\bin\win64\m_dispatcher.dll+01190301 Mfh_file::dispatch+00000045
[ 34] 0x00007ffcbed9753d C:\Program Files\MATLAB\R2024b\bin\win64\libmwlxemainservices.dll+00423229 coretypes::array::Array<MathWorks::String::detail::StringArrayVariant,MathWorks::String::detail::StringArrayPolicy,coretypes::array::ArrayTypeListMathWorks::String::detail::StringArrayVariant >::resize+00351613
[ 35] 0x00007ffcbeda639e C:\Program Files\MATLAB\R2024b\bin\win64\libmwlxemainservices.dll+00484254 coretypes::array::Array<MathWorks::String::detail::StringArrayVariant,MathWorks::String::detail::StringArrayPolicy,coretypes::array::ArrayTypeListMathWorks::String::detail::StringArrayVariant >::resize+00412638
[ 36] 0x00007ffcbb730fe6 C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+06361062 MathWorks::lxe::ReadOnlyXvaluePtr::operator=+00006966
[ 37] 0x00007ffcbb732675 C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+06366837 MathWorks::lxe::ReadOnlyXvaluePtr::operator=+00012741
[ 38] 0x00007ffcbb65e7e8 C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+05498856 MathWorks::lxe::XvalueFactory::XvalueDeleter::XvalueDeleter+00225192
[ 39] 0x00007ffcbb67d7b9 C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+05625785 MathWorks::lxe::XvalueFactory::XvalueDeleter::XvalueDeleter+00352121
[ 40] 0x00007ffcbb415f76 C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+03104630 MathWorks::lxe::LXEConstants::IsIfElse+00547062
[ 41] 0x00007ffcbb41a162 C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+03121506 MathWorks::lxe::LXEConstants::IsY+00012018
[ 42] 0x00007ffcbb417983 C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+03111299 MathWorks::lxe::LXEConstants::IsY+00001811
[ 43] 0x00007ffcbb41b265 C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+03125861 MathWorks::lxe::LXEConstants::IsY+00016373
[ 44] 0x00007ffcbb41b513 C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+03126547 MathWorks::lxe::LXEConstants::IsY+00017059
[ 45] 0x00007ffcbb41ae7e C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+03124862 MathWorks::lxe::LXEConstants::IsY+00015374
[ 46] 0x00007ffcbb4170c6 C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+03109062 MathWorks::lxe::LxeTypes::GetTypeXvalueOf+00000262
[ 47] 0x00007ffcbb513e67 C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+04144743 MathWorks::lxe::SetEngineImplUnlinkFlagForAllCallsOnStack+00049303
[ 48] 0x00007ffcbb5179e5 C:\Program Files\MATLAB\R2024b\bin\win64\m_lxe.dll+04159973 MathWorks::lxe::SetEngineImplUnlinkFlagForAllCallsOnStack+00064533
[ 49] 0x00007ffcbee99816 C:\Program Files\MATLAB\R2024b\bin\win64\libmwlxemainservices.dll+01480726 FeatureTestObservableWorkspace+00212358
[ 50] 0x00007ffcbeddb0f6 C:\Program Files\MATLAB\R2024b\bin\win64\libmwlxemainservices.dll+00700662 mwboost::archive::detail::pointer_oserializermwboost::archive::xml_oarchive,MathWorks::lxe::PreLineExecutionEvent::save_object_ptr+00074918
[ 51] 0x00007ffcbeddcbf4 C:\Program Files\MATLAB\R2024b\bin\win64\libmwlxemainservices.dll+00707572 mwboost::archive::detail::pointer_oserializermwboost::archive::xml_oarchive,MathWorks::lxe::PreLineExecutionEvent::save_object_ptr+00081828
[ 52] 0x00007ffcbee5cb77 C:\Program Files\MATLAB\R2024b\bin\win64\libmwlxemainservices.dll+01231735 mwboost::archive::detail::oserializermwboost::archive::text_oarchive,MathWorks::MatlabComponents::ComponentIdentifier::save_object_data+00327655
[ 53] 0x00007ffcbee5e977 C:\Program Files\MATLAB\R2024b\bin\win64\libmwlxemainservices.dll+01239415 mwboost::archive::detail::oserializermwboost::archive::text_oarchive,MathWorks::MatlabComponents::ComponentIdentifier::save_object_data+00335335
[ 54] 0x00007ffcbee5dc60 C:\Program Files\MATLAB\R2024b\bin\win64\libmwlxemainservices.dll+01236064 mwboost::archive::detail::oserializermwboost::archive::text_oarchive,MathWorks::MatlabComponents::ComponentIdentifier::save_object_data+00331984
[ 55] 0x00007ffcbf799ca9 C:\Program Files\MATLAB\R2024b\bin\win64\libmwbridge.dll+00302249 mnGetPrompt+00013993
[ 56] 0x00007ffcbf9fb676 C:\Program Files\MATLAB\R2024b\bin\win64\iqm.dll+00505462 iqm::Iqm::instance+00002358
[ 57] 0x00007ffcbfa54ed2 C:\Program Files\MATLAB\R2024b\bin\win64\iqm.dll+00872146 iqm::UserEvalPlugin::execute+00001314
[ 58] 0x00007ffcbfa2229f C:\Program Files\MATLAB\R2024b\bin\win64\iqm.dll+00664223 iqm::Iqm::setupIqmFcnPtrs+00110911
[ 59] 0x00007ffcbfa2e32d C:\Program Files\MATLAB\R2024b\bin\win64\iqm.dll+00713517 iqm::Iqm::setupIqmFcnPtrs+00160205
[ 60] 0x00007ffcbf9eea0f C:\Program Files\MATLAB\R2024b\bin\win64\iqm.dll+00453135 iqm::Iqm::create+00010543
[ 61] 0x00007ffcbf769546 C:\Program Files\MATLAB\R2024b\bin\win64\libmwbridge.dll+00103750 ioReadLine+00000406
[ 62] 0x00007ffcbf769375 C:\Program Files\MATLAB\R2024b\bin\win64\libmwbridge.dll+00103285 ioReadLine+00000165
[ 63] 0x00007ffcbf79a070 C:\Program Files\MATLAB\R2024b\bin\win64\libmwbridge.dll+00303216 mnGetCommandLineBuffer+00000288
[ 64] 0x00007ffcbf79a517 C:\Program Files\MATLAB\R2024b\bin\win64\libmwbridge.dll+00304407 mnParser+00000487
[ 65] 0x00007ffcbf86d19f C:\Program Files\MATLAB\R2024b\bin\win64\mcr.dll+00446879 mcr_initialize_main+00016975
[ 66] 0x00007ffcbf8191de C:\Program Files\MATLAB\R2024b\bin\win64\mcr.dll+00102878 mcrFunctionSignature::set_signature+00080062
[ 67] 0x00007ffcbf8363c2 C:\Program Files\MATLAB\R2024b\bin\win64\mcr.dll+00222146 mwboost::archive::codecvt_null<wchar_t>::`default constructor closure’+00017266
[ 68] 0x00007ffcbfa4fe2a C:\Program Files\MATLAB\R2024b\bin\win64\iqm.dll+00851498 iqm::PackagedTaskPlugin::execute+00000074
[ 69] 0x00007ffcbfa2229f C:\Program Files\MATLAB\R2024b\bin\win64\iqm.dll+00664223 iqm::Iqm::setupIqmFcnPtrs+00110911
[ 70] 0x00007ffcbf9ef32a C:\Program Files\MATLAB\R2024b\bin\win64\iqm.dll+00455466 iqm::Iqm::create+00012874
[ 71] 0x00007ffcbf9ef811 C:\Program Files\MATLAB\R2024b\bin\win64\iqm.dll+00456721 iqm::Iqm::create+00014129
[ 72] 0x00007ffcbf9eec9d C:\Program Files\MATLAB\R2024b\bin\win64\iqm.dll+00453789 iqm::Iqm::create+00011197
[ 73] 0x00007ffcbf851b7c C:\Program Files\MATLAB\R2024b\bin\win64\mcr.dll+00334716 mcrInstantiationError::operator=+00010652
[ 74] 0x00007ffcbf85263f C:\Program Files\MATLAB\R2024b\bin\win64\mcr.dll+00337471 mcrInstantiationError::operator=+00013407
[ 75] 0x00007ffcbf84fc41 C:\Program Files\MATLAB\R2024b\bin\win64\mcr.dll+00326721 mcrInstantiationError::operator=+00002657
[ 76] 0x00007ffdac498fba C:\Program Files\MATLAB\R2024b\bin\win64\mwboost_thread-vc143-mt-x64-1_81.dll+00036794 mwboost::detail::win32::handle_manager::swap+00000650
[ 77] 0x00007ffdbf9f9333 C:\WINDOWS\System32\ucrtbase.dll+00168755 recalloc+00000163
[ 78] 0x00007ffdc13b259d C:\WINDOWS\System32\KERNEL32.DLL+00075165 BaseThreadInitThunk+00000029
[ 79] 0x00007ffdc1f6af38 C:\WINDOWS\SYSTEM32\ntdll.dll+00372536 RtlUserThreadStart+00000040

This error was detected while a MEX-file was running. If the MEX-file
is not an official MathWorks function, please examine its source code
for errors. Please consult the External Interfaces Guide for information
on debugging MEX-files.

Hi Casto,

the first error is due to an update of CasADi which no longer allows free variables, cf. v3.6.7.

You need to check all your CasADi expressions and make sure that all CasADi symbols which are used by the expressions are later on also declared as inputs. A typical problem might be a terminal cost/constraint which depends on u or z.

Best, Katrin

I declare them as a parameter in order that durng the simulation it could change, so at the start i fed them an initial set of parameters and then during the simulation they could be updated.
What i need to do to solve this problem, and what about the other because now a script that previously works now crash?

You need to make sure that whenever a CasADi expression uses [c7, c8, c9, c10, c11, c12, c13, c14, c15] then these values also need to be declared as inputs to the CasADi function that you create from this expression.

Regarding the second problem, it would be helpful to know which acados version you were using before and which version you are using now.

I was running the version that i have downladed around april/may of this year, now i have the latest ones.
This is what i obtain from matlab:
Warning: acados_ocp will be deprecated in the future. Use AcadosOcpSolver instead. For more information on the major acados Matlab
interface overhaul, see Release v0.4.0 · acados/acados · GitHub

In acados_ocp (line 33)
In main (line 218)
Warning: cost_type_0 not set, using path cost
In AcadosOcp/detect_cost_and_constraints (line 820)
In AcadosOcp/make_consistent (line 107)
In AcadosOcpSolver (line 51)
In acados_ocp (line 41)
In main (line 218)
found compiled acados MEX interface
Successfully rendered acados templates!
compiling acados_mex_create_Dynamicbicycle_model_abs.c
Building with ‘MinGW64 Compiler (C)’.
MEX completed successfully.
compiling acados_mex_free_Dynamicbicycle_model_abs.c
Building with ‘MinGW64 Compiler (C)’.
MEX completed successfully.
compiling acados_mex_solve_Dynamicbicycle_model_abs.c
Building with ‘MinGW64 Compiler (C)’.
MEX completed successfully.
compiling acados_mex_set_Dynamicbicycle_model_abs.c
Building with ‘MinGW64 Compiler (C)’.
MEX completed successfully.
compiling acados_mex_reset_Dynamicbicycle_model_abs.c
Building with ‘MinGW64 Compiler (C)’.
MEX completed successfully.
Dynamicbicycle_model_abs_acados_create() → success!

And then it crashes.

For the first problem, thanks to your suggestion now it doesn’t give me the error but now crashes as i think due to the second problem.

Please checkout the individual acados versions and check when your scripts are failing for the first time.

Even better, use git bisect to find the particular commit.

What i obtain wiht git bisect is:
76b7df6169eaa8f41630edca10c3ebd6da07ab14 is the first bad commit
commit 76b7df6169eaa8f41630edca10c3ebd6da07ab14
Author: Jonathan Frey jonathanpaulfrey@gmail.com
Date: Mon Feb 12 15:14:48 2024 +0100

fix Matlab with MSVC (#1036)

https://discourse.acados.org/t/bug-with-visual-studio-compiler-in-matlab-with-working-fix/1449

interfaces/acados_matlab_octave/acados_ocp.m | 2 ±
…/+acados_template_mex/compile_ocp_shared_lib.m | 20 +++++++++++++++++±-
…/+acados_template_mex/compile_sim_shared_lib.m | 20 +++++++++++++++++±-
…/c_templates_tera/CMakeLists.in.txt | 7 +++++++
4 files changed, 44 insertions(+), 5 deletions(-)

I do not know if i am using it properly so i share also what i have typed:
C:\Users\tredi>cd acados

C:\Users\tredi\acados>git bisect start
status: waiting for both good and bad commits

C:\Users\tredi\acados>git bisect bad v0.4.3
status: waiting for good commit(s), bad commit known

C:\Users\tredi\acados>git bisect good v0.3.0
Bisecting: 146 revisions left to test after this (roughly 7 steps)
[6c0f9e85039df97a7bd44abf17a1e6f4f221d046] Python: rename AcadosSimOpts → AcadosSimOptions (#1222)

C:\Users\tredi\acados>git bisect bad
Bisecting: 73 revisions left to test after this (roughly 6 steps)
[b862293d7646e257273144f3251b0c5f54720fd8] MATLAB interface - control rates example (#1126)

C:\Users\tredi\acados>git bisect bad
Bisecting: 36 revisions left to test after this (roughly 5 steps)
[25225aaa2c35f090cb449c82cc9a01a5683eba70] Fix acados cmake config (#1081)

C:\Users\tredi\acados>git bisect bad
Bisecting: 17 revisions left to test after this (roughly 4 steps)
[370af36e281f317b93bd4b03a8e47263fdfa87f0] Mex: Add support for soft nonlinear constraints at initial shooting node (#1059)

C:\Users\tredi\acados>git bisect bad
Bisecting: 8 revisions left to test after this (roughly 3 steps)
[4cfab342188b3fe80f83d041f008c07f83b882ac] Minor C changes (#1045)

C:\Users\tredi\acados>git bisect bad
Bisecting: 4 revisions left to test after this (roughly 2 steps)
[37e17d31890ab54e5a855f1fe787fbf2f5d43bdb] Work on core for speedups (#888)

C:\Users\tredi\acados>git bisect bad
Bisecting: 1 revision left to test after this (roughly 1 step)
[e84fa19cb12db0996dc29cb039121dc70e93a039] Support slack penalties for initial stage in MEX interface (#1037)

C:\Users\tredi\acados>git bisect bad
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[76b7df6169eaa8f41630edca10c3ebd6da07ab14] fix Matlab with MSVC (#1036)

C:\Users\tredi\acados>git bisect bad

When running matlab at every steps, i have the same error:
compiling C:\Users\tredi\acados\examples\acados_matlab_octave....\interfaces\acados_matlab_octave\ocp_get_cost.c
Building with ‘MinGW64 Compiler (C)’.
Error using mex
C:\Users\tredi\acados\interfaces\acados_matlab_octave\ocp_get_cost.c: In function ‘mexFunction’:
C:\Users\tredi\acados\interfaces\acados_matlab_octave\ocp_get_cost.c:63:17: warning: passing argument 1 of ‘ocp_nlp_get’ from
incompatible pointer type [-Wincompatible-pointer-types]
ocp_nlp_get(config, solver, “cost_value”, out_data);
^~~~~~
In file included from C:\Users\tredi\acados\interfaces\acados_matlab_octave\ocp_get_cost.c:36:
C:/Users/tredi/acados/include/acados_c/ocp_nlp_interface.h:440:55: note: expected ‘ocp_nlp_solver *’ {aka ‘struct ocp_nlp_solver *’}
but argument is of type ‘ocp_nlp_config *’ {aka ‘struct ocp_nlp_config *’}
ACADOS_SYMBOL_EXPORT void ocp_nlp_get(ocp_nlp_solver *solver, const char *field, void *return_value_);
^~
C:\Users\tredi\acados\interfaces\acados_matlab_octave\ocp_get_cost.c:63:25: warning: passing argument 2 of ‘ocp_nlp_get’ from
incompatible pointer type [-Wincompatible-pointer-types]
ocp_nlp_get(config, solver, “cost_value”, out_data);
^
~
In file included from C:\Users\tredi\acados\interfaces\acados_matlab_octave\ocp_get_cost.c:36:
C:/Users/tredi/acados/include/acados_c/ocp_nlp_interface.h:440:75: note: expected ‘const char *’ but argument is of type
‘ocp_nlp_solver *’ {aka ‘struct ocp_nlp_solver *’}
ACADOS_SYMBOL_EXPORT void ocp_nlp_get(ocp_nlp_solver *solver, const char *field, void *return_value_);
^
C:\Users\tredi\acados\interfaces\acados_matlab_octave\ocp_get_cost.c:63:5: error: too many arguments to function ‘ocp_nlp_get’
ocp_nlp_get(config, solver, “cost_value”, out_data);
^

In file included from C:\Users\tredi\acados\interfaces\acados_matlab_octave\ocp_get_cost.c:36:
C:/Users/tredi/acados/include/acados_c/ocp_nlp_interface.h:440:27: note: declared here
ACADOS_SYMBOL_EXPORT void ocp_nlp_get(ocp_nlp_solver *solver, const char *field, void *return_value_);
^
~~~~

Error in ocp_compile_interface (line 141)
mex(mex_flags, FLAGS, LDFLAGS, COMPDEFINES, COMPFLAGS, acados_include, acados_interfaces_include, external_include, blasfeo_include, hpipm_include,…
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in acados_ocp (line 184)
ocp_compile_interface(obj.opts_struct);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in main (line 218)
ocp = acados_ocp(ocp_model, ocp_opts);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I “solved” the problem by deleting not only the c_genereted code folder inside the folder where i run the script but also the build folder before running it and now it works fine.
I should have tried this way from the beginning, sorry for the inconvenience.