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

  • SEARCH
  • Home
  • 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 7839351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:25:23+00:00 2026-06-02T15:25:23+00:00

I stumbled upon an assembly programming challenge where I need to find why the

  • 0

I stumbled upon an assembly programming challenge where I need to find why the following code gives a Bus Error when trying to run it. After much googling, I still can’t figure out why.. My understanding of assembly x86 not great, any tips on finding the solution would be very appreciated.

Here is the code:

#include <stdlib.h>
int main(void) {
  asm("pushf\n"
      "orl $ 0x40000, (%esp)\n"
      "popf\n");

  *((int*) (((char*) malloc(5)) + 1)) = 23; // This line causes the Bus Error


  return 0;
}
  • 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-06-02T15:25:24+00:00Added an answer on June 2, 2026 at 3:25 pm

    Essentially you are setting a flag in the flags register. Flag 0x40000, aka bit 18 which according to http://en.wikipedia.org/wiki/FLAGS_register_%28computing%29 is

    18 AC Alignment check (486SX+ only) X

    If you search for “flag alignment check” you find amongst others:

    http://forum.soft32.com/linux2/Turn-x86-Alignment-Check-ftopict12003.html

    I hope this sets you on the right track. But do you really have a 486SX?

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

Sidebar

Related Questions

I've stumbled upon the following two weird looking properties: Process.GetCurrentProcess().MainModule; Assembly.GetExecutingAssembly().Location; These properties are
I stumbled upon this code and I am curious as to what use may
I stumbled upon an error that I don't quite understand. # Ruby 1.8.7 >>
I have stumbled upon the following F77 yacc grammar: http://yaxx.cvs.sourceforge.net/viewvc/yaxx/yaxx/fortran/fortran.y?revision=1.3&view=markup . How can I
I stumbled upon the following construction in C++: bool result = false; for(int i
I stumbled upon a very strange bit of PHP code. Could someone explain why
Today I stumbled upon a rather interesting compiler error: int main() { int const
Recently I was reading about partitioning code with .NET assemblies and stumbled upon a
I stumbled upon a problem where i need an instance of the class inside
I stumbled upon this code: static void Main() { typeof(string).GetField(Empty).SetValue(null, evil);//from DailyWTF Console.WriteLine(String.Empty);//check //how

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.