|
Problem with display destruction order |
Vaelin
Member #15,896
March 2015
|
If I run the code below without the reversing I get an error: Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 159 (ATIFGLEXTENSION) Minor opcode of failed request: 73 () Value in failed request: 0x1200004 Serial number of failed request: 203 Current serial number in output stream: 205
Is this a bug or am I missing something? 1#include <iostream>
2#include <vector>
3#include <allegro5/allegro.h>
4#include <algorithm>
5
6int main()
7{
8 if(!al_init()) {
9 fprintf(stderr, "failed to initialize allegro!\n");
10 return -1;
11 }
12
13 std::vector<ALLEGRO_DISPLAY*> v;
14
15 for (uint i = 0; i < 10; ++i)
16 {
17 v.push_back(al_create_display(320, 240));
18 }
19
20 std::reverse(v.begin(), v.end());
21
22 for (uint i = 0; i < 10; ++i)
23 {
24 al_set_target_bitmap(nullptr);
25 al_destroy_display(v[i]);
26 }
27
28 return 0;
29}
|
pkrcel
Member #14,001
February 2012
|
That's an error with the AMD video driver, following what google says. It's kinda weird, looking from here, there would be no strict need to reverse the order of destruction of displays... I don't think this strictly relates to Allegro, but a fellow Linux user mught try this out on a different platform It is unlikely that Google shares your distaste for capitalism. - Derezo |
SiegeLord
Member #7,827
October 2006
|
I can reproduce this (also with an AMD card). The error message comes about after a call to XCloseDisplay in src/x/xystem.c:127. Not sure what the issue is just yet. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Thomas Fjellstrom
Member #476
June 2000
|
I'm curious if it happens with any number of displays? 2? 3? 5? 10? Maybe AMD has a stupid limit to the number of display contexts open? -- |
SiegeLord
Member #7,827
October 2006
|
I got it to happen with just two displays. EDIT: I should note that, perhaps obviously, the real issue is whether or not the first display created is destroyed before any other display is destroyed. Something in the code makes the first display special, such that when it gets destroyed, it invalidates something somewhere. I don't really know where to start, however. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
beoran
Member #12,636
March 2011
|
Well then, the time being, let's document this limitation. |
pkrcel
Member #14,001
February 2012
|
Is this related to linux only and AMD cards only maybe? I'm sorry I can't be more helpful but I am unable to run anything Allegro related by now. It is unlikely that Google shares your distaste for capitalism. - Derezo |
Thomas Fjellstrom
Member #476
June 2000
|
SiegeLord said: I don't really know where to start, however. If what you said is the case, maybe allegro is telling it to invalidate all contexts created by the app? Or if context sharing is enabled, the first one is probably the "parent" context, and manages the resources, where as the rest of them are sharing the resources of the main one (though I didn't think we supported that yet). -- |
J-Gamer
Member #12,491
January 2011
|
I can attest that it seems to be a Linux-only bug, tried on Windows with an AMD card, no crash. " There are plenty of wonderful ideas in The Bible, but God isn't one of them." - Derezo |
pkrcel
Member #14,001
February 2012
|
Shoudl try forcing use of the OPENGL driver thou. It is unlikely that Google shares your distaste for capitalism. - Derezo |
Thomas Fjellstrom
Member #476
June 2000
|
There is only one driver on linux. OpenGL. Unless of course you mean he should test with forcing opengl on windows... then never mind. . -- |
SiegeLord
Member #7,827
October 2006
|
What'd really be useful is if someone tested this with anything but an AMD card on Linux . "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Izual
Member #2,756
September 2002
|
Lubuntu Linux The program compiles, runs and exits without any errors.
|
SiegeLord
Member #7,827
October 2006
|
Izual, just to be sure, did you comment out the std::reverse call in that code? The code is set to work ok by default and you need to do that modification to trigger the issue (on AMD cards at least). "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Izual
Member #2,756
September 2002
|
Duh, so much for reading only the last post carefully. I have set-up allegro on my work notebook. It has some kind of Intel gen3 VGA. The results are the same, compiles, runs and exits without any error. When i get home i will try it on my Nvidia card again. EDIT:
|
SiegeLord
Member #7,827
October 2006
|
Awesome, thanks Izual. You're a very tedious boss in Diablo II btw. NVidia is known to be more tolerant to garbage input, but at least this means we're not doing something so crazy that even NVidia rejects it. Since it works on Intel, however, it does seem like it might be AMD only... I'm not sure how to proceed though, hah. Ideally we'd find some workaround, since AMD is our #1 platform (because it's what I use on my desktop ). "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
|