Segmentation fault when using pointers - pointers

i have problems with pointers in C++.
Here is the code:
char* _Ptr="Hello World";
*_Ptr='Q';
printf("-> %c\n",*_Ptr);
During execution the programm crashed.
So i tried to debug the programm and when debugging the programm i received the following error:
Segmentation Fault

Related

esp8266 12E doesn't connect to internet

This is my first Arduino application, and I have programmed it and learned on it.
It runs and can create a blinking app, and even by entering through Serial.
But when I try to connect it to the internet, it gives
Fatal Exception 12
.
The board I am using is D1 Wemos (Retired). I am programming it using Arduino. I am currently running 1.6.8 version, but tried 1.6.5, and the same happens.
I tried to run the examples from esp8266 library... they as well don't run. sometimes I get
est Jan 8 2013 errors and then in the end wdt reset
but now, I get
warning: espcomm_sync failed error: espcomm_open failed error:
espcomm_upload_mem failed
I am not sure what is the issue? any body that has an idea?

[ERROR]: CallNamedPipe failed. Error=2 (Qt)

I get the following error every time I run my program in Qt-Creator
[ERROR]: CallNamedPipe failed. Error=2
Usually twice: once at startup and again at shutdown.
I found the error is related to QtCreator itself, as running the same compiled program from the console, it do not generate this message.
I also found it is probably related to some configuration or miss-configuration as the installation on my other machine do not produce this behavior.
Related to:
[ERROR]:CallNamedPipe failed. Error=2 (Qt)
Minimal snippet that produce this behavior:
Project:
QT += core
TARGET = test
TEMPLATE = app
SOURCES += main.cpp
Code:
#include <QDebug>
int main(int , char *[])
{
qDebug() << "Hellow world!";
return 0;
}
Is not that it is very annoying, as the software work correctly and the debugger more or less correctly. But that fill the log with those 2 lines again and again.
I tried to install a messageHandler (qInstallMessageHandler()) but the error is printed outside its scope.
Where this message come from? and more important: how to avoid it?
Additional info: I am on Windows (sad). I have the same behavior using G++ and MSVC2013

Arduino Robot Motor core accidentally overriden

Emmm..I am supposedly to plug the USB cord to the top port, but I accidentally plugged it to the bottom port. I'm really new (know nothing) on Arduino. I'm trying to upload Robot_Motor_Core from File/Example/Robot_Motor, but the program does not even compile. The error message is as follow:
/Applications/Arduino.app/Contents/Resources/Java/libraries/Robot_Motor/ArduinoRobotMotorBoard.cpp:
In member function 'void RobotMotorBoard::_refreshMotorAdjustment()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/Robot_Motor/ArduinoRobotMotorBoard.cpp:256:
error: 'TRIM' was not declared in this scope
Now I am just panicking because even the Robot_IR_Array_Test does not even compile as well. The error message is here:
Robot_IR_Array_Test.ino: In function 'void loop()':
Robot_IR_Array_Test:22: error: 'class RobotMotorBoard' has no member
named 'readIR'
Any advice???? How to set the Arduino robot back to default??
The help doc link is here: http://arduino.cc/en/Guide/Robot
The above problems appear to be with the IDE and not the robot. A brute force method of making a new directory with a fresh install or unzip of the IDE should fix the errors. And or a reboot or restart of Java.

QT : Exited with saying " During startup program exited with code 127"

I Had a Qt program which was working fine in Linux . We migrated our linux from 32bit to 64 bit and while trying to run the same program again throws me a error given below
"During Startup program exited with code 127"
In the Output window I also see the following:
&"warning: GDB: Failed to set controlling terminal: Invalid
argument\n" &"Cannor exec /bin/tcsh: No such file or directory.\n"
does anyone have any idea on this error??
A Thread in QtCentre has the same problem solved.
Look at here
Hope that helps...

Qt application crashing immediately without debugging info. How do I track down the problem?

I run an Qt app I've built:
./App
Segmentation fault
I run it with strace:
strace ./App
execve("./App", ["./App"], [/* 27 vars */]) = 0
--- SIGSEGV (Segmentation fault) # 0 (0) ---
+++ killed by SIGSEGV +++
Process 868 detached
Again, no useful info.
I run it with gdb:
(gdb) run
Starting program: /root/test/App
Reading symbols from shared object read from target memory...(no debugging symbols found)...done.
Loaded system supplied DSO at 0xffffe000
Program received signal SIGSEGV, Segmentation fault.
0x00000001 in ?? ()
Again, nothing.
I run it with valgrind:
==948== Process terminating with default action of signal 11 (SIGSEGV)
==948== Bad permissions for mapped region at address 0x0
==948== at 0x1: (within /root/test/App)
Even if I put in debugging symbols, it doesn't give any more useful info. ldd shows all libraries being linked properly.
Is there any other way I can find out what's wrong? I can't even do standard printf, cout, etc debugging. The executable doesn't even seem to start running at all.
I rebuilt with symbols, and tried the suggestion below
(gdb) break main
Breakpoint 1 at 0x45470
(gdb) run
Starting program: /root/test/App
Breakpoint 1 at 0x80045470
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xffffe000
Program received signal SIGSEGV, Segmentation fault.
0x00000001 in ?? ()
I checked for static initializers and I don't seem to have any.
Yep, I tried printf, cout, etc. It doesn't even make it into the main routine, so I'm looking for problems with static initializers in link libraries, adding them in one-by-one. I'm not getting any stack traces either.
Try running it through strace, it might give you at least some hints what happens before the program crashes. Also, does a backtrace in gdb not work?

Resources