Skip to content
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

Fix broken fault reporting #1

Merged
merged 2 commits into from
Jan 1, 2017
Merged

Fix broken fault reporting #1

merged 2 commits into from
Jan 1, 2017

Conversation

pingbird
Copy link

@pingbird pingbird commented Sep 23, 2016

Before the faults would show up as an invalid string, now they work

example code:

void operatorControl() {
    printf("Hello, World!\n");
    printf("I have a good idea, lets cause a segfault!\n");
    delay(5000);
    volatile int x = *((int*) 0xFFFFFFFF) = 69;
    delay(5000);
    printf("I survived! %d\n", x);

    while (1) {
        delay(20);
    }
}

before:

Powered by PROS 2.11.0

PROS (C)2011-2014 Purdue ACM SIGBOTS
This program has ABSOLUTELY NO WARRANTY, not even an implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Hello, World!
I have a good idea, lets cause a segfault!

The VEX Cortex has stopped working!
Error cause:

after:

Powered by PROS 2.11.0

PROS (C)2011-2014 Purdue ACM SIGBOTS
This program has ABSOLUTELY NO WARRANTY, not even an implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Hello, World!
I have a good idea, lets cause a segfault!

The VEX Cortex has stopped working!
Error cause: Segmentation faul

kinda.. the last character isn't coming through

explanation:
errorMessages[status] is of type const char*
&errorMessages[status] gets a reference to the temp variable used to store the const char*
(const char*) bypasses type safety so this mistake causes no compiler errors
the raw bytes of the pointer to errorMessages[status] are sent to USART instead of the contents of errorMessages[status]

@jabibi100
Copy link
Member

Pixel thank you for discovering this! I will be sure to validate your changes as soon as my cortex is delivered to merge this change in before the beta ends.

@edjubuh edjubuh added the bug label Sep 24, 2016
Copy link
Member

@edjubuh edjubuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works!

@@ -49,7 +49,7 @@ void __attribute__((noreturn)) _exit(int status) {
}
// Dump message
if ((unsigned int)status < 5U) {
buffer = (const char *)&errorMessages[status];
buffer = errorMessages[status];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works great!

@edjubuh
Copy link
Member

edjubuh commented Nov 19, 2016

Also, we'll merge this onto the 2.11.1 branch, not master.

@edjubuh edjubuh changed the base branch from master to 2.11.1 December 1, 2016 02:07
No more last missing character
@edjubuh edjubuh added this to the 2.11.1 milestone Dec 1, 2016
@edjubuh edjubuh assigned jabibi100 and edjubuh and unassigned jabibi100 and edjubuh Dec 6, 2016
@edjubuh edjubuh merged commit d187155 into purduesigbots:2.11.1 Jan 1, 2017
@edjubuh edjubuh mentioned this pull request Jan 12, 2017
edjubuh pushed a commit that referenced this pull request Jan 30, 2019
* Create ISSUE_TEMPLATE.md

* Create PULL_REQUEST_TEMPLATE.md

* Create CONTRIBUTING.md
edjubuh added a commit that referenced this pull request Feb 10, 2019
#### Summary:
Add Azure Pipelines for building templates

#### Motivation:
It'd be nice to have standard CI builds of the kernel

##### References (optional):
<!-- If this PR is related to an issue or task, reference it here (e.g. closes #1) -->

#### Test Plan:
- [x] It build
edjubuh added a commit that referenced this pull request Feb 17, 2019
#### Summary:
```
make template
make
```
would cause the version to be updated to a dirty commit version, which would then get set as the build number (despite being a commit build)

This change does
```
make template
(Update Build number)
make
```

#### Motivation:
So that we don't see a dirty version

##### References (optional):
<!-- If this PR is related to an issue or task, reference it here (e.g. closes #1) -->

#### Test Plan:
- [x] Look at Pipeline build number
![image](https://user-images.githubusercontent.com/5461357/52889533-70220a80-314e-11e9-9972-1342bb7303a2.png)

#### Commits:
* Re-order make execution after updating build number So that we don't see a dirty version
* Try including PR ID in version
* print environ
* Fix it
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

Successfully merging this pull request may close these issues.

3 participants