Skip to content

null pointer with symbolic links #424

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
d-a-v opened this issue Sep 23, 2019 · 0 comments · Fixed by #421
Closed

null pointer with symbolic links #424

d-a-v opened this issue Sep 23, 2019 · 0 comments · Fixed by #421
Milestone

Comments

@d-a-v
Copy link
Contributor

d-a-v commented Sep 23, 2019

Bug Report

Current behavior

$ ls -al x y z w

lrwxrwxrwx   1 user user    1 Sep 22 17:25 y -> x      <- y is a symbolic link to x

w:
-rw-r--r--   1 user user    35 Sep 24 00:48 w.ino

x:
-rw-r--r--   1 user user    35 Sep 24 00:48 y.ino

z:
drwxr-xr-x   2 user user  4096 Sep 24 00:41 z.ino      <- z.ino is a directory

$ cat y/y.ino
void setup () { }
void loop () { }

$ cat w/w.ino
void setup () { }
void loop () { }

$ arduino-cli  compile --fqbn arduino:avr:nano y
(segfaults)

$ arduino-cli  compile --fqbn arduino:avr:nano z
(segfaults)

$ arduino-cli  compile --fqbn arduino:avr:nano w
(works)

Symbolic link as sketch directory fails with a segmentation fault.
Directory instead of a file fails with a segmentation faults (dup #358)

Expected behavior

Symbolic link as sketch directory should work.
Directory instead of a file may fail with an error message.

Environment

  • CLI version (output of arduino-cli version): arduino-cli Version: 0.0.0-git Commit:
    git describe --tag: 0.3.7-alpha.preview-143-gafdf609
  • OS and platform: Linux avr

Additional context

none

@masci masci added this to the 0.6.0 milestone Oct 1, 2019
@masci masci added the kind/bug label Oct 1, 2019
@rsora rsora modified the milestones: 0.6.0, 0.7.0 Oct 21, 2019
rsora pushed a commit that referenced this issue Oct 24, 2019
rsora pushed a commit that referenced this issue Oct 29, 2019
rsora pushed a commit that referenced this issue Oct 30, 2019
…onality (#462)

* add testcases to cover #358 (Symbolic link as sketch directory) and #424 (folder with .ino extension)

* add test to check error throw on symlink loop detection

* create symlink via test code to ensure cross platform creation

* fixed assert to make the check cross platform

* fixed all symlink check asserts to make the check cross platform

* nitpicking
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 a pull request may close this issue.

3 participants