Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » linear problem in 4.3.10?

This thread is locked; no one can reply to it. rss feed Print
 1   2 
linear problem in 4.3.10?
djeleveld
Member #1,710
December 2001

Hi All,

I have a problem with 4.3.10. Al programs seem to build ok on my system (DJGPP and Win XP), but crash on startup. I think it is a problem with linear framebuffer, my own VESA code finds that linear framebuffer is not possible but it seems like Allegro is trying to use it anyway. Here is a stacktrace..

I havent used this forum before, normally I would send to the developers mailing list, but sometimes the mailing list webpage (search/browse) is unusabely slow for me.

Best regards,

Doug Eleveld

General Protection Fault at eip=0009fa8d
eax=0014de01 ebx=000000fe ecx=00000004 edx=0014de58 esi=00000054 edi=000cd200
ebp=0014d038 esp=0014d038 program=D:\COMPILER\DJGPP\CONTRIB\ALLEGRO\TESTS\TEST.E
XE
cs: sel=01a7 base=02ac0000 limit=0016ffff
ds: sel=01af base=02ac0000 limit=0016ffff
es: sel=01af base=02ac0000 limit=0016ffff
fs: sel=0000
gs: sel=01bf base=00000000 limit=0010ffff
ss: sel=01af base=02ac0000 limit=0016ffff
App stack: [0014d200..000cd200] Exceptn stack: [000cd158..000cb218]

Call frame traceback EIPs:
0x0009fa8d __farnspokeb+9
0x00068705 __linear_putpixel8+184
0x00019349 _putpixel+53
0x0002283e __handle_mouse_input_end+166
0x000239ec _install_mouse+835
0x000126ee _main+737
0x0009e378 ___crt1_startup+176

GullRaDriel
Member #3,861
September 2003
avatar

Can't we have the piece of code that produce all that shit ?

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

Peter Wang
Member #23
April 2000

Do you know if the problem appears in older versions? The only change to vesa.c in the last two years was to silence some gcc warnings, which I was a bit wary to commit but the submitter said it worked for him. It's attached. It could be something else, though.

djeleveld
Member #1,710
December 2001

Sorry, I hadn't been more explicit, the stack trace is from the tests/test.exe program. It crashes at startup.

Earlier version of Allegro, I used to use 4.2.2, didnt have this problem.

I just checked that it doesnt seem to be a problem with dos/vesa.c. If I replace the 4.3.10 dos/vesa.c with that from 4.2.2, I still get the same crash.

Any suggestions as where to look?

Peter Wang
Member #23
April 2000

There really weren't many changes in 4.3.10 relative to 4.2.2, as far as the Allegro library was concerned (it was mainly integrating the addons). So I really don't know. Have you compiled 4.2.2 with a recent toolchain just to check that it isn't a problem introduced by using a newer compiler?

Milan Mimica
Member #3,877
September 2003
avatar

Maybe it happens because ASM is disabled in 4.3?

gnolam
Member #2,030
March 2002
avatar

Last I checked, DJGPP and XP didn't play very well together...

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

djeleveld
Member #1,710
December 2001

Disabling ASM shouldnt cause crashes on XP, should it? I tried to re-enable ASM by rooting around in makefile.dj but never got anything to build. I guess there has been some bit-rot of the ASM code so trying to re-enable is rather pointless.

I'll keep looking around, but really dont understand Allegro internals that much.
- I noticed between 4.2.2 and 4.3.10 the GFX_TABLE is has gotten bigger.
- Also the cdefsXXX.h files have changed. This would affect putpixel I assume.

X-G
Member #856
December 2000
avatar

Gnolam is right. Stop using DJGPP.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

Disabling ASM shouldnt cause crashes on XP, should it?

For a long time ASM was almost always used, while the alternative C code was hardly ever used, and thus hardly tested. Once we disabled the ASM permanently, stuff was broken. And some still could be in certian circumstances.

Reminds me.. People love autotools so much that the dependency generation script used by allegro, was completely broken for who knows how long till I tried doing some automatic builds on my server. It should be fixed in 4.3.10+ though (new script, the old was just odd).

Quote:

Gnolam is right. Stop using DJGPP.

I belive he's a DJGPP dev... Could be wrong though, but I remember him from comp.lang.djgpp (or whatever the group's name is).

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

X-G
Member #856
December 2000
avatar

I don't think that changes anything.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

djeleveld
Member #1,710
December 2001

X-G said:

Gnolam is right. Stop using DJGPP.

I dont understand your point.
DJGPP is still on the list of supported platforms.
Should we just pretend that there is no bug?

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

I don't think that changes anything.

Unless he was testing DJGPP itself with common libs on common platforms.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

X-G
Member #856
December 2000
avatar

DJGPP is a DOS compiler. Allegro supports it just fine, but you're trying to run the resulting program on a WinXP platform, and Windows has long since abandoned DOS compatibility. This is not a matter of DJGGP-Allegro not working; it's a matter of DOS-Windows.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

djeleveld
Member #1,710
December 2001

X-G said:

DJGPP is a DOS compiler. Allegro supports it just fine, but you're trying to run the resulting program on a WinXP platform, and Windows has long since abandoned DOS compatibility. This is not a matter of DJGGP-Allegro not working; it's a matter of DOS-Windows.

Sigh, what specific matter are you talking about? 4.2.2 worked just fine on XP but 4.3.10 does not. The DOS-compatability issues did not change, Allegro did. If you know what has changed in Allegro that causes this new problem, I'd like to hear it.

I just found out that doing:
make test ALLEGRO_USE_C=1 DEBUGMODE=2
on 4.2.2 causes the same crash in _farnspokeb.
So it appears that the problem is in the C code.

X-G
Member #856
December 2000
avatar

Frankly, I think it was a fluke that your earlier programs worked.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Peter Wang
Member #23
April 2000

Ok, it makes sense now. The C-only mode was originally designed for the Unix ports. Until recently even the Windows port didn't work in C-only mode. We probably just didn't test enough (or at all) on DOS when flicking the switch for 4.3.10.

If someone can fix it, that would be best. Otherwise I suppose we'll just revert to asm-mode for the DOS ports. Not so great for long term maintainability, but the DOS ports are pretty much on life support as it is.

Evert
Member #794
November 2000
avatar

Quote:

If someone can fix it, that would be best. Otherwise I suppose we'll just revert to asm-mode for the DOS ports. Not so great for long term maintainability, but the DOS ports are pretty much on life support as it is.

I think this involves the least amount of work. Not ideal as you say, but in terms of portability it's not too bad: any system running DOS will be compatible with the ASM code anyway. :P

djeleveld
Member #1,710
December 2001

I suppose nobody will mind if I keep trying to get DJGPP to run on XP with C-only. I hope somebody who knows more about internals can help me. If it works I guess its a positive for maintainability, right?

It is starting to look like a selector problem. The _default_ds() function is used for the bitmap selector which in turn gets used in the farnspoke functions for pixel setting. But the C-only version of _default_ds always returns 0, this is probably wrong. I tried changing _default_ds() to return _my_ds() and this puts the crash at other points during OS yielding (related to mouse movements?) or at gfxmode changes. Maybe _my_ds() isnt being set right for these situations. Does anyone have a quick summary about what selectors are set and when?

Second question: If people really thought the ASM code was going to be unused, why was it still in the distribution? Shouldn't it have been deleted?

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

Second question: If people really thought the ASM code was going to be unused, why was it still in the distribution? Shouldn't it have been deleted?

Probably, but at least in this case it helped prove that the C code is broken.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Evert
Member #794
November 2000
avatar

Quote:

If people really thought the ASM code was going to be unused, why was it still in the distribution? Shouldn't it have been deleted?

It will be, but until we do the default setting was changed from having it enabled to having it disabled. This makes sense because it's easier to revert if needed (as in this case) and is less work overall. ;)

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

It will be, but until we do the default setting was changed from having it enabled to having it disabled. This makes sense because it's easier to revert if needed (as in this case) and is less work overall. ;)

Which is exactly what I meant to say, and didn't. :) good thing we have more eloquent people here :D

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

GullRaDriel
Member #3,861
September 2003
avatar

Quote:

good thing we have more eloquent people here :D

Ass kiss everyone ? ;-p

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

Ass kiss everyone ? ;-p

Nah. Just stating a fact.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

GullRaDriel
Member #3,861
September 2003
avatar

That was humour, man, but now you are seriously kissing butts X-D

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

 1   2 


Go to: