C-Api Call failed when loading image

Hi Community,

I am debugging a problem that I am faceing on a native Ubuntu 20.04.05 LTS machine but also on the same Ubuntu in WSL.

I was able to write a very minimalistic code sample that reproduces my problem:

#include <iostream>
#include <cvb/device_factory.hpp>
#include <cvb/utilities/system_info.hpp>
#include <cvb/driver/stream.hpp>
#include <iostream>
#include <cvb/device_factory.hpp>
#include <cvb/utilities/system_info.hpp>
#include <cvb/driver/stream.hpp>
#include <filesystem> // Make sure to have C++ > 14 selected in your compiler settings

using namespace std;
using namespace Cvb;

int main(int argc, char* argv[])
{
  std::cout <<"Trying to load image" << endl;
  Cvb::ImagePtr image = Cvb::Image::Load(Cvb::InstallPath() + CVB_LIT("tutorial/Clara.jpg"));
  cout << "Success!" << endl;
}


As a makefile you can use whatever CMakeFile from the tutorials. This is what I used.

cmake_minimum_required(VERSION 3.5)
project(CppStreamConsole)
set (CMAKE_CXX_STANDARD 14)

#find CVB
file(TO_CMAKE_PATH "$ENV{CVB}/cmake" CVB_MODULE_PATH)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CVB_MODULE_PATH}")
find_package(CVB REQUIRED)

set(SOURCES
  main.cpp
)

add_executable(${PROJECT_NAME} 
  ${SOURCES} ${HEADERS}
)

target_link_libraries(${PROJECT_NAME}
  CVB::CVCDriver
  CVB::CVCUtilities
)

if(UNIX)
  target_link_libraries(${PROJECT_NAME} pthread)
endif()

As you see, there is not much of functionality going on. However I get the following problem:

Failed to retrieve/decode the log configuration for module CoreDLO: Failed to connect to the shared memory with connection info: No such file or directory
terminate called after throwing an instance of ‘Cvb::V_1_6::CvbException’
what(): C-API call failed; try getting a log by using CVB LogGUI/silogutil: {“Name”: “LoadImageFile”, “CVC_ERROR_CODE”: 1}

Help would be highly appreciated

Hi @rtpeuqinu

I can not see the problem on Windows.
Bevore we start reproducing the error, you could try to load the image from a hardcoded path just to make sure, that you are actually on the correct file.
Also make sure to have the needed accessrights on the tutorials folder.

Cheers
Chris

1 Like

Hi @Chris

I also was not able to see this under windows.
I tried to go for the full path /opt/cvb/tutorial/Clara.jpg but this also fails.
I recursively changed the whole cvb folder to full access just to be sure.

Hi @rtpeuqinu

ok, I think I will need to get a WSL running here.
Ubu 20.4.5 LTS with CVB 14.0.1? If you are on an older CVB version please consider updating.

Also, one last idea: Could you try loading other images like Bracket.bmp from the tutorials folder and also from another location on your drive? I want to be sure, that it is not the image or the location that causes the error.

Cheers
Chris

1 Like

Hi @Chris

Yes, I am on CVB 14.0.1. This was one of the first steps when debugging the problem as I was on CVB 13 bevore.

I tried to load the Bracket.bmp and this worked fine.
Only the

“Failed to retrieve/decode the log configuration for module CoreDLO: Failed to connect to the shared memory with connection info: No such file or directory”

error did not dissappear but I was able to load the image.
With this information I tried a few of the other images and it looks like the problem is with the jpg images.
I cant load a single jpg but all the other images work.

I could switch to bmp for my input images but still it would be nice to know, what causes the error.

Thank you so far for your help.

Hi @rtpeuqinu

the message about the CoreDLO which seems to be missing is very likely due to the SIlLog service which is not running.

As the exception seems to be related to jpg images there is one more thing you could check.
Please try to install libjpeg:

sudo apt install libjpeg8

Usually this should be part of Ubuntu, so this might very likely end with a “requirement already staisfied” message. If not, we might be lucky.

Cheers
Chris

3 Likes

Hi @Chris

You were right… libjpeg was not installed on my system.
Maybe you want to do this with your install.sh script, as I saw this problen on a native system and on WSL so I might not be the only one with this problem.

Still, thank you for your help!