Gdb error 193

This is shown when I try to debug my code with Eclipse: I then tried creating a simple Hello World program manually with Notepad++ and the command-line gcc. When I launched the gdb debugger this

This is shown when I try to debug my code with Eclipse:

alt text

I then tried creating a simple Hello World program manually with Notepad++ and the command-line gcc. When I launched the gdb debugger this happened:

(gdb) run

Starting program:
C:Documents and
SettingsPieterBureaublad/test.exe
Error creating process C:Documents
and
SettingsPieterBureaublad/test.exe,
(error 193).

The binary runs fine, but as soon as I try to debug it error 193 is returned. I’m working with C code that is processed by the MinGW GCC compiler. I tried reinstalling both the compiler and the debugger (latest versions) but that didn’t change anything. It has worked in the past, and I do not remember making any changes to settings related to the compiler.

Here’s an example of an error log as it was generated by Eclipse.

!ENTRY org.eclipse.cdt.dsf.gdb 4 5012
2010-02-09 18:19:47.375 !MESSAGE Error
in final launch sequence !STACK 1
org.eclipse.core.runtime.CoreException:
Failed to execute MI command:
-exec-run Error message from debugger back end: Error creating process
C:/Documents and Settings/Pieter/Mijn
documenten/My
Dropbox/Unief/C/H12/Opdr07/Debug/CH12O07.exe,
(error 193). at
org.eclipse.cdt.dsf.concurrent.Sequence.abortExecution(Sequence.java:560)
at
org.eclipse.cdt.dsf.concurrent.Sequence.access$4(Sequence.java:552)
at
org.eclipse.cdt.dsf.concurrent.Sequence$2.handleErrorOrWarning(Sequence.java:424)
at
org.eclipse.cdt.dsf.concurrent.RequestMonitor.handleFailure(RequestMonitor.java:314)
at
org.eclipse.cdt.dsf.concurrent.RequestMonitor.handleCompleted(RequestMonitor.java:277)
at
org.eclipse.cdt.dsf.concurrent.RequestMonitor$2.run(RequestMonitor.java:239)
at
java.util.concurrent.Executors$RunnableAdapter.call(Unknown
Source) at
java.util.concurrent.FutureTask$Sync.innerRun(Unknown
Source) at
java.util.concurrent.FutureTask.run(Unknown
Source) at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown
Source) at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown
Source) at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source) at
java.lang.Thread.run(Unknown Source)
!SUBENTRY 1 org.eclipse.cdt.dsf.gdb 4
10004 2010-02-09 18:19:47.546 !MESSAGE
Failed to execute MI command:
-exec-run Error message from debugger back end: Error creating process
C:/Documents and Settings/Pieter/Mijn
documenten/My
Dropbox/Unief/C/H12/Opdr07/Debug/CH12O07.exe,
(error 193).

Glorfindel's user avatar

Glorfindel

21.5k13 gold badges78 silver badges105 bronze badges

asked Feb 9, 2010 at 13:15

Pieter's user avatar

3

Could it be that either you are using an older version of gdb, that doesn’t support native MinGW debugging (unlikely since you said you updated to the latest version), or you are invoking the debugger incorrectly? In other words, if your executable is named helloworld.exe, gdb helloworld may give you that error, whereas gdb helloworld.exe may work.

Edit: further googling says that trying a directory name without spaces might work (the solution is for Code::Blocks, but it doesn’t hurt to try).

answered Feb 16, 2010 at 11:02

Alok Singhal's user avatar

Alok SinghalAlok Singhal

91.3k20 gold badges125 silver badges157 bronze badges

13

Google tells me that «Error 193» is a Windows error code that means an executable is not, in fact, executable. Looks like there’s something wrong with your EXE — can you start it directly?

answered Feb 9, 2010 at 13:37

Michael Borgwardt's user avatar

Michael BorgwardtMichael Borgwardt

340k77 gold badges477 silver badges713 bronze badges

5

your shared library setting got turned on (probably because you switched your project from an executable to a shared library, then back) and gcc is still being called with the ‘-shared’ options, but the output file has the .exe extension. There is a checkbox called ‘shared’ in

Properties => C/C++ Build => Settings => Tool Settings => MinGW C Linker => Shared Library Settings.   

Make sure it’s not checked. I had also error 193 until I flipped this off.

Matt Busche's user avatar

Matt Busche

14.1k5 gold badges36 silver badges61 bronze badges

answered Mar 2, 2013 at 22:16

ohsaycanyouc's user avatar

This thread does mention:

  • Error 193 is ERROR_BAD_EXE_FORMAT
  • this can be an issue with your cygwin installation.

Note (as an example of «problem with cygwin installation): there was a bug with gdb if installed in a cygwin referenced with a path including a space in it (see this thread)

What version of gdb are you using when you reproduce the issue outside of Eclipse CDT?

answered Feb 12, 2010 at 7:36

VonC's user avatar

VonCVonC

1.2m508 gold badges4248 silver badges5069 bronze badges

11

You said:

(gdb) run

Starting program: C:Documents and
SettingsPieterBureaublad/test.exe
Error creating process C:Documents
and
SettingsPieterBureaublad/test.exe,
(error 193).

Might it have anything to do with the forward/reverse slash at the end of the executable path? Perhaps the part Bureaublad/test.exe is here intended as a single executable, and it can’t be found?

answered Feb 18, 2010 at 9:03

lorenzog's user avatar

lorenzoglorenzog

3,4634 gold badges29 silver badges49 bronze badges

1

This is shown when I try to debug my code with Eclipse:

alt text

I then tried creating a simple Hello World program manually with Notepad++ and the command-line gcc. When I launched the gdb debugger this happened:

(gdb) run

Starting program:
C:Documents and
SettingsPieterBureaublad/test.exe
Error creating process C:Documents
and
SettingsPieterBureaublad/test.exe,
(error 193).

The binary runs fine, but as soon as I try to debug it error 193 is returned. I’m working with C code that is processed by the MinGW GCC compiler. I tried reinstalling both the compiler and the debugger (latest versions) but that didn’t change anything. It has worked in the past, and I do not remember making any changes to settings related to the compiler.

Here’s an example of an error log as it was generated by Eclipse.

!ENTRY org.eclipse.cdt.dsf.gdb 4 5012
2010-02-09 18:19:47.375 !MESSAGE Error
in final launch sequence !STACK 1
org.eclipse.core.runtime.CoreException:
Failed to execute MI command:
-exec-run Error message from debugger back end: Error creating process
C:/Documents and Settings/Pieter/Mijn
documenten/My
Dropbox/Unief/C/H12/Opdr07/Debug/CH12O07.exe,
(error 193). at
org.eclipse.cdt.dsf.concurrent.Sequence.abortExecution(Sequence.java:560)
at
org.eclipse.cdt.dsf.concurrent.Sequence.access$4(Sequence.java:552)
at
org.eclipse.cdt.dsf.concurrent.Sequence$2.handleErrorOrWarning(Sequence.java:424)
at
org.eclipse.cdt.dsf.concurrent.RequestMonitor.handleFailure(RequestMonitor.java:314)
at
org.eclipse.cdt.dsf.concurrent.RequestMonitor.handleCompleted(RequestMonitor.java:277)
at
org.eclipse.cdt.dsf.concurrent.RequestMonitor$2.run(RequestMonitor.java:239)
at
java.util.concurrent.Executors$RunnableAdapter.call(Unknown
Source) at
java.util.concurrent.FutureTask$Sync.innerRun(Unknown
Source) at
java.util.concurrent.FutureTask.run(Unknown
Source) at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown
Source) at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown
Source) at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source) at
java.lang.Thread.run(Unknown Source)
!SUBENTRY 1 org.eclipse.cdt.dsf.gdb 4
10004 2010-02-09 18:19:47.546 !MESSAGE
Failed to execute MI command:
-exec-run Error message from debugger back end: Error creating process
C:/Documents and Settings/Pieter/Mijn
documenten/My
Dropbox/Unief/C/H12/Opdr07/Debug/CH12O07.exe,
(error 193).

Topic: Error 193  (Read 8865 times)

I’m using Windows 10 (64 bit) and when I want to compile my program, the debugger gives me the message
GDB command:
«-exec-run»
got the following issue:
«,msg=»Error creating process C:/Users/Albert/OneDrive/J341t351kpograms/People/people.exe, (error 193).»

I tried compiling with Lazarus 1.6 and with 1.6.2 too, but I got the same result. Could you help?


Logged


why are you building from your onedrive folder? copy your project to desktop or somewhere else and build from there.
the path looks fishy especially with a backwards slash.
also make sure the new path doesn’t have spaces between it.

« Last Edit: January 05, 2017, 10:38:23 pm by Xor-el »


Logged


I think this doesn’t matter. I usually run some other programs from OneDrive and they work. Now I tested starting the program from my PC but it gave me the same message as before…


Logged


have you tried copying the executable to a path without space and running it?


Logged


This path doesn’t contain any spaces, so yes… I tried?


Logged


Oh and btw my other programs are in the same path and they work well, so I think the problem is elsewhere


Logged


is your app standalone or it requires a dll.?
are you building for 32bit or 64bit?


Logged


1) Sorry but I don’t know :/

2) I use Windows 10 64 bit, is there an option which bitrate I want to build for?

Note: I tested, if I copy the whole source code and insert it into a new program’s one, building that program will send me the same message. Is this important?


Logged


1) Sorry but I don’t know :/

2) I use Windows 10 64 bit, is there an option which bitrate I want to build for?

Note: I tested, if I copy the whole source code and insert it into a new program’s one, building that program will send me the same message. Is this important?

can you upload a sample demo project that can be used to reproduce the error?


Logged


C:/Users/Albert/OneDrive/J341t351kpograms/People/people.exe

I’m worried about mixing slashes and backslashes in program path. Looks wierd on Windows. Are those special symbols in the folder name (Játékpograms)? Try different folder.
I see that others users on Google also get 193 errors when folder name contains a mixture of slashes and backslashes (special symbols).

« Last Edit: January 06, 2017, 08:30:00 am by Eugene Loza »


Logged


I’m worried about mixing slashes and backslashes in program path. Looks wierd on Windows.

Windows API does not care.

@Mr. Albert: please do as others have suggested. Save the project on a local harddrive (in a folder without spaces or sepcial characters). Report if the error persists then.

I’m using Windows 10 (64 bit) and when I want to compile my program, the debugger gives me the message
GDB command:

That is more than compiling, that is running inside the IDE.
Does compilation succeed (Menu->Run->Compile)?
If so, can you find the executable at the location C:UsersAlbertOneDriveJ341t351kpogramsPeoplepeople.exe?
If so, then this is a problem of gdb (the gnu debugger).

Is it at all possible to do in a console:

c:
cd UsersAlbertOneDriveJ341t351kpogramsPeople

Bart


Logged


1) I know using special characters is not a good idea, but Játékprograms is the folder of my other programs, and as I wrote it, they work well.
2) I’ve tried moving the files to another folder, like C:/Users/Levi/Documents/People/people1.exe but I got the same error message. It’s important, that my other programs are in the same folder, and they have never sent me any errors.
3) Compilation works well! —> The executable is in the right folder, but when I try to start it, Windows sends me the message «This application can’t open!«.

« Last Edit: January 06, 2017, 08:32:45 pm by Mr. Albert »


Logged



Logged

lainz.github.io


Which compiler version?
Which compiler options (copy them from Menu->Project->Project Options->Compiler Options, click on button «Show Options»).

You did not accidentally cross-compile to another architecture or OS?

Bart


Logged


Have you checked that your exe is not being detected as a virus (probable false positive).
try sending your exe to virustotal.com
To see if it is clear.

Do you have the same exe in the root of your c drive; if so try renaming it or removing it from the root.

If your application require any dll files; make sure that they are all where you expect them to be.

Just some ideas


Logged

The best way to get accurate information on the forum is to post something wrong and wait for corrections.


This is shown when I try to debug my code with Eclipse:

alt text http://img63.imageshack.us/img63/1679/eclipseerr.jpg

I then tried creating a simple Hello World program manually with Notepad++ and the command-line gcc. When I launched the gdb debugger this happened:

(gdb) run

Starting program: C:Documents and SettingsPieterBureaublad/test.exe Error creating process C:Documents and SettingsPieterBureaublad/test.exe, (error 193).

The binary runs fine, but as soon as I try to debug it error 193 is returned. I’m working with C code that is processed by the MinGW GCC compiler. I tried reinstalling both the compiler and the debugger (latest versions) but that didn’t change anything. It has worked in the past, and I do not remember making any changes to settings related to the compiler.

Here’s an example of an error log as it was generated by Eclipse.

!ENTRY org.eclipse.cdt.dsf.gdb 4 5012 2010-02-09 18:19:47.375 !MESSAGE Error in final launch sequence !STACK 1 org.eclipse.core.runtime.CoreException: Failed to execute MI command: -exec-run Error message from debugger back end: Error creating process C:/Documents and Settings/Pieter/Mijn documenten/My Dropbox/Unief/C/H12/Opdr07/Debug/CH12O07.exe, (error 193). at org.eclipse.cdt.dsf.concurrent.Sequence.abortExecution(Sequence.java:560) at org.eclipse.cdt.dsf.concurrent.Sequence.access$4(Sequence.java:552) at org.eclipse.cdt.dsf.concurrent.Sequence$2.handleErrorOrWarning(Sequence.java:424) at org.eclipse.cdt.dsf.concurrent.RequestMonitor.handleFailure(RequestMonitor.java:314) at org.eclipse.cdt.dsf.concurrent.RequestMonitor.handleCompleted(RequestMonitor.java:277) at org.eclipse.cdt.dsf.concurrent.RequestMonitor$2.run(RequestMonitor.java:239) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) !SUBENTRY 1 org.eclipse.cdt.dsf.gdb 4 10004 2010-02-09 18:19:47.546 !MESSAGE Failed to execute MI command: -exec-run Error message from debugger back end: Error creating process C:/Documents and Settings/Pieter/Mijn documenten/My Dropbox/Unief/C/H12/Opdr07/Debug/CH12O07.exe, (error 193).


Could it be that either you are using an older version of gdb, that doesn’t support native MinGW debugging (unlikely since you said you updated to the latest version), or you are invoking the debugger incorrectly? In other words, if your executable is named helloworld.exe, gdb helloworld may give you that error, whereas gdb helloworld.exe may work.

Edit: further googling says that trying a directory name without spaces might work (the solution is for Code::Blocks, but it doesn’t hurt to try).

Topic: Error 193 :(  (Read 16105 times)

when I start debugging it shows following…

Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: C:Documents and SettingsIrfanDesktopTemptest_1
Adding source dir: C:Documents and SettingsIrfanDesktopTemptest_1
Adding file: binDebugtest_1.exe
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb 6.7.50.20071127
Error creating process C:Documents and SettingsIrfanDesktopTemptest_1/bin/Debug/test_1.exe, (error 193).

The program has no error.
Any idea how to solve this problem?


Logged


You should try a path without spaces.

Dje


Logged


You should try a path without spaces.

Dje

sorry, i didnt understand.

could u plz clarify?


Logged


Try to move project to another place -> full path to the *.exe file should be without spaces and non-ascii characters.


Logged


Also you could try newer gdb, current version is 7.x.x


Logged

(most of the time I ignore long posts)
[strangers don’t send me private messages, I’ll ignore them; post a topic in the forum, but first read the rules!]


You should try a path without spaces.

Dje

Thanks,it worked….but isn’t this a little weird solution?

is there any explanation behind this?


Logged


Lots of command line tools use space as argument separator and you have to quote «your args with spaces» to use spaces in args.

Dje


Logged


Когда я пытаюсь отладить простую программу с помощью gdb на cygwin, я получаю следующее:

C:UsersBenoit St-Pierreworkspace_cppcs454>gdb a.exe
GNU gdb 6.8.0.20080328-cvs (cygwin-special)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...
(gdb) start
Breakpoint 1 at 0x401a51: file server.cc, line 207.
Starting program: /cygdrive/c/Users/Benoit St-Pierre/workspace_cpp/cs454/a.exe
Error creating process /cygdrive/c/Users/Benoit St-Pierre/workspace_cpp/cs454/a.exe, (error 193).

Где ошибка 193 — это ERROR_BAD_EXE_FORMAT.

Само скомпилированное приложение отлично работает, а клиенты подключаются к приложению и взаимодействуют с ним. Я использую cygwin 1.7, так как использую новый getaddrinfo методы настройки розеток. Приложение было скомпилировано с использованием gcc 3.4.4 с помощью следующей команды:

g++ -g3 server.cc

Кто-нибудь знает, что я делаю не так?

1 ответы

Проблема в том, что в имени пути есть пробел. Переместите файл в другой каталог, и GDB сможет запустить процесс.

Создан 10 июля ’09, 03:07

Не тот ответ, который вы ищете? Просмотрите другие вопросы с метками

c++
debugging
gdb
cygwin

or задайте свой вопрос.

I am running Windows XP with cygwin with gcc 3.4.4-1 and gdb
20060706-2. I compiled this very simple program:

#include <iostream>
using namespace std;

int main(int argc, char (*(argv[])) ) {
int max; // number to count to
if (argc == 1) {
// print to 100
max = 100;
} else {
// convert first argument to integer, print to that
max = atoi(argv[1]);
}
for (int i = 0; i <= max; i++) {
cout << i << «n»;
}
return 0;
}

….using the command:

$ g++ -g -o printNumbers.exe printNumbers.cpp

When I run `gdb printNumbers.exe`, things start off fine:

GNU gdb 6.5.50.20060706-cvs (cygwin-special)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you ar
welcome to change it and/or distribute copies of it under certain
condition
Type «show copying» to see the conditions.
There is absolutely no warranty for GDB. Type «show warranty» for
details.
This GDB was configured as «i686-pc-cygwin»…

….but when I actually try to run the executable, I get this error:

(gdb) run
Starting program: ~/C++/exercises/printNumbers.exe
Error creating process ~/C++/exercises/printNumbers.exe, (error 193).

Error 193 is ERROR_BAD_EXE_FORMAT, but this cryptic error code does not
give me much information on how to resolve the problem. Note that
outside the debugger, both inside and outside of cygwin, the program
runs fine.

I have tried compiling the program several times using different
distributions of the g++ compiler (dev-cpp and mingw) inside and
outside of cygwin, but all with the same result. I have also tried
running gdb inside and outside of cygwin.

Running ‘g++ -dumpmachine’ returns «i686-pc-cygwin», so the
architectures appear to match up and should not pose a problem.

I am confounded, and not having ever used a debugger before (I hail
from PHP) doesn’t help very much. Help much appreciated!

P.S. I realize debugging is not directly related to comp.lang.c++,
however, it probably is an essential part of any C++ developer’s
toolkit, and also the more relevant gnu.gdb is read-only.

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Gcc fatal error no input files compilation terminated
  • Gcc fatal error cannot execute cc1plus execvp no such file or directory
  • Gcc exec format error
  • Gcc exe internal error aborted program collect2
  • Gcc exe fatal error no input files

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии