Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 598745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:25:20+00:00 2026-05-13T16:25:20+00:00

I have a program that works correctly on my development machine but produces an

  • 0

I have a program that works correctly on my development machine but produces an Illegal instruction fault when tested on a ‘clean machine’ where only the necessary files have been copied.

The program consists of my shared library, built from C++ sources and a C wrapper sample program that demonstrates the libraries usage. On the development machine, all are built in Eclipse w/g++ and both Debug and Release work fine. A number of standard libraries are linked in.

To test dependencies that I might have missed, I copied the .c file, my library’s .so file and the library .h file to a fresh Linux install and compiled/linked them with a simple script created with the same release compile options that Eclipse is using. Both machines have g++ 4.3.2.

When I run the program on the clean machine it exits immediately after printing ‘Illegal instruction’.

Running in gdb produces:

(gdb) run
Starting program: /home/sfallows/Source/Apps/MySample/MySample 
[Thread debugging using libthread_db enabled]
[New Thread 0xb5c4ca90 (LWP 7063)]

Program received signal SIGILL, Illegal instruction.
[Switching to Thread 0xb5c4ca90 (LWP 7063)]
0xb7f0cb29 in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at /usr/include/c++/4.3/iostream:77
77   static ios_base::Init __ioinit;
Current language:  auto; currently c++
(gdb) bt
#0  0xb7f0cb29 in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at /usr/include/c++/4.3/iostream:77
#1  0xb7f0cb48 in global constructors keyed to _ZN8NodeLockC2Ev () at ../NodeLock.cpp:194
#2  0xb7f204ad in __do_global_ctors_aux () from /home/sfallows/Source/Apps/MySample/libMyLib.so
#3  0xb7ee5c80 in _init () from /home/sfallows/Source/Apps/MySample/libMyLib.so
#4  0xb7fe1de4 in ?? () from /lib/ld-linux.so.2
#5  0x00000001 in ?? ()
#6  0xbf8e6b74 in ?? ()
#7  0xbf8e6b7c in ?? ()
#8  0x00000007 in ?? ()
#9  0xbf8e6b2c in ?? ()
#10 0x00000001 in ?? ()
#11 0x00000001 in ?? ()
#12 0xb7feeff4 in ?? () from /lib/ld-linux.so.2
#13 0x00000000 in ?? ()
(gdb) Quit

I’m not sure why it is running static construtors in NodeLock.cpp. I have neither any static/global objects in that file nor any static/global objects of that class anywhere.

The development machine is an Intel Core2 Quad and the clean machine is a Pentium 4 Dual. I assume g++ defaults to using a common subset of x86 instructions and that the processor difference is not my problem.

Any suggestions for what else to look at appreciated. I’m trying to avoid installing all of the library source and dependencies on the clean machine.

To rmn’s answer and John Boker’s comment: In the Windows world exes and dlls run on the plethora of Intel and AMD processors so there clearly is a widely used common subset of instructions. I thought gcc would do the same? Guess I’ll fully research the instruction set/architecture options.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T16:25:21+00:00Added an answer on May 13, 2026 at 4:25 pm

    You could try to compile explicitly for the i686 architecture (using -march=i686 option for gcc). Just in case you have some Core2-Specific instructions generated by the your compiler…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have NUnit installed on my machine in C:\Program Files\NUnit 2.4.8\ but on my
I have a program that spits out both standard error and standard out, and
I have a program that creates a Windows user account using the NetUserAdd() API
I have a program that uses the mt19937 random number generator from boost::random. I
I have a program that spits out an Excel workbook in Excel 2003 XML
I have a program that monitors debug messages and I have tried using a
I have a program that will calculate the minimal area taken by fitting rectangles
I have a program that runs osql.exe from microsoft sql server tools directory and
I have a program that I need to run under *nix and windows. because
I have a program that when it starts, opens a winform (it is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.