[kicad] Need help troubleshooting my new feature -Text & graphics presets

95 views
Skip to first unread message

Jan Wichmann

unread,
Sep 16, 2024, 1:45:41 AM9/16/24
to dev...@kicad.org
Good morning KiCad developers,
I am currently working on a new feature for KiCad - Text & graphics presets.
https://gitlab.com/kicad/code/kicad/-/merge_requests/1997

Unfortunately, a memory error has crept in when changing the memory location from PCBNEW_SETTINGS to BOARD_DESIGN_SETTINGS. The error can be provoked by opening and closing the 'Board setup' dialog. KiCad Master is not affected, I was able to rule that out.

I just can't find the cause of the error. The symptom is that aLayer with value 57 is invalid and therefore generates a null pointer that is not intercepted.

I cannot find the cause. Can anyone help me?

Many thanks and best regards
Jan

Kevin Cozens

unread,
Sep 17, 2024, 12:51:36 PM9/17/24
to kicad-developers
On 2024-09-16 01:45, 'Jan Wichmann' via KiCad Developers wrote:
> Unfortunately, a memory error has crept in when changing the memory location
> from PCBNEW_SETTINGS to BOARD_DESIGN_SETTINGS. The error can be provoked by
> opening and closing the 'Board setup' dialog.
[snip]> I just can't find the cause of the error.

The IDE is showing you were the error occurs. Set a breakpoint at the if
statement then examine the variable 'control'. You want to verify that it is
not NULL. Check the variable contents. Does it have a valid address for
GetLabel()? You may need to use an temporary variable to see the contents of
control->GetLabel() before passing that to return.

I don't know the context of the functions use. It does look at little odd to
me that it is trying to get a label either from a textCtl of a layer, or
from a control on the layer.

--
Cheers!

Kevin.

https://www.patreon.com/KevinCozens | "Nerds make the shiny things that
| distract the mouth-breathers, and
Owner of Elecraft K2 #2172 | that's why we're powerful"
#include <disclaimer/favourite> | --Chris Hardwick

Jan Wichmann

unread,
Oct 12, 2024, 9:09:33 AM10/12/24
to dev...@kicad.org
Hello,

Thank you for your participation.
I have not found any errors in my code.
A rebase with the current master has fixed the problem.

--
Best regards
Jan


Am 17.09.24 um 18:51 schrieb Kevin Cozens:
Reply all
Reply to author
Forward
0 new messages