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

Trivial fixes for building unix version #3

Merged
merged 2 commits into from
Dec 29, 2013

Conversation

pfalcon
Copy link
Contributor

@pfalcon pfalcon commented Dec 29, 2013

read() issue in particular breaks builds due to -Werror.

dpgeorge added a commit that referenced this pull request Dec 29, 2013
Trivial fixes for building unix version
@dpgeorge dpgeorge merged commit 319b28a into micropython:master Dec 29, 2013
@dpgeorge dpgeorge deleted the for-upstream branch December 29, 2013 18:31
@Chananyah Chananyah mentioned this pull request Jan 2, 2014
EcmaXp added a commit to OpenPythons/micropython-opencom-legacy that referenced this pull request Aug 28, 2016
turbinenreiter pushed a commit to turbinenreiter/micropython that referenced this pull request Oct 16, 2016
drrk pushed a commit to drrk/micropython that referenced this pull request Jan 22, 2017
tannewt referenced this pull request in tannewt/circuitpython Aug 20, 2018
Merge updated Circuitpython
tannewt referenced this pull request in tannewt/circuitpython Jan 15, 2019
Add latest changes on repo
cfobel pushed a commit to sci-bots/micropython that referenced this pull request Nov 26, 2019
bergzand pushed a commit to bergzand/micropython that referenced this pull request Nov 27, 2019
xobs pushed a commit to xobs/micropython that referenced this pull request Mar 24, 2020
xobs pushed a commit to xobs/micropython that referenced this pull request May 15, 2020
add standard SPI support to QSPI for external flash
xobs pushed a commit to xobs/micropython that referenced this pull request Jun 2, 2020
jgillick pushed a commit to jgillick/micropython that referenced this pull request Nov 22, 2020
Small improvements to the dictionary compression
jgillick pushed a commit to jgillick/micropython that referenced this pull request Nov 22, 2020
It was incorrect to NULL out the pointer to our heap allocated buffer in
`reset`, because subsequent to framebuffer_reset, but while
the heap was still active, we could call `get_bufinfo` again,
leading to a fresh allocation on the heap that is about to be destroyed.

Typical stack trace:
```
#1  0x0006c368 in sharpdisplay_framebuffer_get_bufinfo
micropython#2  0x0006ad6e in _refresh_display
micropython#3  0x0006b168 in framebufferio_framebufferdisplay_background
micropython#4  0x00069d22 in displayio_background
micropython#5  0x00045496 in supervisor_background_tasks
micropython#6  0x000446e8 in background_callback_run_all
micropython#7  0x00045546 in supervisor_run_background_tasks_if_tick
micropython#8  0x0005b042 in common_hal_neopixel_write
micropython#9  0x00044c4c in clear_temp_status
micropython#10 0x000497de in spi_flash_flush_keep_cache
micropython#11 0x00049a66 in supervisor_external_flash_flush
micropython#12 0x00044b22 in supervisor_flash_flush
micropython#13 0x0004490e in filesystem_flush
micropython#14 0x00043e18 in cleanup_after_vm
micropython#15 0x0004414c in run_repl
micropython#16 0x000441ce in main
```
When this happened -- which was inconsistent -- the display would keep
some heap allocation across reset which is exactly what we need to avoid.

NULLing the pointer in reconstruct follows what RGBMatrix does, and that
code is a bit more battle-tested anyway.

If I had a motivation for structuring the SharpMemory code differently,
I can no longer recall it.

Testing performed: Ran my complicated calculator program over multiple
iterations without observing signs of heap corruption.

Closes: micropython#3473
dpgeorge pushed a commit that referenced this pull request May 30, 2021
asan considers that memcmp(p, q, N) is permitted to access N bytes at each
of p and q, even for values of p and q that have a difference earlier.
Accessing additional values is frequently done in practice, reading 4 or
more bytes from each input at a time for efficiency, so when completing
"non_exist<TAB>" in the repl, this causes a diagnostic:

    ==16938==ERROR: AddressSanitizer: global-buffer-overflow on
    address 0x555555cd8dc8 at pc 0x7ffff726457b bp 0x7fffffffda20 sp 0x7fff
    READ of size 9 at 0x555555cd8dc8 thread T0
        #0 0x7ffff726457a  (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xb857a)
        #1 0x555555b0e82a in mp_repl_autocomplete ../../py/repl.c:301
        #2 0x555555c89585 in readline_process_char ../../lib/mp-readline/re
        #3 0x555555c8ac6e in readline ../../lib/mp-readline/readline.c:513
        #4 0x555555b8dcbd in do_repl /home/jepler/src/micropython/ports/uni
        #5 0x555555b90859 in main_ /home/jepler/src/micropython/ports/unix/
        #6 0x555555b90a3a in main /home/jepler/src/micropython/ports/unix/m
        #7 0x7ffff619a09a in __libc_start_main ../csu/libc-start.c:308
        #8 0x55555595fd69 in _start (/home/jepler/src/micropython/ports/uni

    0x555555cd8dc8 is located 0 bytes to the right of global variable
    'import_str' defined in '../../py/repl.c:285:23' (0x555555cd8dc0) of
    size 8
      'import_str' is ascii string 'import '

Signed-off-by: Jeff Epler <jepler@gmail.com>
sblaksono pushed a commit to sblaksono/micropython that referenced this pull request Jun 15, 2021
ksekimoto pushed a commit to ksekimoto/micropython that referenced this pull request Jul 16, 2021
asan considers that memcmp(p, q, N) is permitted to access N bytes at each
of p and q, even for values of p and q that have a difference earlier.
Accessing additional values is frequently done in practice, reading 4 or
more bytes from each input at a time for efficiency, so when completing
"non_exist<TAB>" in the repl, this causes a diagnostic:

    ==16938==ERROR: AddressSanitizer: global-buffer-overflow on
    address 0x555555cd8dc8 at pc 0x7ffff726457b bp 0x7fffffffda20 sp 0x7fff
    READ of size 9 at 0x555555cd8dc8 thread T0
        #0 0x7ffff726457a  (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xb857a)
        micropython#1 0x555555b0e82a in mp_repl_autocomplete ../../py/repl.c:301
        micropython#2 0x555555c89585 in readline_process_char ../../lib/mp-readline/re
        micropython#3 0x555555c8ac6e in readline ../../lib/mp-readline/readline.c:513
        micropython#4 0x555555b8dcbd in do_repl /home/jepler/src/micropython/ports/uni
        micropython#5 0x555555b90859 in main_ /home/jepler/src/micropython/ports/unix/
        micropython#6 0x555555b90a3a in main /home/jepler/src/micropython/ports/unix/m
        micropython#7 0x7ffff619a09a in __libc_start_main ../csu/libc-start.c:308
        micropython#8 0x55555595fd69 in _start (/home/jepler/src/micropython/ports/uni

    0x555555cd8dc8 is located 0 bytes to the right of global variable
    'import_str' defined in '../../py/repl.c:285:23' (0x555555cd8dc0) of
    size 8
      'import_str' is ascii string 'import '

Signed-off-by: Jeff Epler <jepler@gmail.com>
andrewleech pushed a commit to andrewleech/micropython that referenced this pull request Apr 12, 2022
* [Add Ameba port] Add Ameba specific port src and dependency

[Update linker] Update linker to resolve RAM shortage

* [Add ignored files] add archive lib and pre-built binaries

* [Multiple updates] Add ameba sdk as submodule, add postbild tool src, add amebad_tool, update makefile, relocate linker script

* [Update Makefile] Update makefile to be compatible with all OS when extracting embedded toolchain

* [Support and API] Add support for AMB23 RTL8722DM and update peripheral APIs

- Add hardware support for AMB23 RTL8722DM (Previously known as RTL8722DM_MINI)
- Update peripheral API for standardization
- - timer
- - ADC
- - PWM(WIP)
- Add Flash module to the port

* [Pin/GPIO] Standardize Pin module API

- Add new API and constants
- Fix a bug found with REPL under readline.c

* [PWM] Standardize PWM module API

- Add machine_pwm.c from extmod as the micropython pwm binding
- Add and update API to work like RP2 port

* [UART] Standardize UART module API

- Add new API and removing some existing ones
- Update API to comply with RP2 style

* [I2C] Standardize I2C module API

- Re-structure the I2C module to make use of the generic I2C MicroPython binding
- Add, remove and update API with be like RP2 style

* [SPI] Standardize SPI module API

- Re-structure the SPI module to make use of the MicroPython generic bindings
- Add, remove and update API to be like RP2 style

* [Readme] Update Readme to include more details

- Update README.md to include more details
- minor updates to i2c and timer module API

Co-authored-by: ambiot <ambiot123@gmail.com>
andrewleech pushed a commit to andrewleech/micropython that referenced this pull request Apr 14, 2022
* [Add Ameba port] Add Ameba specific port src and dependency

[Update linker] Update linker to resolve RAM shortage

* [Add ignored files] add archive lib and pre-built binaries

* [Multiple updates] Add ameba sdk as submodule, add postbild tool src, add amebad_tool, update makefile, relocate linker script

* [Update Makefile] Update makefile to be compatible with all OS when extracting embedded toolchain

* [Support and API] Add support for AMB23 RTL8722DM and update peripheral APIs

- Add hardware support for AMB23 RTL8722DM (Previously known as RTL8722DM_MINI)
- Update peripheral API for standardization
- - timer
- - ADC
- - PWM(WIP)
- Add Flash module to the port

* [Pin/GPIO] Standardize Pin module API

- Add new API and constants
- Fix a bug found with REPL under readline.c

* [PWM] Standardize PWM module API

- Add machine_pwm.c from extmod as the micropython pwm binding
- Add and update API to work like RP2 port

* [UART] Standardize UART module API

- Add new API and removing some existing ones
- Update API to comply with RP2 style

* [I2C] Standardize I2C module API

- Re-structure the I2C module to make use of the generic I2C MicroPython binding
- Add, remove and update API with be like RP2 style

* [SPI] Standardize SPI module API

- Re-structure the SPI module to make use of the MicroPython generic bindings
- Add, remove and update API to be like RP2 style

* [Readme] Update Readme to include more details

- Update README.md to include more details
- minor updates to i2c and timer module API

Co-authored-by: ambiot <ambiot123@gmail.com>
@schamu schamu mentioned this pull request Sep 10, 2022
cwt pushed a commit to cwt/micropython that referenced this pull request Oct 30, 2023
* [Add Ameba port] Add Ameba specific port src and dependency

[Update linker] Update linker to resolve RAM shortage

* [Add ignored files] add archive lib and pre-built binaries

* [Multiple updates] Add ameba sdk as submodule, add postbild tool src, add amebad_tool, update makefile, relocate linker script

* [Update Makefile] Update makefile to be compatible with all OS when extracting embedded toolchain

* [Support and API] Add support for AMB23 RTL8722DM and update peripheral APIs

- Add hardware support for AMB23 RTL8722DM (Previously known as RTL8722DM_MINI)
- Update peripheral API for standardization
- - timer
- - ADC
- - PWM(WIP)
- Add Flash module to the port

* [Pin/GPIO] Standardize Pin module API

- Add new API and constants
- Fix a bug found with REPL under readline.c

* [PWM] Standardize PWM module API

- Add machine_pwm.c from extmod as the micropython pwm binding
- Add and update API to work like RP2 port

* [UART] Standardize UART module API

- Add new API and removing some existing ones
- Update API to comply with RP2 style

* [I2C] Standardize I2C module API

- Re-structure the I2C module to make use of the generic I2C MicroPython binding
- Add, remove and update API with be like RP2 style

* [SPI] Standardize SPI module API

- Re-structure the SPI module to make use of the MicroPython generic bindings
- Add, remove and update API to be like RP2 style

* [Readme] Update Readme to include more details

- Update README.md to include more details
- minor updates to i2c and timer module API

Co-authored-by: ambiot <ambiot123@gmail.com>
danilom added a commit to kevinboenisch/micropython that referenced this pull request Dec 16, 2023
RetiredWizard pushed a commit to RetiredWizard/micropython that referenced this pull request Feb 12, 2024
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.

None yet

2 participants