[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#216849: [sparc] Re: Bug#216849: relocation overflow error



Le 22.10.03, Ben Collins a tapoté :

| This is a bug in the code. Too much allocation on the stack:
|
| int read_infos (int socket_data, char **infos) {
|     int  nb;
|     char datas[SSIZE_MAX];
|
|     /* SSIZE_MAX = 2147483647 */
|
| That's 2 gigs of stack allocation...not likely to happen :) It produces

	Oups. I made a %s/ change without checking all results :) I
	appologize.


| this overflow of stack in assembly:
|
| read_infos:
| .LLFB46:
| 	.loc 1 197 0
| 	!#PROLOGUE# 0
| 	save    %sp, --2147483544, %sp
|
| Notice the double negative, produces by overflowing the stack pointer,

	I'm not very familiar with compilers internals but (I once made
	a code-generator, that's all) but how can a double negative can
	happen ?


| which only uses, internally, a signed int. That is plenty enough to hold
| a normal, legal stack, but not really enough for your needs.

	Ok. So wouldn't it be more usefull to get a compiler message that
	is more explicit ?


| If you need that much (I can't see that you would), then malloc it.

	I don't need that much, in fact. I just need to ensure that what
	is send from one side of a client/server connection is fully
	received at the other side...


	Thank you for all you help !


Thomas
-- 
BOFH excuse #414:
Tachyon emissions overloading the system.



Reply to: