crash on typing in category during add due to inconsistent XML

Bug #1889659 reported by Miser
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
HomeBank
Fix Released
Low
Maxime DOYEN

Bug Description

I am using Homebank 5.4.2 with Linux Mint 20 Ulyana Cinnamon. I am running GTK+ 3.24.20. When I click Add and type into Category the app crashes.
My specs:https://termbin.com/qdoy0
My stack trace:https://termbin.com/d7ww

Revision history for this message
Maxime DOYEN (mdoyen) wrote :

the crash is in g_utf8_normalize (so glib)
what is your test scenario (what do you type?
what is your locale ?
do you reproduce this with an empty file or the example file ?

Changed in homebank:
status: New → Incomplete
Revision history for this message
Miser (emcvenom) wrote :

I type any letter, number or symbol. It crashes immediately.
My locale;
LANG=en_GB.UTF-8
LANGUAGE=en_GB
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC=om_KE.UTF-8
LC_TIME=en_GB.UTF-8
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY=om_KE.UTF-8
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER=om_KE.UTF-8
LC_NAME=om_KE.UTF-8
LC_ADDRESS=om_KE.UTF-8
LC_TELEPHONE=om_KE.UTF-8
LC_MEASUREMENT=om_KE.UTF-8
LC_IDENTIFICATION=om_KE.UTF-8
LC_ALL=

I tried changing locale. The result were the same.
I cannot recreate with an empty file.
I do not have the example file. It pops an "I/O error for file '/usr/share/homebank/datas/example.xhb'."

Revision history for this message
Maxime DOYEN (mdoyen) wrote :

If 'I cannot recreate with an empty file.'
it means the problem is in your xhb file, one of your category makes glib g_utf8_normalize() crash.

check that it is well UTF-8, with a validator
you can try to isolate the category with G_DEBUG=all <path_to_homebank_executable>
or if you compiled from source, with g_print around lines 311 in ui-category.c

Changed in homebank:
importance: Undecided → Low
Revision history for this message
Maxime DOYEN (mdoyen) wrote :

last:
if you anonymize your file and save the result as a new filename (take care)
if the crash do not occurs, then your file is definitely the source

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for HomeBank because there has been no activity for 60 days.]

Changed in homebank:
status: Incomplete → Expired
Revision history for this message
Maxime DOYEN (mdoyen) wrote :

@David:
As said here, before it expires, I did not reproduced this.
what was your previous version, if you can remind it ?

Changed in homebank:
status: Expired → New
status: New → Incomplete
Revision history for this message
Maxime DOYEN (mdoyen) wrote :

David:
do you run linux or windows ?
what is your glib version ?

Revision history for this message
David Calladine (calladine) wrote : Re: [Bug 1889659] Re: Homebank crashes on typing in category during add.

Maxine,

I am running on Windows. I don't remember exactly my previous version.
It may have been 5.2 or earlier.

On 11/15/2020 3:39 PM, Maxime DOYEN wrote:
> David:
> do you run linux or windows ?
> what is your glib version ?
>

Revision history for this message
David Calladine (calladine) wrote :

As I said it's Windows.  I can't find a GLIB version but it says that it
is running GTK+ 3.24.18

On 11/15/2020 3:39 PM, Maxime DOYEN wrote:
> David:
> do you run linux or windows ?
> what is your glib version ?
>

Revision history for this message
Maxime DOYEN (mdoyen) wrote : Re: Homebank crashes on typing in category during add.

if you anonymize your file and save the result as a new filename (take care) ?
if the crash do not occurs, then your file is definitely the source

Changed in homebank:
status: Incomplete → New
status: New → Incomplete
importance: Low → Medium
Revision history for this message
Maxime DOYEN (mdoyen) wrote :

1) can one (or both of can export and provide the exported file of categories ?
(goes to manage categories, menu button top/right and export as csv)

or better open you file with a text editor and copy/paste any <cat ... into a new file you add as attachement here

2) forgot to ask from wich window/dialog the crash occurs: is it when you add a txn, manage category, scheduled, other ?

Revision history for this message
David Calladine (calladine) wrote : Re: [Bug 1889659] Re: Homebank crashes on typing in category during add.

The crash happens when I type in the category window and it tries to
look up the entry.

categories.csv is attached.

On 1/9/2021 5:22 AM, Maxime DOYEN wrote:
> 1) can one (or both of can export and provide the exported file of categories ?
> (goes to manage categories, menu button top/right and export as csv)
>
> or better open you file with a text editor and copy/paste any <cat ...
> into a new file you add as attachement here
>
> 2) forgot to ask from wich window/dialog the crash occurs: is it when
> you add a txn, manage category, scheduled, other ?
>

Revision history for this message
Maxime DOYEN (mdoyen) wrote : Re: Homebank crashes on typing in category during add.

still don't reproduce :(
the code here did not changed since 5.2 minimum, so I still think of a glib problem

1) what I did:
- open a clean new file
- create an account named test
- open manage category dialog
- import your csv file

2) as you initially say it s in txn add dialog, and now in category window, not sure so:
- try to search into the list in manage category: no crash
- tried to autocomplete form the add transaction dialog: no crash

=> can you test with the same way to see if you get a crash ?

3) what the command: dpkg -l | grep libglib gives ?
(to define your glib version)

4) @miser: if you can provide again a glib backtrace here, your link is 404 now

5) @david: on windows, can you follow the steps here: http://homebank.free.fr/en/troubleshooting.php#debug

Maxime DOYEN (mdoyen)
summary: - Homebank crashes on typing in category during add.
+ crash on typing in category during add.
Revision history for this message
David Calladine (calladine) wrote : Re: [Bug 1889659] Re: crash on typing in category during add.

Maxine,

I found the issue.  As you suggested, I opened the .xhb with Notepad and
found an incorrect cat entry.  I corrected the format to match the
others and now it works fine.  Thank you for your help.  You can close
this issue as successful.

David Calladine

On 1/11/2021 1:17 PM, Maxime DOYEN wrote:
> ** Summary changed:
>
> - Homebank crashes on typing in category during add.
> + crash on typing in category during add.
>

Revision history for this message
Maxime DOYEN (mdoyen) wrote : Re: crash on typing in category during add.

Hi David,

Can you give me more detail ?
I want to ensure, the program cannot be the source of the problem of format !

thx

Changed in homebank:
assignee: nobody → Maxime DOYEN (mdoyen)
milestone: none → 5.5.1
status: Incomplete → New
Maxime DOYEN (mdoyen)
Changed in homebank:
importance: Medium → Low
Revision history for this message
David Calladine (calladine) wrote : Re: [Bug 1889659] Re: crash on typing in category during add.

Maxime,

About the time I upgraded the program I had used the mange categories
function.  It apparently left a NULL entry in the file. I cleared that
entry by first manually editing the file to correct the syntax of the
line.  Then I used the manage category function to delete the entry
altogether.

So while the upgrade did not cause the issue, the mange category
function did corrupt the file.

Hope this helps, and thanks for your help!

On 2/6/2021 4:51 AM, Maxime DOYEN wrote:
> Hi David,
>
> Can you give me more detail ?
> I want to ensure, the program cannot be the source of the problem of format !
>
> thx
>
> ** Changed in: homebank
> Status: Incomplete => New
>
> ** Changed in: homebank
> Milestone: None => 5.5.1
>
> ** Changed in: homebank
> Assignee: (unassigned) => Maxime DOYEN (mdoyen)
>

Revision history for this message
Maxime DOYEN (mdoyen) wrote : Re: crash on typing in category during add.

It apparently left a NULL entry in the file. I cleared that
entry by first manually editing the file to correct the syntax of the
line.
=> what was the exact syntax ?

<cat key="1" name="null"/>
<cat key="2" name="(null)"/>

something else ?

Revision history for this message
David Calladine (calladine) wrote : Re: [Bug 1889659] Re: crash on typing in category during add.

The line was something like this.

<cat key="1" name=/>

When you would export the file it would call it null. But with the syntax wrong every time the program would open the file it would crash.

On 2/6/2021 11:39 AM, Maxime DOYEN wrote:
> It apparently left a NULL entry in the file. I cleared that
> entry by first manually editing the file to correct the syntax of the
> line.
> => what was the exact syntax ?
>
> <cat key="1" name="null"/>
> <cat key="2" name="(null)"/>
>
> something else ?
>

Revision history for this message
Maxime DOYEN (mdoyen) wrote : Re: crash on typing in category during add.

Ok, I managed to reproduce the crash with:
<cat key="1"/>

BUT, I can't figure out how such an XML fragment ended up into the file.

summary: - crash on typing in category during add.
+ crash on typing in category during add due to inconsistent XML
Changed in homebank:
status: New → In Progress
Revision history for this message
Maxime DOYEN (mdoyen) wrote :

ok, found

Revision history for this message
Maxime DOYEN (mdoyen) wrote :

if you rename a category with space (or several space)
=> I secured that for every item: acc, cat, pay, asg

Changed in homebank:
status: In Progress → Fix Committed
Revision history for this message
Miser (emcvenom) wrote :

Thanks to both of you I fixed the issue. I used notepad to open the .xhb file and deleted a <cat key="140"/>. It worked and I am pleased. I am grateful for the help and support.

Maxime DOYEN (mdoyen)
Changed in homebank:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.