[Freeciv-Dev] [bug #18481] lua-5.1, ldebug.c compilation failure

2016-06-21 Thread Marko Lindqvist
Update of bug #18481 (project freeciv):

  Status:   Need Info => Wont Fix   
 Assigned to:None => cazfi  
 Open/Closed:Open => Closed 

___

Follow-up Comment #14:

Switched to newer lua already.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18481] lua-5.1, ldebug.c compilation failure

2012-03-29 Thread Jacob Nevins
Update of bug #18481 (project freeciv):

 Planned Release:2.3.2, 2.4.0 =>


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18481] lua-5.1, ldebug.c compilation failure

2012-03-10 Thread Marko Lindqvist
Follow-up Comment #13, bug #18481 (project freeciv):

> The thread starts here.
>
> Skimming the thread, I don't see an obvious conclusion.

Basically as this is just compiler warning (turned to error only because of
-Werror) they don't consider it lua bug, and they don't want to change working
bug-free code without good reasons. So no upstream fix to be expected.

I tried to fix this in our own copy, but setup suffering from original warning
just ended to other similar warnings once this one was fixed, and I soon gave
up. I don't want our copy of lua to fork too far from original to keep
updating it with upstream bugfixes and new versions easier.

Maybe we just disable certain warnings while compiling lua?

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18481] lua-5.1, ldebug.c compilation failure

2012-03-10 Thread Jacob Nevins
Follow-up Comment #12, bug #18481 (project freeciv):

>> Has anybody been in contact with lua folks? 
> I sent email now.
The thread starts here
.

Skimming the thread, I don't see an obvious conclusion. I take it updating to
Lua 5.1.5 didn't happen to fix this?

(This ticket is currently targeted at 2.3.2.)

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18481] lua-5.1, ldebug.c compilation failure

2012-02-07 Thread Marko Lindqvist
Follow-up Comment #11, bug #18481 (project freeciv):

> Has anybody been in contact with lua folks?

I sent email now. Looking that clang report more carefully it seems that this
can be real bug on some (rather obscure) conditions, and not just cosmetic
build warning. restorestack() gives pointer value with theoretically 7*8, or
3*8 (on 32bit systems), bits in undefined state.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18481] lua-5.1, ldebug.c compilation failure

2011-11-18 Thread Jacob Nevins

Update of bug #18481 (project freeciv):

 Planned Release:2.3.1, 2.4.0 => 2.3.2, 2.4.0   

___

Follow-up Comment #10:

This clearly isn't going to make 2.3.1, but is still desirable to fix on S2_3
for portability.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18481] lua-5.1, ldebug.c compilation failure

2011-11-16 Thread Marko Lindqvist

Follow-up Comment #9, bug #18481 (project freeciv):

> Could you report lua compile problem directly to lua project
> also? Is that problem somehow solved in system lua of your OS
> (assuming it ships with one)?

Has anybody been in contact with lua folks? This really should be fixed in
upstream and not only in our own copy (and over and over again every time we
update it)

I get similar error with clang on x86_64 Debian Wheezy with clang packet from
Sid (as there's not yet one in Wheezy). Full clang error output looks like:

  CC ldebug.o
../../../../../src.patched/dependencies/lua-5.1/src/ldebug.c:620:21: error:
cast
  from 'char *' to 'TValue *' (aka 'struct lua_TValue *') increases
required
  alignment from 1 to 8 [-Werror,-Wcast-align]
StkId errfunc = restorestack(L, L->errfunc);
^~~
In file included from
../../../../../src.patched/dependencies/lua-5.1/src/ldebug.c:21:
../../../../../src.patched/dependencies/lua-5.1/src/ldo.h:25:28: note:
instantiated from:
#define restorestack(L,n)   ((TValue *)((char *)L->stack + (n)))
 ^~
1 error generated.
make[4]: *** [ldebug.o] Error 1


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18481] lua-5.1, ldebug.c compilation failure

2011-09-25 Thread Matthias Pfafferodt

Update of bug #18481 (project freeciv):

  Status:   Fixed => Need Info  
 Assigned to: syntron => None   
 Open/Closed:  Closed => Open   

___

Follow-up Comment #8:

can't close the ticket as the applied patch does NOT fix the bug - it's only
(perhaps) a helper to find the reason

___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18481] lua-5.1, ldebug.c compilation failure

2011-09-25 Thread Matthias Pfafferodt

Update of bug #18481 (project freeciv):

  Status:None => Fixed  
 Assigned to:None => syntron
 Open/Closed:Open => Closed 


___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18481] lua-5.1, ldebug.c compilation failure

2011-09-12 Thread Matthias Pfafferodt

Follow-up Comment #6, bug #18481 (project freeciv):

The attached patch adds a lua api check if debugging is activated. perhaps
this allows us to find the reason for the lua error ...

(file #14078)
___

Additional Item Attachment:

File name: 0014-add-lua-api-check-if-debugging.patch Size:0 KB


___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18481] lua-5.1, ldebug.c compilation failure

2011-08-14 Thread Michal Mazurek

Follow-up Comment #5, bug #18481 (project freeciv):

I'm sorry, I posted to the wrong thread and didn't notice Markos answer in
bug #18482.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18481] lua-5.1, ldebug.c compilation failure

2011-08-14 Thread Michal Mazurek

Follow-up Comment #4, bug #18481 (project freeciv):


[12:12:ttypl][longturn@spock:~:4]$ cat a.c
#include 

int
main()
{
printf("%d %dn", sizeof(int), sizeof(size_t));
return 0;
}
[12:12:ttypl][longturn@spock:~:5]$ gcc a.c -o a && ./a 
4 8


Here we go, I believe this is the source of the SIGBUS. 2.2 works fine on
sparc64, here is what changed:
2.3:

./utility/registry.c:1952: int *secfile_lookup_int_vec(const struct
section_file *secfile,
./utility/registry.c:1953: size_t *dim, const
char *path, ...)
...
   3230   food_ini = secfile_lookup_int_vec(file, (size_t *)
   3231 &game.info.granary_num_inis,
   3232 "civstyle.granary_food_ini");

2.2:

./utility/registry.c:1606: int *secfile_lookup_int_vec(struct section_file
*my_section_file,
./utility/registry.c:1607:int *dimen, const char
*path, ...)
...
   3082   food_ini = secfile_lookup_int_vec(&file,
&game.info.granary_num_inis,
   3083 "civstyle.granary_food_ini");


The function secfile_lookup_int_vec() is now broken (it was good in 2.2).

I think this is what is called "strict alignment". n-byte data types must be
n-byte aligned. game.info.granary_num_inis is 4-byte aligned, and when cast to
a 8-byte data type causes the SIGBUS.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18481] lua-5.1, ldebug.c compilation failure

2011-08-13 Thread Marko Lindqvist

Follow-up Comment #3, bug #18481 (project freeciv):

> You split this bug report in two, however the following is
> relevant to both of them:

> cc1: warnings being treated as errors
> ruleset.c: In function 'load_ruleset_game':
> ruleset.c:3231: warning: cast increases required alignment of
> target type

> 3231 &game.info.granary_num_inis,

How is that related to lua compile error? Seems unrelated, except that you
get same compiler warning from both. So I really don't understand how:
> The attached diff makes the warnings go away

How can that patch touching only lua code fix ruleset.c warning in code that
has nothing to do with lua?!?


Could you report lua compile problem directly to lua project also? Is that
problem somehow solved in system lua of your OS (assuming it ships with one)?


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18481] lua-5.1, ldebug.c compilation failure

2011-08-11 Thread Michal Mazurek

Follow-up Comment #2, bug #18481 (project freeciv):

It does not make the warning go away. The attached diff does, however I have
no idea what consequences it might have. I don't use LUA, I can't really test
it.

You split this bug report in two, however the following is relevant to both
of them:

cc1: warnings being treated as errors
ruleset.c: In function 'load_ruleset_game':
ruleset.c:3231: warning: cast increases required alignment of target type

And ruleset.c:3231 is:

   3230   food_ini = secfile_lookup_int_vec(file, (size_t *)
   3231 &game.info.granary_num_inis,
   3232 "civstyle.granary_food_ini");

secfile_lookup_int_vec, where the bus error occurs.

The attached diff makes the warnings go away, but not the problem. I believe
the "patched" lua code will produce more bus errors, regardless of the type
the pointers are cast to. The solution to this is make a temporary variable,
and copy stuff to it. That way it will be aligned. If not that, then add some
__alignment__ (8) attribute to that LUA struct.

Here is a relevant document:
http://cmynhier.blogspot.com/2008/10/memory-alignment-on-sparc-or-300x.html

(file #13833)
___

Additional Item Attachment:

File name: fc.diffSize:1 KB


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18481] lua-5.1, ldebug.c compilation failure

2011-08-10 Thread Marko Lindqvist

Follow-up Comment #1, bug #18481 (project freeciv):

Can you test if attached patch makes error to go away.

This is definitely not suitable patch for committing (being gcc specific) but
it can be used to determine if problem is in restorestack() cast from char *
to TValue *.

(file #13831)
___

Additional Item Attachment:

File name: AlignedRestoreStack_18481.diff Size:0 KB


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18481] lua-5.1, ldebug.c compilation failure

2011-08-10 Thread Marko Lindqvist

URL:
  

 Summary: lua-5.1, ldebug.c compilation failure
 Project: Freeciv
Submitted by: cazfi
Submitted on: Wed 10 Aug 2011 11:03:58 PM EEST
Category: bootstrap
Severity: 3 - Normal
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 
 Discussion Lock: Any
Operating System: None
 Planned Release: 2.3.1, 2.4.0

___

Details:

Reported by Michal Mazurek  as part of bug #18468:

cc1: warnings being treated as errors
ldebug.c: In function 'luaG_errormsg':
ldebug.c:620: warning: cast increases required alignment of target type
gmake[4]: *** [ldebug.o] Error 1
gmake[4]: Leaving directory
`/home/longturn/src/freeciv-2.3.0/dependencies/lua-5.1/src'
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory
`/home/longturn/src/freeciv-2.3.0/dependencies/lua-5.1'
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory `/home/longturn/src/freeciv-2.3.0/dependencies'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/home/longturn/src/freeciv-2.3.0'
gmake: *** [all] Error 2




___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev