Are there any known issues with the combo in the topic?
Trying to debug a difference in behaviour in a program between Qemulator and QPC2 and narrowed it down to a 4k buffer as a local variable which seems to be corrupting something to do with file handling. When I move the buffer to a global variable it moves the issue to the next place a 4k buffer is used locally.
Before I replace these with malloc I thought I would check with the QDOS gods!
C68 4k Buffers on Stack SMSq/e
Re: C68 4k Buffers on Stack SMSq/e
What's the dataspace you have given to that job?
What's the value of the global variable _stack (that's the stack size given to your job, and default is 2kBytes only)?
Tobias
What's the value of the global variable _stack (that's the stack size given to your job, and default is 2kBytes only)?
Tobias
ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
- XorA
- Site Admin
- Posts: 1629
- Joined: Thu Jun 02, 2011 11:31 am
- Location: Shotts, North Lanarkshire, Scotland, UK
Re: C68 4k Buffers on Stack SMSq/e
Whatever C68 said it was in the Xtcc fieldtofro wrote:What's the dataspace you have given to that job?
That would certainly explain the problem as the stack of the program is certainly well over 16k (old unix program).What's the value of the global variable _stack (that's the stack size given to your job, and default is 2kBytes only)?
Id have to look at the value when Im next at devel machine!
Re: C68 4k Buffers on Stack SMSq/e
Simply increase the stack space of your program by placing an
declaration somewhere in your program (to set the stack to 16k, for example) and you're done.
Tobias
Code: Select all
extern long _stack = 16384;
Tobias
ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
- XorA
- Site Admin
- Posts: 1629
- Joined: Thu Jun 02, 2011 11:31 am
- Location: Shotts, North Lanarkshire, Scotland, UK
Re: C68 4k Buffers on Stack SMSq/e
Thanks Tobias, saved me hours of puzzling 
Is this info somewhere modern PC readable these days? Trying to apply my *nix C skills to QL!

Is this info somewhere modern PC readable these days? Trying to apply my *nix C skills to QL!
Re: C68 4k Buffers on Stack SMSq/e
Dilwyn has some of the C68 manuals on his homepage as e-book and pdf here:
http://www.dilwyn.me.uk/docs/ebooks/index.html
Tobias
http://www.dilwyn.me.uk/docs/ebooks/index.html
Tobias
ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO