I've got a c++ code of a kernel (just starting with it. So right now, it should just display "Hello, world!") with an array pointing to 0xB8000 (VGA color text mode and CGA-compatible graphics mode). When running it, it says "segmentation fault (core dumped)", which clearly means the display RAM is clearly not accessible by the user (note - I'm in ubuntu). Is there a simulator for running such sort of programs?
(My program is similar to this one -
https://www.codeproject.com/Articles/1225196/Create-Your-Own-Kernel-In-C-2
all except for that I've written everthing from my understanding, and it successfully compiles)
Related
I have a C++ program written together with QT5.3.2 + VTK 6.1. The program compiles fine and can run after deployment. Each function button also works fine.
The problem happens when I run this program for weeks (its a motion control software, so it needs to be on for a long time). Randomly(probably not random at all...) it quits/crashes without a frozen window. In another word, the program window just closes and no error message window appears.
I met the memory leak issue before, the program window first froze and the cursor kept busy status and unresponsive. But this time it just closes itself without any error message or unresponsiveness.. Could this also be a memory leak issue?
So I really appreciate it if someone can give me some hint or direction to troubleshoot this issue by their rich experience in programming.
Since there is a lot of code and I do not know where the problem comes from. I will not post code for now but I am happy to include some key aspects:
It uses ADS communication to communicate with hardware drives.
Callback function to fetch the monitoring data and display in QT interface, meaning a lot of actions like LineEdit->SetText() are used repeatedly. SetText() is called with a global qapplication pointer *tp->SetText().
VTK just displays the 3D data. And I separately tested there is no memory leak.
I am happy to share more information if needed.
Memory leak test.
I'm working on a c++/SFML paint program for my chromebook Acer R11 (running gallium linux) and would like to add multi-touch support. However I am stuck trying to find some way to get the input values into my c++ program.
The touchscreen works, full multi-touch works in chrome, non-touch applications treat it like a mouse.
SFML's sf::Touch methods don't give me anything, it appears they only work on android and ios.
I tried to get tslib to work, but it has zero setup instructions and I can't get the sample programs to compile and run.
I tried the c++ code in this thread How to get Coordinates of Touchscreen Rawdata using Linux but it stops at "You are not root! This may not work...\n", chrome gets touch events and its not root, so that's probably not the right direction.
I haven't had any success finding info about this online. What is the proper way to get touch events on a linux system?
More data:
The touchscreen shows up in evtest under /dev/input/event6: Elan Touchscreen
When I tell evtest to give me output it dumps realtime output correctly.
cat /proc/bus/input/devices shows it as
I: Bus=0018 Vendor=04f3 Product=002a Version=0000
N: Name="Elan Touchscreen"
P: Phys=
s: Sysfs=/devices/platform/80622C1:00/i2c-0/i2c-ELAN0001:00/input/input6
U: Uniq=
H: Handlers=mouse1 event6
B:PROP=2
B: EV=v
B: EKY=400 0 0 0 0 0
B: ABS=661800001000003
Well, when evtest really dumps everything correctly, you won't need tslib. In case you might need it anyways, there is more documentation now and I'd be happy to help you use it, when you create a Github issue there.
It seems more like a problem with correctly reading your system's input in your application though :)
I have produced a program that works perfectly fine on Linux Mint and now i have to make it work on a IBM computer running on linux red hat. For the libraries i have put them into modules (i had to recompile SFML for red hat) but when i start my program, it provokes a segfault, here is what valgrind told me about that failure :
Process terminating with default action of signal 11 (SIGSEGV)
==30230== Access not within mapped region at address 0xE0
==30230== at 0x55B5974: sf::priv::GlxContext::GlxContext(sf::priv::GlxContext*) (in /workfs/dev/libs/SFML-2-2.1/build/lib/libsfml-window.so.2.1)
Just before the segfault i have this strange error : xrandr cannot load extension for display.
This error still occurs when i try to start SFML examples
Here is the code which provokes the segfault :
//segfault ;
this->window = new sf::RenderWindow(sf::VideoMode(this->width, this->height), this->title,sf::Style::Close, settings);
It looks like SFML cant create an OpenGL content because xrandr is whining, does someone have an idea ? Could someone bring me light upon my problem :D ?
Well. that´s the question. Just that.
I got an app made with SDL and OpenGL. SDL opens an extra window (which is the console) additional to the graphical one. When i execute i´m getting a 3 output error, the console tells me. And it gets closed (the graphical one).
But i know this happens when a SIGSEGV signal is received (don´t know how to capture it) and it appears in my IDE (Code::blocks) while debugging. But this time nothing appears, and everything works all right. But when executing it crashes..
What the...
What kind of error can i expect?. Sometimes it gets closed, sometimes it doesn´t. How to know what kind of problem i got?.
SIGSEGV is a segmentation fault, you're trying to access memory that isn't accessible to your process.
Assuming you're on a UNIXy system, you should be able to get the program to core dump and then look at the core dump in a debugger; alternatively, use a memory debugger like Valgrind to pinpoint the memory management issue that's causing this problem.
I'm working on a computer vision program at the moment with OpenCV in C++. It seems to work 100% fine with a live feed from a webcam but when I tried to feed in a stream from an avi file it started crashing with an "Access Violation" error. I can't see why this would be the case because the only difference between the two is the initial frame-grabbing- the image processing is the same afterwards.
I'm developing in VS2008. The curious thing is that when I place a breakpoint in my main() and debug (F5) the program runs fine. However, when I Start Without Debugging (Ctrl+F5) I get the error.
Has anybody encountered a similar problem or would anyone know why my program would appear to work fine when debugging but not in normal execution?
I would suspect uninitialized variables. Many debuggers initialize all variables, including those that are not.
Nothing specific about OpenCV, but the fact that it behaves differently with a different source stream, and in or out of the debugger, makes me think it is a timing issue. You could try attachng the debugger after the crash happens maybe.