Author Topic: error when compiling from svn sources (25-10/2006)  (Read 23565 times)

Brain Damage

  • Guest
error when compiling from svn sources (25-10/2006)
« on: October 25, 2006, 11:24:15 pm »
hi, since i could not find a compatible rpm for mandriva i tried to build code::blocks from the sources;

the bootstrap, & configure worked fine, but when i do run make i get this error:

./auto_revision +int +wx +t ../../.. ./../../sdk/autorevision.h
*** glibc detected *** ./auto_revision: free(): invalid next size (normal): 0x0804f2f8 ***
======= Backtrace: =========
/lib/i686/libc.so.6[0x401c0dad]
/lib/i686/libc.so.6(__libc_free+0x83)[0x401c0f33]
/usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0x400f9d91]
/usr/lib/libstdc++.so.6(_ZdaPv+0x1d)[0x400f9ded]
/usr/lib/libstdc++.so.6(_ZNSt13basic_filebufIcSt11char_traitsIcEE26_M_destroy_internal_bufferEv+0x2f)[0x4009d3af]
/usr/lib/libstdc++.so.6(_ZNSt13basic_filebufIcSt11char_traitsIcEE5closeEv+0x61)[0x400a0141]
./auto_revision[0x804a55b]
./auto_revision[0x804ae4a]
/lib/i686/libc.so.6(__libc_start_main+0xdc)[0x4017175c]
./auto_revision(__gxx_personality_v0+0x41)[0x80491d1]
======= Memory map: ========
08048000-0804c000 r-xp 00000000 03:05 599172     /home/cloud/code::blocks/trunk/src/build_tools/autorevision/auto_revision
0804c000-0804d000 rwxp 00004000 03:05 599172     /home/cloud/code::blocks/trunk/src/build_tools/autorevision/auto_revision
0804d000-0806e000 rwxp 0804d000 00:00 0          [heap]
40000000-40018000 r-xp 00000000 03:05 324624     /lib/ld-2.4.so
40018000-40019000 r-xp 00017000 03:05 324624     /lib/ld-2.4.so
40019000-4001a000 rwxp 00018000 03:05 324624     /lib/ld-2.4.so
4001a000-4001b000 rwxp 4001a000 00:00 0
40031000-40040000 r-xp 00000000 03:05 324618     /lib/i686/libpthread-2.4.so
40040000-40042000 rwxp 0000e000 03:05 324618     /lib/i686/libpthread-2.4.so
40042000-40044000 rwxp 40042000 00:00 0
40044000-40046000 r-xp 00000000 03:05 324635     /lib/libdl-2.4.so
40046000-40048000 rwxp 00001000 03:05 324635     /lib/libdl-2.4.so
40048000-40121000 r-xp 00000000 03:05 108189     /usr/lib/libstdc++.so.6.0.8
40121000-40124000 r-xp 000d9000 03:05 108189     /usr/lib/libstdc++.so.6.0.8
40124000-40126000 rwxp 000dc000 03:05 108189     /usr/lib/libstdc++.so.6.0.8
40126000-4012c000 rwxp 40126000 00:00 0
4012c000-4014f000 r-xp 00000000 03:05 324616     /lib/i686/libm-2.4.so
4014f000-40151000 rwxp 00023000 03:05 324616     /lib/i686/libm-2.4.so
40151000-4015b000 r-xp 00000000 03:05 324667     /lib/libgcc_s-4.1.1.so.1
4015b000-4015c000 rwxp 0000a000 03:05 324667     /lib/libgcc_s-4.1.1.so.1
4015c000-40283000 r-xp 00000000 03:05 324614     /lib/i686/libc-2.4.so
40283000-40284000 r-xp 00126000 03:05 324614     /lib/i686/libc-2.4.so
40284000-40286000 rwxp 00127000 03:05 324614     /lib/i686/libc-2.4.so
40286000-4028b000 rwxp 40286000 00:00 0
40300000-40321000 rwxp 40300000 00:00 0
40321000-40400000 ---p 40321000 00:00 0
bfae0000-bfaf6000 rw-p bfae0000 00:00 0          [stack]
bfffe000-bffff000 r-xp bfffe000 00:00 0

Offline phireis

  • Single posting newcomer
  • *
  • Posts: 7
Re: error when compiling from svn sources (25-10/2006)
« Reply #1 on: October 26, 2006, 01:13:24 am »
I got the same prob.
I'm trying on Suse 10.0.

Lipe

Offline aarti_pl

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: error when compiling from svn sources (25-10/2006)
« Reply #2 on: October 26, 2006, 01:24:59 am »
same on ubuntu 6.06

Regards
Aarti_pl

krom xp

  • Guest
Re: error when compiling from svn sources (25-10/2006)
« Reply #3 on: October 28, 2006, 11:08:58 am »
I have the same problem in ubuntu 6.10 with svn revision 3151, and did some debugging. The problem is because the program "autorevision.cpp" only understands English and our locale is other, so the svn messages are in other language.

A quick fix, to compile use this command:
Code
# LANG=C make

Or you can edit trunk/src/build_tools/autorevision/Makefile.am and add the LANG=C before the ./auto_revision, and then rerun bootstrap.

Or you can edit the file trunk/src/build_tools/autorevision/autorevision.cpp and find the line that says
Code
string svncmd("svn info ");
And change to look like this
Code
string svncmd("LANG=C svn info ");

Or you can wait for one patch I'm doing to use the xml output of svn.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: error when compiling from svn sources (25-10/2006)
« Reply #4 on: October 28, 2006, 11:24:47 am »

Or you can edit the file trunk/src/build_tools/autorevision/autorevision.cpp and find the line that says
Code
string svncmd("svn info ");
And change to look like this
Code
string svncmd("LANG=C svn info ");

Gonna try this today on windows and my linux box --> if ok will patch our sources like that

[EDIT] : I think the LANG=C will only work on linux, not on windows.
« Last Edit: October 28, 2006, 11:27:05 am by killerbot »

krom xp

  • Guest
Re: error when compiling from svn sources (25-10/2006)
« Reply #5 on: October 28, 2006, 11:38:40 am »
killerbot, i forgot to mention another problem of the output of `svn info`. The dates are localized, I will put one example, in english and spanish, to see the differences:
Code
xxxx@xxxx:~/program/codeblocks/trunk$ svn info
Ruta: .
URL: svn://svn.berlios.de/codeblocks/trunk
Raíz del repositorio: svn://svn.berlios.de/codeblocks
UUID del repositorio: 98b59c6a-2706-0410-b7d6-d2fa1a1880c9
Revisión: 3151
Tipo de nodo: directorio
Agendado: normal
Autor del último cambio: pecan
Revisión del último cambio: 3151
Fecha de último cambio: 2006-10-28 06:02:25 +0800 (sáb, 28 oct 2006)

xxxx@xxxx:~/program/codeblocks/trunk$ LANG=C svn info
Path: .
URL: svn://svn.berlios.de/codeblocks/trunk
Repository Root: svn://svn.berlios.de/codeblocks
Repository UUID: 98b59c6a-2706-0410-b7d6-d2fa1a1880c9
Revision: 3151
Node Kind: directory
Schedule: normal
Last Changed Author: pecan
Last Changed Rev: 3151
Last Changed Date: 2006-10-28 06:02:25 +0800 (Sat, 28 Oct 2006)


The date is "2006-10-28 06:02:25", now lets see the xml output:

Code
xxxx@xxxx:~/program/codeblocks/trunk$ svn --xml info
<?xml version="1.0" encoding="utf-8"?>
<info>
<entry
   kind="dir"
   path="."
   revision="3151">
<url>svn://svn.berlios.de/codeblocks/trunk</url>
<repository>
<root>svn://svn.berlios.de/codeblocks</root>
<uuid>98b59c6a-2706-0410-b7d6-d2fa1a1880c9</uuid>
</repository>
<wc-info>
<schedule>normal</schedule>
</wc-info>
<commit
   revision="3151">
<author>pecan</author>
<date>2006-10-27T22:02:25.150469Z</date>
</commit>
</entry>
</info>
The date is "2006-10-27 22:02:25". I think this is the 'real' date, if you dont use the xml version the dates wont be the same between build of people with diffent timezone (unless you save also the time difference).

Tell me if is ok to make a patch to use the xml version and I'll finish it.

I forgot to say LANG=C is only for linux, is other reason to use the xml output, it can be done system independent.
« Last Edit: October 28, 2006, 11:41:33 am by krom xp »

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: error when compiling from svn sources (25-10/2006)
« Reply #6 on: October 28, 2006, 12:26:57 pm »
well, we will need the insight of Thomas, he made this tool.
He's best suited to judge on the best solution.


Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: error when compiling from svn sources (25-10/2006)
« Reply #7 on: October 28, 2006, 12:42:43 pm »
Yes, the problem is that the svn client does not offer an easy way to get anything back in a sane, standardised form. Instead, all output is in human readable, but not quite so good parseable form, and localised without any option to turn that off.
Granted, a few commands recently support xml output, but that's still inconsistently available in the latest version.

The solution pointed out by krom xp is almost the good one. Subversion listens to the LANG variable, so setenv("LANG", "en"); as it was done in early versions of the svn plugin should work. I abandoned that strategy since it might affect other programs launched from Code::Blocks in an unpredictable manner, but that should not be a problem for autorevision.

Will implement the fix in the next 15-20 minutes...
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: error when compiling from svn sources (25-10/2006)
« Reply #8 on: October 28, 2006, 05:35:57 pm »
I have the same problem in ubuntu 6.10 with svn revision 3151, and did some debugging. The problem is because the program "autorevision.cpp" only understands English and our locale is other, so the svn messages are in other language.

A quick fix, to compile use this command:
Code
# LANG=C make

Lucky thing that RPM always sets LANG=C when building packages...
One less thing to worry about, so just the "bootstrap" and "pkgconfig" left.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: error when compiling from svn sources (25-10/2006)
« Reply #9 on: October 30, 2006, 12:01:27 pm »
I am now no longer to build on linux (Suse 10.1)
This is the eror message I get (and afterwards crash and backtrace) :
svn : error : cannot set LC_ALL locale
svn : error : environment variable LANG is EN
svn : error : please check that your locale name is correct

Any ideas ??

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: error when compiling from svn sources (25-10/2006)
« Reply #10 on: October 30, 2006, 12:30:49 pm »
Did you update to Subversion 1.4.0 and set your locale to english ?

I get the same warning on Mac OS X, but it still succeeds to make it.
Code
svn: warning: cannot set LC_CTYPE locale
svn: warning: environment variable LANG is EN
svn: warning: please check that your locale name is correct
src/sdk/autorevision.h:
Code
/*3157*/
#ifndef AUTOREVISION_H
#define AUTOREVISION_H


#include <wx/string.h>

#define SVN_REVISION "3157"

#define SVN_DATE     "2006-10-29 15:43:54"

namespace autorevision
{
        const unsigned int svn_revision = 3157;
        const wxString svnRevision(_T("3157"));
}



#endif
« Last Edit: October 30, 2006, 12:35:42 pm by afb »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: error when compiling from svn sources (25-10/2006)
« Reply #11 on: October 30, 2006, 01:20:38 pm »
I am now no longer to build on linux (Suse 10.1)
This is the eror message I get (and afterwards crash and backtrace) :
svn : error : cannot set LC_ALL locale
svn : error : environment variable LANG is EN
svn : error : please check that your locale name is correct

Any ideas ??

I solved this on my 10.3 OSX with LANG=en_US

LANG=EN did not work. Maybe it should be LANG=en
« Last Edit: October 30, 2006, 01:23:17 pm by Pecan »

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: error when compiling from svn sources (25-10/2006)
« Reply #12 on: October 30, 2006, 01:22:33 pm »
my svn is 1.3.0, but I get errors instead of warnings.

should we try out the en_US as permanent fix ?? (gonna try to build with that first)


YES : that did it.

will change in svn, hopefully it doesn't break for someone else now
« Last Edit: October 30, 2006, 01:28:17 pm by killerbot »

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: error when compiling from svn sources (25-10/2006)
« Reply #13 on: October 30, 2006, 01:29:10 pm »
my svn is 1.3.0, but I get errors instead of warnings.

I thought svn 1.4.0 was required now ?

Quote
should we try out the en_US as permanent fix ?? (gonna try to build with that first)

Or perhaps the usual LANG=C locale ?

edit: never mind, saw the Windows comment...
en_US it is, to cater for the least common denom
« Last Edit: October 30, 2006, 01:36:34 pm by afb »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: error when compiling from svn sources (25-10/2006)
« Reply #14 on: October 30, 2006, 01:46:03 pm »
Interesting... I even considered using LANG=jwsdhadgh or LANG=none for a while, since gettext should fall back to whatever is built-in if it can't find it (which is the desired effect). :lol:
But then, LANG=EN looked a lot nicer, so I stuck with that. Interestingly, it does not produce any kind of warning under Windows :(

I did not choose any kind of subset such as en_US because I wasn't sure which one to take  (US citizens will probably claim that en_US is without doubt the "original thing", but UK residents will not necessarily agree that this is English at all). I don't know which one is the native one. Maybe en_US and en_UK (or en_AU) are even the same for Subversion by coincidence. But honestly, I actually don't want to bother ;)

What we need is one format that's always the same, preferrably the one that's built into the Subversion binary, so it will run on every target PC. My proposal is that you try whatever doesn't give you errors, and we'll stick with that for now (until someone else complains).

Eventually, at some point in the future, I will rewrite autorevision to parse Subversion's xml output, which will once and for all end this sad story.
However, since most people still use 1.3 (which only supports that option for a small subset of commands) and some even 1.2 (which doesn't support it at all), this is currently probably not such a good idea.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."