Skip to content

Code Errors (two) #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
GeneMosher opened this issue May 11, 2021 · 5 comments
Closed

Code Errors (two) #117

GeneMosher opened this issue May 11, 2021 · 5 comments

Comments

@GeneMosher
Copy link
Member

Two code errors which cause a program exit have been reported. To see them, Logon as Editor (User ID 42) > Start > Manager's Gateway

First code error: > Reports > Receipts Balance

The next page which should appear is System Page -62, Accountant's Report. Sometimes the program exits before System Page -62 displays and sometimes the program exits after System Page -62 displays but when any button on System Page -62 is selected.

Second code error: > Configuration > Customize Job Titles, Families, Phrases

The program exits when Page 13 (of 16) is selected.

Hopefully it's useful to mention that both of these program exits have shown themselves and were fixed in the past.

@NeroBurner
Copy link
Contributor

Can't reproduce segfault 1


Segfault 2 is because Page 13 has no last label entry and my Str class doesn't like nullptr as argument to Set(const char*). What is the expected behavior on this page for the last form? I would either set the label to an empty string, then the input field is visible, but has no label on the left (see screenshot below). Or I could disable the form in this case and there would be no last entry visible

20210511_viewtouch_page13

The line with the segfault:

f->label.Set(PhraseData[idx].text);

f->label.Set(PhraseData[idx].text);

PhraseData[idx].text is a nullptr

@NeroBurner
Copy link
Contributor

I did some more digging for the second segfault: I recommend to update the PhraseData for this page 13 by removing the following line:

{12, FamilyName[31]},

The FamilyName[31] entry is a reference to NULL, (last entry of the following block):

viewtouch/main/labels.cc

Lines 297 to 307 in 4404676

const genericChar* FamilyName[] = {
"A La Carte", "Appetizer", "Breakfast Entree",
"Burger", "Lunch Entree", "Light Dinner",
"Dinner Entree", "Soup", "Child Menu",
"Dessert", "Salad", "Sandwich", "Seafood",
"Side Order", "Pizza", "Specialty", "Specialty Entree",
"Banquet", "Bakery",
"Beverage", "Beer", "Bottled Beer",
"Wine", "Bottled Wine", "Alcohol", "Cocktail",
"Malt Beverage", "Modifier", "Reorder",
"Merchandise", "Room", NULL};

@NeroBurner
Copy link
Contributor

Page 13 of 16 with labels.cc updated

image

NeroBurner added a commit to NeroBurner/viewtouch that referenced this issue May 11, 2021
Page 13 of 16 (page index 12) has a reference to FamilyName[31], which
is a char* pointer initialized with `NULL`. When this `nullptr` is
passed to `Str::Set(const char *)` this results in a Segmentation fault.

Fixes: ViewTouch#117
@NeroBurner
Copy link
Contributor

reopen for the first segfault in "Receipts Balance" not yet fixed

@GeneMosher
Copy link
Member Author

GeneMosher commented May 11, 2021

Thanks for the prompt code repair, NeroBurner ! I made a clean start of the /usr/viewtouch/dat directory and was able to determine that the first of the two Code Errors I made mention of here seems to be a file corruption issue. I intend to issue a new microSD image soon to rectify this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants