Forced logout crash with Qt & Opengl - c++

I can't find any documentation on this issue so I figured it was time for a question:
We are writing an application that uses Qt and Opengl with some help from a homebrew singleton class. We have had good luck with it so far but I've just recently run into an amusing situation where if I run the program on my Ubuntu machine it will force a logout.
We do nothing to the machine in terms of user modification. I have a feeling it has something to do with the way we are initializing things, possibly with our timer.
I was curious if anyone had any small insight they might be able to give. Is this a known issue within Qt or Ubuntu?
Note: I would give more information on the program but its very large and I only have a hint as to where to start.

Sounds like a driver or X11 bug that causes a server crash. By definition a client must not be able to crash the X server. However it seems you're experiencing exactly that. There's probably nothing wrong on your side.
What to do: Report the problem to the developers of Xorg and Mesa. Provide a test case, ideally in source code form (try to reduce your programm to the most minimal version that still causes the crash).

Related

Ethercat communication defect after building c++ program

For my work, I am currently working on a existing system (C++) that communicates with a beckhoff PLC. This PLC reads the current speed of the process and controls a light.
This program needs an update to work with the new thickness measurement. The code for this new measurements works, we tested it on another computer.
The problem is that the communication between the beckhoff and the computer is not working anymore. This problem starts when we rebuild (a part of) the program. To check what went wrong, we used wireshark to check the communication.
In the figure below, you can see the correct communication with the Beckhoff PLC (with Ethercat).
In this figure, you can see the communication after we build the new program.
Of course, we tested a lot of option to elimate this problem but at the moment we cannot think of any other method to get the communication back.
Things we tried:
Compile the old code to see if the communication still works. This doesn't work. Only the originale .exe file works.
Go a few version back to test the communication. This also doesn't work.
We check the hardware configuration and the mac adress of the Beckhoff PLC. This is all correct.
It would be great if someone knows a solution for this problem. Please, don't hesitate to ask question for more information about the problem.

How to get Twain DataSource file (*.ds) on Linux

My goal is make same code works on Win7_64 and Linux(Centos 7_64) for scanner(using TWAIN). I am coding on C++ Qt. My programm works fine on Win7_64, but when I tried to launch it on Linux; I found that DataSource Manager couldn't find DataSource. Therefore, I tried to figure out how to get that DataSource. I didn't find any useful information about it; I only know that on Linux DataSource looks like *.ds file, and my question is how to get it? I will appreciate any help.
Linux Twain drivers are mostly an abstract idea. If there are any out there, they're very few and come with expensive equipment. So, unfortunately, forget about Twain on Linux. You need to use Sane.
Of course you could insert a Twain adapter layer between Sane and your application. At least one such layer exists, but it's for OS X: Twain Sane. It shouldn't be terribly hard to adapt it for linux, the source is available.

cocos2d-x crashes during visit() calls

I have cocos2d-x app crashing time after time. Crash happens in random cases, even in idle state — I can leave app in simulator and after 2-5 minutes it may crash with no user interaction.
The sad thing — it crashed in production, too. I use Crittercism crash reporting SDK and it shows the same stack.
More, I tried cocos2d-x samples bundled with cocos SDK, they crash the same way.
Here I included some screenshots to show up the stacks:
https://dl.dropbox.com/u/5480488/cocos2dxcrash1.png
https://dl.dropbox.com/u/5480488/cocos2dxcrash2.png
+cocos2dxcrash3.png
And yes, it affects (almost?) all available versions of Cocos and iOS. Currently it crashes in latest cocos2d-x and iOS 6.1.3.
SOS, please!
I bet you are running your app on a simulator.
Running on a device will solve it. :P
Thought I don't know the exact reason. I have met the same problem before.

openGL screensaver causes problems

I have an application written in QT4, that uses an openGL window. It has been running happily for months. Windows XP, service Pack 3,
Recently I was diddling with my screensaver, and happened to select the 3D text choice. When I previewed it, the QT4 application seg-faulted immediately. When I ran in the debugger,it is crashing in ig4dev32.dll, which is an intel graphics accelerator driver for Open GL.
When I do a similar test on a machine with an NVIDIA card, I (not surprisingly) get no problems.
I'm not really sure whether I'm asking for help, or insight, or whatever--has anybody ever seen it? Google tells me others have seen it happen in gaming applications, but I see no references to developers having it happen to them. Obviously, I can not use that screensaver, but I suspect the problem is "bigger" than that. Ideas?
I would start by reporting this to Intel. No doubt, they will not resolve it by the end of the week, but eventually. In the mean time, I'd also report it to Qt software, so see if they can trouble shoot it as well.
In the mean time, you know the issue and how to resolve it (no OpenGL screensavers). So all you have to do is to inform your customers. The best would be if the application itself could inform the customers, but detecting if a screensaver uses OpenGL or not does not seem feasable.
Perhaps you could do some additional tests. For instance, what happens if your application is run in paralell with, say, Google Earth in OpenGL mode?

Remote programming and debugging

I have to program a C/C++ application. I have windows and linux (ubuntu 9.04) in my machine, and can program in both of them (via gcc/code blocks/vim,etc). The problem is that the executable is going to be run in a Unix (not linux) machine (will have access to it in about 20 days).
My Team Leader doesn´t want all of the code to be programmed in linux - unix. So, some of it will have to be developed in windows (and then many prayers will follow so that nothing bad happens).
The best thing i´ve come up with is to program remotely on the server, from windows and linux, so every programmer (only me for the next 2 weeks) is sort of happy.
In windows, I think i´m stuck with putty, but is there any alternative on linux, rather than ssh-vim? .
I read this Remote debugging with Eclipse CDT but it didn´t bring much light on the subject. At least not much hope.
There is another issue. I don´t consider C/C++ to be a portable language. At least for real programs. Sure it compiles, but many issues will arise, even with boost / stl. I haven´t taken a careful look to the code, but still, how wrong a I?
Any tips will be greatly appreciated.
Thanks in advance.
You could ssh w/ xming for a gui ide/editor that is on the remote machine.
If all the code is one the remote machine and compiled there, don't you have to worry about developers trying to work with the same resources? Also might the machine/network not be able to handle multiple ssh connections if you're using xming?
If you can convince your system administrator to install the libraries (an X server is not required), you can use X forwarding with SSH, which will allow you to execute X apps remotely and have them come up on your local server. If you're using Linux locally, you probably have X running already, and if you are using Windows, you can use the Xming server (with a little configuration to get it to accept remote connections). For debugging, if you need a separate shell, just set another instance of SSH going and perform debugging from another process.
As for portability, it depends on what you are trying to do. If all you want is a simple console-based application, you shouldn't run into any major portability concerns. If you are using more complex code, portability depends heavily on two things. The first is the choice of libraries - sure, you can run applications written for Win32 on Linux with Wine or actually compile them with Winelib, but it's not a pleasant experience. If you choose something more portable like Qt or gtkmm, you'll have a much easier time of things. Likewise for filesystem code - using a library like Boost.Filesystem will make things significantly simpler. The second thing that makes a big difference for portability is to follow the documentation. It's hard to stress this enough - many things that you do incorrectly will have varied results on different platforms, especially if you are using libraries that don't do checks (note: I highly recommend checking code against debug standard libraries for this reason). I once spent nearly a weak tracking down a portability bug that arose because someone didn't read the docs and was passing an invalid parameter.
If you want to use remote desktop like facility try VNC www.realvnc.com
or in case its just a remote login Hummingbird, EXceed could help
You might want to check the wingdb visual studio extension.
Not sure if this will help, but take a peek at sshfs. I haven't had a need to use it myself, but I have read others use it to access remote files and directories via ssh and work on the files locally. I presume you could access your remote home directory via sshfs and then use your local tools to work on the source files. I would very interested in knowing if this works out, so please post back if you give it a shot.
I use No Machine NX, which gives you the entire desktop of the remote machine. It also has a Windows client. I work remotely from home on Fridays, so I'm using it right now. You'll have to install it on the remote machine, and then install a client on your Windows or Linux machine.