Fortified compiling prevents building older RPM

Today I had to build and test some older Open MPI RPM packages. However, I was prevented to build them, although the code apparently was correct.

The command:

rpmbuild -ba openmpi-1.2.1.spec

The error message was:

In function 'open',
    inlined from 'orte_abort' at runtime/orte_abort.c:91:
/usr/include/bits/fcntl2.h:51: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT in second argument needs 3 arguments

The line of source code that causes the error is:

fd = open(abort_file, O_CREAT);

After some research, I discovered that the source code is correct. But nowadays, newer versions of gcc do additional security checking that were not available that the time the code was written.

For security reasons, calling open with O_CREAT and only two parameters is not acceptable anymore.

In order to build the RPM, I would either need to change the SPEC file or the src.rpm package, or find out a build options for rpmbuild that turns off further code protection.

First, I changed the the src.rpm package, chaning the problematic line to:

fd = open(abort_file, O_CREAT, 0666);

Then, I confirmed that it is also possible to pass additional parameters to rpmbuild in order to turn off code protection:

rpmbuild -ba openmpi-1.2.1.spec --define 'configure_options CFLAGS=-D_FORTIFY_SOURCE=0'

References:

  • http://www.redhat.com/archives/fedora-devel-announce/2007-September/msg00015.html
  • http://www.redhat.com/magazine/009jul05/features/execshield/
  • http://www.redhat.com/archives/fedora-tools-list/2004-September/msg00002.html
  • http://wiki.debian.org/Hardening
  • https://wiki.ubuntu.com/CompilerFlags

Add comment October 13, 2008

A poem about Subversion

I found an interesting poem from Peter Kriens about SVN (subversion) that was posted to the Eclipse committer mailing list. Really interesting how frustration can encourage your imagination in others arts besides computer programming.

(more…)

Add comment October 7, 2008

About JSch open source project

There are many, many open source, pure java implementation for the SSH/SFTP protocol. However, in my opinion, there are two of them that can be taken seriously. One of them is JSch, the other one is Trilead SSH. I will talk about my experience on the former one while implementing the RemoteTools framework for the Parallel Tools Platform for Eclipse.

(more…)

11 comments September 30, 2008

Smaller font sizes for Eclipse on Linux

This article describes some approaches to launch Eclipse on Linux with smaller font sizes and customized graphical user interface (GUI).

The modern desktop environments like KDE or Gnome use larger font sizes to enhance readability of screen contents. However, Eclipse, looks better with a clean design and small fonts.

Views like Package Explorer or Outline may contain very large listings of important information. Eclipse uses are not willing to waste precious space neither with large fonts nor with fancy window decorations.

(more…)

3 comments September 24, 2008

Fixing Copy-Paste issues on Eclipse and KDE

This article describes a solution to fix a long term issue (bug?) involving copy & paste when running Eclipse on KDE.

The problem

When launching Eclipse from KDE, one might experience several types failures with cut, copy and paste actions in Eclipse. The reported misbehavior is non-deterministic, but frequent enough to degrade user experience.

Inside the editor, specially the Java or C/C++ editor, selecting text and issuing the copy action (ctrl+c or equivalent menu entry) may not copy the select text to the clipboard (no text is copied).

The cut action (ctrl+x or equivalent menu entry) erases the selected text as expected, but may not save to clipboard (text that was cut is lost!).

Even worse, after the selected text was apparently copied (or cut) correctly, the past command (ctrl+v or equivalent menu entry) does always write correctly from clipboard. Sometimes, paste only writes part of the expected text (part of the text is lost).

Fortunately, copy & paste or cut & paste does not corrupt text, it only looses text frequently.

Copy & paste never fails on text boxes in dialogs. It might fail only on text editors.

(more…)

26 comments August 10, 2008

Polling files on NFS shared directories

These days we were implementing a distributed application where processes read startup information from a shared file stored in an NFS directory. Unfortunately, the approach did not work as expected, and we faced strange situations. After all, we learned that polling NFS shared directories can be quite tricky.

(more…)

2 comments August 6, 2008

Running eclipse based apps on Fedora 9 x86_64

Many IBM applications are based on eclipse for i386 architectures. Just some examples: Lotus Notes, Sametime, Symphony, IES (IBM eclipse SDK). However, the Fedora 9 for x86_64 architectures does not install any 32 bits libraries anymore. How shall these applications now run on Fedora 9?

(more…)

Add comment July 30, 2008

xfs forgetful?

I have been using xfs for some months now. Somewhere I had read about advantages of xfs and got convinced that I should store my files on that file system (sorry, I don’t remember the references anymore).

Today it happened that, suddenly, eclipse complained that all the files I was editing did not exist anymore on the workspace and that the file view was out of sync with the file system. Probably, a bug of new Ganymede version, I thought. But in sequence, everything crashed: KDE, firefox, Sametime, Notes, …

Too bad. At the terminal I saw that that my most popular subdirectories in my homedir were empty! Where were all the files? I tried to reboot the machine and to run xfs_repair, but there was no rescue anymore.

That made me remember that some time ago, binaries form /usr/bin and libraries from /usr/lib were mysteriously vanishing on another machine while they were running. The root partition of this machine was also xfs.

Fortunately I have always a recent backup near to me (sure, backup is not stored on another xfs), so this experience was not that painful. However, I wonder if xfs is enough reliable to not forget my files. In doubts, I will reinstall my favorite Linux distro with ext3 as soon as possible.

Add comment July 30, 2008

Backing up DVD movies on Linux now useful

For a long time I have been struggling on Linux to easily create backup copies of my favorite movies, until I finally found k9copy.

Before k9copy, backing up dvds was darkness

On one hand, there are many fancy video tools available for Windows. However, nearly all of them have some kind of embedded spyware or virus. On the other hand, Linux tools are all written for command line, and require a lot of expertise just to understand what they do.

I really wanted to find a tool really easy backup DVD. Googling around, I also found several non-understandable scripts that promised to do certain tasks, but were of no use. Even worse, these scripts had not any kind of support.

After a while I learned and tried Mencoder, which had produced the best results. I also tried transcode, using dvd:rip. Although being slower than Mencoder, transcoder had less issues than Mencoder. However, I could not figure how use those tools to backup a DVD.

Some relief with DVD Shrink

At least, there has always been DVD Shrink for windows. However, due to many legal issues, this software has been discontinued and no other reliable and spyware-free software has been developed in replace.

I have read several articles and how-tos suggesting to use wine to run DVD Shrink on Linux. Although reasonable, I wondered if there was another more updated software.

Finally, light: k9copy!

I am really impressed. K9copy is available on most popular Linux distros. It is trivial to install. The tool is really simple to use and understand. It does it task really fast (about 40 mins for a DVD on an older computer). Its output is of good quality.

I wonder why few poeple know this software.

Unfortunaly k9copy, like most other dvd software, does not burn the copy. It only produces an .iso file, that can be easily burned to a DVD using any dvd tool, like k3b.

In order to watch the video on the computer, kaffeine player can open the iso file.

Add comment July 20, 2008

Whats this? IOException: Write end dead

I like Java very much. Nevertheless, there are things I cannot stand in Java. Sure, and one of them are undocumented exceptions from the Java API, that nobody can explain.

I will talk about “Write end dead” IOExceptions. What does this mean? Why did this happen? Even if googling around, it is difficult to find a clear answer.

This article is a full explanation to understand this exception and shows how to fix your code. Just continue reading…

(more…)

6 comments July 16, 2008

Next Posts


Disclaimer

This is the technical weblog of Daniel Felix Ferber. The postings on this site are his own and don’t necessarily represent neither IBM’s, Stefanini IT Solutions nor Petrobras positions, strategies or opinions.

My Personal Weblog

This weblog is dedicated for my technical articles written in English. If you are interested in my personal thoughs, or my articles in Portuguese, please visit Daniel Ferbers Weblog.

Blogroll

Feeds

Pages

 

November 2009
M T W T F S S
« Aug    
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Archives

Meta