Home » Community » Newbie corner » [SOLVED] Invalid memory access on ImageDraw::Init (X11)
[SOLVED] Invalid memory access on ImageDraw::Init (X11) [message #52013] |
Thu, 04 July 2019 18:05  |
 |
Xemuth
Messages: 387 Registered: August 2018 Location: France
|
Senior Member |
|
|
Hello,
On my raspberryPi, this code :
PNGEncoder png;
png.SaveFile("temp.png", myGraph.DrawGraph()); //myGraph.DrawGraph() return me an ImageDraw
Raise an "invalid memory access" error :

Just to try, I did a "sudo chmod 777" to the folder and program and error still happening.
Do someone have any idea ?
Thanks in advance.
Have a nice day
[Updated on: Mon, 08 July 2019 08:57] Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: Invalid memory access on ImageDraw::Init (X11) [message #52020 is a reply to message #52013] |
Thu, 04 July 2019 22:55   |
 |
Xemuth
Messages: 387 Registered: August 2018 Location: France
|
Senior Member |
|
|
Ok, after recompiling with only "X11" flag and running the programm in debug Mode :
The programm crash at this line : (ImageX11.cpp, CtrlCore)
void ImageDraw::Init()
{
GuiLock __;
dw = XCreatePixmap(Xdisplay, Xroot, max(size.cx, 1), max(size.cy, 1), Xdepth); //This line generate the crash
gc = XCreateGC(Xdisplay, dw, 0, 0);
xftdraw = XftDrawCreate(Xdisplay, (Drawable) dw, DefaultVisual(Xdisplay, Xscreenno), Xcolormap);
alpha.dw = XCreatePixmap(Xdisplay, Xroot, max(size.cx, 1), max(size.cy, 1), Xdepth);
alpha.gc = XCreateGC(Xdisplay, alpha.dw, 0, 0);
alpha.xftdraw = XftDrawCreate(Xdisplay, (Drawable) alpha.dw, DefaultVisual(Xdisplay, Xscreenno), Xcolormap);
Vector<Rect> clip;
clip.Add(RectC(0, 0, size.cx, size.cy));
SystemDraw::Init(clip, Point(0, 0));
alpha.Init(clip, Point(0, 0));
has_alpha = false;
}
The PANIC message on console is :
****************** PANIC: Invalid memory access!
Invalid memory access!
X Error of failed request: BadFont (invalid Font parameter)
Major opcode of failed request: 46 (X_CloseFont)
Resource id in failed request: 0x1400002
Serial number of failed request: 23
Here is BackTrace :
----------------------------------
Thread: 1
XCreatePixmap () from /usr/lib/arm-linux-gnueabihf/libX11.so.6
Upp::ImageDraw::Init (this=0x7effd4d8) at /home/xemuth/upp/uppsrc/CtrlCore/ImageX11.cpp:270
Upp::ImageDraw::ImageDraw (this=0x7effd4d8, cx=1920, cy=1080) at /home/xemuth/upp/uppsrc/CtrlCore/ImageX11.cpp:377
GraphDotCloud::GraphDotCloud (this=0x7effd448, _XSize=1920, _YSize=1080, _GraphName=..., _XName=..., _YName=...) at /home/xemuth/Upp/myApps/GraphBuilder/GraphBuilder.cpp:729
Discord_Overwatch::DrawStatsEquipe (this=0x7effe340, payload=...) at /home/xemuth/Upp/myApps/Discord_Overwatch/Discord_Overwatch.cpp:652
Discord_Overwatch::<lambda(Upp::ValueMap)>::operator()(Upp::ValueMap) const (__closure=0x748f65d8, e=...) at /home/xemuth/Upp/myApps/Discord_Overwatch/Discord_Overwatch.cpp:54
Upp::Function<void(Upp::ValueMap)>::Wrapper<Discord_Overwatch::Discord_Overwatch(Upp::String, Upp::String)::<lambda(Upp::ValueMap)> >::Execute(Upp::ValueMap) (this=0x748f65d0, args#0=...) at /home/xemuth/upp/uppsrc/Core/Function.h:17
Upp::Function<void (Upp::ValueMap)>::operator()(Upp::ValueMap) const (this=0x74966c50, args#0=...) at /home/xemuth/upp/uppsrc/Core/Function.h:76
Discord_Overwatch::EventsMessageCreated (this=0x7effe340, payload=...) at /home/xemuth/Upp/myApps/Discord_Overwatch/Discord_Overwatch.cpp:60
SmartBotUpp::Event (this=0x7effe4f0, payload=...) at /home/xemuth/Upp/myApps/SmartUppBot/SmartBotUpp.cpp:65
SmartBotUpp::<lambda(Upp::ValueMap)>::operator()(Upp::ValueMap) const (__closure=0x748f65f8, payload=...) at /home/xemuth/Upp/myApps/SmartUppBot/SmartBotUpp.cpp:27
Upp::Function<void(Upp::ValueMap)>::Wrapper<SmartBotUpp::Launch()::<lambda(Upp::ValueMap)> >::Execute(Upp::ValueMap) (this=0x748f65f0, args#0=...) at /home/xemuth/upp/uppsrc/Core/Function.h:17
Upp::Function<void (Upp::ValueMap)>::operator()(Upp::ValueMap) const (this=0x7efff15c, args#0=...) at /home/xemuth/upp/uppsrc/Core/Function.h:76
Upp::Discord::Dispatch (this=0x7effe500, payload=...) at /home/xemuth/Upp/myApps/SmartUppBot/Discord.cpp:136
Upp::Discord::Listen (this=0x7effe500) at /home/xemuth/Upp/myApps/SmartUppBot/Discord.cpp:304
SmartBotUpp::Launch (this=0x7effe4f0) at /home/xemuth/Upp/myApps/SmartUppBot/SmartBotUpp.cpp:28
ConsoleMainFn_ () at /home/xemuth/Upp/myApps/SmartUppBot/main.cpp:25
Upp::AppExecute__ (app=0x19d54 <ConsoleMainFn_()>) at /home/xemuth/upp/uppsrc/Core/App.cpp:343
main (argc=1, argv=0x7efff5e4, envptr=0x7efff5ec) at /home/xemuth/Upp/myApps/SmartUppBot/main.cpp:14
----------------------------------
Thread: 3
nanosleep () at ../sysdeps/unix/syscall-template.S:84
Upp::Thread::Sleep (msec=41250) at /home/xemuth/upp/uppsrc/Core/Mt.cpp:407
Upp::Discord::RepeatSendHeartbeat (this=0x7effe500, ms=41250, keepRunning=...) at /home/xemuth/Upp/myApps/SmartUppBot/Discord.cpp:57
Upp::CallbackN<> Upp::callback2<Upp::Discord, Upp::Discord, int, std::reference_wrapper<std::atomic<bool> >, unsigned int, std::atomic<bool>&>(Upp::Discord*, void (Upp::Discord::*)(unsigned int, std::atomic<bool>&), int, std::reference_wrapper<std::atomic<bool> >)::{lambda()#1}::operator()() const (__closure=0x74984e98) at /home/xemuth/upp/uppsrc/Core/CallbackNP.i:38
Upp::Function<void ()>::Wrapper<Upp::CallbackN<> Upp::callback2<Upp::Discord, Upp::Discord, int, std::reference_wrapper<std::atomic<bool> >, unsigned int, std::atomic<bool>&>(Upp::Discord*, void (Upp::Discord::*)(unsigned int, std::atomic<bool>&), int, std::reference_wrapper<std::atomic<bool> >)::{lambda()#1}>::Execute() (this=0x74984e90) at /home/xemuth/upp/uppsrc/Core/Function.h:17
Upp::Function<void ()>::operator()() const (this=0x748f66b0) at /home/xemuth/upp/uppsrc/Core/Function.h:76
Upp::sThreadRoutine (arg=0x748f66b0) at /home/xemuth/upp/uppsrc/Core/Mt.cpp:83
start_thread (arg=0x7471e130) at pthread_create.c:458
/lib/arm-linux-gnueabihf/libc.so.6
My upp version is : 13469
My hardware is Raspberry pi 3b+
[Updated on: Thu, 04 July 2019 23:09] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Tue May 13 10:51:34 CEST 2025
Total time taken to generate the page: 0.00945 seconds
|