Thread overview
Help with "elfobj" error message
Dec 05, 2004
Jan Bendtsen
Dec 05, 2004
Walter
Dec 05, 2004
Thomas Kuehne
Dec 06, 2004
Jan Bendtsen
Dec 07, 2004
Jan Bendtsen
Dec 07, 2004
Thomas Kuehne
Dec 07, 2004
Jan Bendtsen
Dec 09, 2004
Ben Hinkle
December 05, 2004
Hi people,

As a newbie, I really appreciate the friendly and helpful D community. Thus, I hope that somebody will be kind enough to help me out with the following problem.

Trying to compile Miguel Simoes' XmlNode.d into a project of my own, I run into the following compiler (or linker) error. Everything goes fine during parsing and semantics, then it starts generating code for the various functions; then, out of the blue:
...
Internal error: ../ztc/elfobj.c 1251

Could someone smarter and/or more knowledgeable than me explain why and, more importantly, how I get rid of it? I'm using Mandrake Linux 10.0 and DMD v. 0.106, if that is any help.

Thanks in advance,
Dimon
December 05, 2004
"Jan Bendtsen" <dimon@controlREMOVEME.aau.dk> wrote in message news:covp5e$30p5$1@digitaldaemon.com...
> Internal error: ../ztc/elfobj.c 1251
>
> Could someone smarter and/or more knowledgeable than me explain why and, more importantly, how I get rid of it? I'm using Mandrake Linux 10.0 and DMD v. 0.106, if that is any help.

This should help: www.digitalmars.com/bugs.html


December 05, 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jan Bendtsen schrieb am Sun, 05 Dec 2004 20:59:46 -0500:
> Hi people,
>
> As a newbie, I really appreciate the friendly and helpful D community.

Welcome ;)

> Trying to compile Miguel Simoes' XmlNode.d into a project of my own, I
> run into the following compiler (or linker) error. Everything goes fine
> during parsing and semantics, then it starts generating code for the
> various functions; then, out of the blue:
> ...
> Internal error: ../ztc/elfobj.c 1251
>
> Could someone smarter and/or more knowledgeable than me explain why and, more importantly, how I get rid of it? I'm using Mandrake Linux 10.0 and DMD v. 0.106, if that is any help.

One of the standards is to test the newest release - see Walter's URL.

Simones' code requires a little adaption for recent compiler changes:

- --- xml/XmlNode.d	2004-10-15 15:15:00.000000000 +0200
+++ xml/XmlNode.d	2004-12-05 23:34:48.856551400 +0100
@@ -167,14 +167,14 @@
 		return _children.length != 0;
 	}
 	public bit hasChildren (char[] name) {
- -		return name in _children;
+		return !((name in _children) === null);
 	}

 	public bit hasAttribute () {
 		return _attributes.length != 0;
 	}
 	public bit hasAttribute (char[] name) {
- -		return name in _attributes;
+		return !((name in _attributes) === null);
 	}

 	/* Write Method */

Thomas

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.9.13 (GNU/Linux)

iD8DBQFBs5HM3w+/yD4P9tIRAknhAKDN4pbw2/319ZCrm18UN4xQqn+F1ACdH1r9
LkEXbbfZKfttqHso/yerJFI=
=DiYn
-----END PGP SIGNATURE-----
December 06, 2004
Good morning,

Thomas Kuehne wrote:
> Welcome ;)

Thank you :-)

[snip]
>>Internal error: ../ztc/elfobj.c 1251
>>
>>Could someone smarter and/or more knowledgeable than me explain why and, more importantly, how I get rid of it? I'm using Mandrake Linux 10.0 and DMD v. 0.106, if that is any help.
> 
> 
> One of the standards is to test the newest release - see Walter's URL.

Thanks, I'll do that. I already changed the little errors you mentioned below (although my solution was not quite as elegant as listed below), so that's not what's causing the internal error. I'm going to upgrade to 0.109 ASAP and see if that does the trick, otherwise I'll post a bug report.

> Simones' code requires a little adaption for recent compiler changes:
> 
> - --- xml/XmlNode.d	2004-10-15 15:15:00.000000000 +0200
> +++ xml/XmlNode.d	2004-12-05 23:34:48.856551400 +0100
> @@ -167,14 +167,14 @@
>  		return _children.length != 0;
>  	}
>  	public bit hasChildren (char[] name) {
> - -		return name in _children;
> +		return !((name in _children) === null);
>  	}
>  		
>  	public bit hasAttribute () {
>  		return _attributes.length != 0;
>  	}
>  	public bit hasAttribute (char[] name) {
> - -		return name in _attributes;
> +		return !((name in _attributes) === null);
>  	}
>  	
>  	/* Write Method */
> 
> Thomas

Thanks for the help.
Jan.
December 07, 2004
Hi again,

just a little follow-up; perhaps somebody might be interested...

>>> Internal error: ../ztc/elfobj.c 1251
>>>
>>> Could someone smarter and/or more knowledgeable than me explain why and, more importantly, how I get rid of it? I'm using Mandrake Linux 10.0 and DMD v. 0.106, if that is any help.
>>
>> One of the standards is to test the newest release - see Walter's URL.

0.109 gave the same error. The problem turned out to be a switch statement of the form

switch(stream.readCurrent()) {
	case '>': return true;
	case '/': // do stuff, return false, possibly throw an exception
	default:
}

in a method that returns a bool. I fixed it by doing the following in stead:

bool flag;
switch(stream.readCurrent()) {
	case '>':
		flag = true;
		break;
	case '/':
		// do stuff, set flag, possibly throw an exception
		break;
	default:
		break;
}
return flag;


Does anybody know if this is an error caused by some strange Linux/Win32 discrepancy or something like that?

Cheers,
Jan
December 07, 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jan Bendtsen schrieb am Tue, 07 Dec 2004 09:16:15 -0500:
>>>> Internal error: ../ztc/elfobj.c 1251
>>>>
>>>> Could someone smarter and/or more knowledgeable than me explain why and, more importantly, how I get rid of it? I'm using Mandrake Linux 10.0 and DMD v. 0.106, if that is any help.
>>>
>>> One of the standards is to test the newest release - see Walter's URL.
>
> 0.109 gave the same error. The problem turned out to be a switch statement of the form
>
> switch(stream.readCurrent()) {
> 	case '>': return true;
> 	case '/': // do stuff, return false, possibly throw an exception
> 	default:
> }

http://www.digitalmars.com/bugs.html
# In order to submit a problem report, the most important issue is to
# make it reproducible in the smallest possible example.

http://www.prowiki.org/wiki4d/wiki.cgi?D__Tutorial/BugReports
# Include a small self-contained snippet of code that creates the problem.

Thomas

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.9.13 (GNU/Linux)

iD8DBQFBtYlw3w+/yD4P9tIRAu7FAKDDaNCL7yuMWcmv0lX0Av/OmZtHUQCfR6bN
2p2LVPW19ciwrEsxwCYnnrg=
=RL3d
-----END PGP SIGNATURE-----
December 07, 2004
Hi again,

Thomas Kuehne wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Jan Bendtsen schrieb am Tue, 07 Dec 2004 09:16:15 -0500:
> 
>>>>>Internal error: ../ztc/elfobj.c 1251
>>>>>
>>>>>Could someone smarter and/or more knowledgeable than me explain why and, more importantly, how I get rid of it? I'm using Mandrake Linux 10.0 and DMD v. 0.106, if that is any help.
>>>>
>>>>One of the standards is to test the newest release - see Walter's URL.
>>
>>0.109 gave the same error. The problem turned out to be a switch statement of the form
>>
>>switch(stream.readCurrent()) {
>>	case '>': return true;
>>	case '/': // do stuff, return false, possibly throw an exception
>>	default:
>>}
> 
> 
> http://www.digitalmars.com/bugs.html
> # In order to submit a problem report, the most important issue is to
> # make it reproducible in the smallest possible example.
> 
> http://www.prowiki.org/wiki4d/wiki.cgi?D__Tutorial/BugReports
> # Include a small self-contained snippet of code that creates the problem.
> 
> Thomas

Uhm right, but since I could come up with such a simple workaround it wasn't actually a bug ... was it?

OK, I'll shut up now and go look at it in more detail... :-)

Cheers,
Jan
December 09, 2004
Jan Bendtsen wrote:

> Hi again,
> 
> just a little follow-up; perhaps somebody might be interested...
> 
>>>> Internal error: ../ztc/elfobj.c 1251
>>>>
>>>> Could someone smarter and/or more knowledgeable than me explain why and, more importantly, how I get rid of it? I'm using Mandrake Linux 10.0 and DMD v. 0.106, if that is any help.
>>>
>>> One of the standards is to test the newest release - see Walter's URL.
> 
> 0.109 gave the same error. The problem turned out to be a switch statement of the form
> 
> switch(stream.readCurrent()) {
> case '>': return true;
> case '/': // do stuff, return false, possibly throw an exception
> default:
> }
> 
> in a method that returns a bool. I fixed it by doing the following in stead:
> 
> bool flag;
> switch(stream.readCurrent()) {
> case '>':
> flag = true;
> break;
> case '/':
> // do stuff, set flag, possibly throw an exception
> break;
> default:
> break;
> }
> return flag;
> 
> 
> Does anybody know if this is an error caused by some strange Linux/Win32 discrepancy or something like that?
> 
> Cheers,
> Jan

I just ran into it, too, when compiling the Locks library on Linux. I'll try to narrow it down and post something to the bugs newsgroup.