Manager crashes on long outputs
Describe the bug When there is an output in your test case that exceeds 33000 characters, the manager crashes and an error shows up "The_GetPixmap: Error From CreateDIBSection" with the content "wrong parameter"
To Reproduce // Parts of my code ... // take a large(!) XML-File (Longer than 33000 chars) ${xmlstring} = OperatingSystem.Get File. ${xmlfile} ${xml} = XML.Parse ${xmlstring} XML.Log Element ${xml}
Use it in a test case with rfswarm
Expected behavior The manager should be able to handle such long output. Output should be truncated, so it doesn't crash. Maybe have an option in the settings for max length (<= 300000) of output in the manager (Who needs to have such long output there?)
Screenshots -/-
Desktop (please complete the following information):
- OS: Win10
- Browser: no browser used, testing APIs
Mobile phone (please complete the following information): -/-
Additional context I've had a discussion an that with Dave on Slack.
Relevant notes from Slack conversation: https://robotframework.slack.com/archives/C06J2Q0LGEM/p1712145589713139
Screenshot:
Translation of the message in the dialogue:
Jörg Irle 1 day ago Yes it’s “wrong parameter”
Dave Amies :flag-au: 1 day ago This is all I've found related to that error: https://syntaxbug.com/55e712a217/ but I don't remember ever using the place function it mentions, will search the code for it now. This is happening in the RFSwarm Manager? Dave Amies :flag-au: 1 day ago Just searched the code, I'm not using place function, nor do I have any arguments with relx or rely, so still not sure what's causing it, at least I can confirm it's coming from tkinter which I am using, just need to figure out what's triggering it
Dave Amies :flag-au: 23 hours ago Ok getting closer to finding the issue: Found this message comes from the tk core code that tkinter in python uses, found where the error message is triggered in this source .c file: https://core.tcl-lang.org/tk/file?name=win/tkWinPixmap.c&ci=tip Wow interesting comment: /* * Oh no! Things are still going wrong. Pop up a warning message here * (because things will probably crash soon) which will encourage * people to report this as a bug... / And then a bit further up: / * CreateBitmap tries to use memory on the graphics card. If it fails, * call CreateDIBSection which uses real memory; slower, but at least * still works. [Bug 2080533] */ So I looked up the bug: https://core.tcl-lang.org/tk/tktview/2080533fffffffffffff and https://core.tcl-lang.org/tk/tktview/2748171fffffffffffff Still not sure what to make of this, seems it's windows only issue specific to particular video cards?, I'll investigate more and see what I can find (edited)
Jörg Irle 17 hours ago I’ve got it! As the manager crashes, it has to do something with things getting displayed in the manager. Hi had several Log-Statements in my code. It’s nice for reading the log.html :slightly_smiling_face: The statement that caused the Error was “Log Element. $|my_xml}. So something in the xml that i am processing seems to be the problem. Jörg Irle 16 hours ago My XML contains, special german characters: ä, ö
Jörg Irle 16 hours ago I’m just doing a test, where I’ve replaced the special chars… Jörg Irle 16 hours ago OK, it’s not ä or ö. After replacing them, the manager still crashes :disappointed:
Jörg Irle 15 hours ago Looks like a problem with the length of the output. IF length(output) > 33000 THEN crash Jörg Irle 14 hours ago I’ve tried with several XMLs. Adding something that worked fine before, but now enlarging the length from 32861 characters in my XML (this test worked) to 33072 characters the test crashes.
Work Around
Dave Amies :flag-au: 14 hours ago So what you can do is add XML library to the exclude list, then the keywords from that library won't get reported to the manager but they'll still be in the robot log if you need to refer to the log. If I remember correctly XML library doesn't make the calls to the API server it just manipulates the XML you send or get back - is that correct? if so you probably don't need to measure the time it takes for those keywords Jörg Irle 14 hours ago That’s right. It has nothing to do with API-Calls, it’s only for handling XML. Jörg Irle 14 hours ago OK, I’ll exclude it.
Confirmed this doesn't crash on Ubuntu 22.04, as I this seems to be windows specific, will spin up a windows vm next and try to reproduce there
Hmmm Couldn't reproduce on windows 10 vm, will try changing the language settings and try again
Switching language to German didn't produce this issue either.
From information in Bug 2080533 it seems to be video card related so not sure if I'll be able to reproduce without a physical machine with the right video card.
As we know this impacts some windows machines and have confirmed from the Tcl/Tk code for windows that this is a bug in their code but they don't have the ability to reproduce it (and they have more resources than me)
I think the best course of action is to limit the length of the displayed values to 300000 characters for Windows.
- We know this impacts the manager
- we should also apply this to the preview screens in reporter as it's likely impacted as well, the report outputs (word / excel / html) can still have the full text.
These are the files I used to try and reproduce this issue Issue #186.zip
Opps I just realized the xml I was testing with was only 4,192 characters, updated big.xml to not be 33,094 characters, and retested but got the same result, not able to reproduce. The result name is so large now it needs 4 clicks on the right scroll bar to see the full name
Windows 10 screen shots:
Update regarding test case I created to reproduce this issue:
Jörg Irle 24 hours ago Hi Dave that’s strange: Your script + your data => OK My script + your data => OK Your script + my data => OK My script + my data => CRASH! :disappointed:
After further troubleshooting we confirmed
- there are no stack traces from python when this error dialogue is presented
- the manager actually keeps running, test will finish, agent is able to send logs back to manager and manager saves the agent logs
Still not able to determine what is triggering this error.
Any update, did you find out more information?