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

Fixes for various issues against 2015.12 #679

Merged
merged 6 commits into from
Jan 5, 2016

Conversation

eugeneia
Copy link
Member

Issue #666

Print meaningful error message when unable to create /var/run/snabb:

$ ./snabb
core/shm.lua:111: Unable to create /var/run/snabb: Permission denied
stack traceback:
    core/main.lua:126: in function <core/main.lua:124>
    [C]: in function 'assert'
    core/shm.lua:111: in function 'mkdir'
    core/shm.lua:84: in function 'map'
    core/counter.lua:48: in function 'open'
    core/app.lua:28: in main chunk
    [C]: in function 'require'
    core/main.lua:116: in function 'initialize'
    core/main.lua:35: in function <core/main.lua:32>
    [C]: in function 'xpcall'
    core/main.lua:155: in main chunk
    [C]: at 0x0044fa80
    [C]: in function 'pcall'
    core/startup.lua:1: in main chunk
    [C]: in function 'require'
    [string "require "core.startup""]:1: in main chunk

Issue #658

  • Print useful error message when unable to open PCI device:

(When the target device of device_info does not exist)

$ sudo SNABB_PCI0="0000:05:00.0" SNABB_PCI1="0000:05:00.1" ./snabb snsh -t apps.intel.intel_app
selftest: intel_app
lib/hardware/pci.lua:38: No such device: 0000:05:00.0
stack traceback:
    core/main.lua:126: in function <core/main.lua:124>
    [C]: in function 'assert'
    lib/hardware/pci.lua:38: in function 'device_info'
    apps/intel/intel_app.lua:150: in function 'selftest'
    program/snsh/snsh.lua:29: in function <program/snsh/snsh.lua:29>
    core/lib.lua:405: in function 'dogetopt'
    program/snsh/snsh.lua:63: in function 'run'
    core/main.lua:58: in function <core/main.lua:32>
    [C]: in function 'xpcall'
    core/main.lua:155: in main chunk
    [C]: at 0x0044fa80
    [C]: in function 'pcall'
    core/startup.lua:1: in main chunk
    [C]: in function 'require'
    [string "require "core.startup""]:1: in main chunk

(When the selected device exists but is not suitable)

$ sudo SNABB_PCI0="0000:04:00.0" SNABB_PCI1="0000:04:00.1" ./snabb snsh -t apps.intel.intel_app
selftest: intel_app
SNABB_PCI_INTEL[0|1]/SNABB_PCI[0|1] not set or not suitable.
  • Make packetblaster bail out if no suitable devices are selected:
$ sudo ./snabb packetblaster replay program/snabbnfv/test_fixtures/pcap/64.pcap 0000:05:00.0
program/packetblaster/packetblaster.lua:49: <PCI> matches no suitable devices.
stack traceback:
    core/main.lua:126: in function <core/main.lua:124>
    [C]: in function 'assert'
    program/packetblaster/packetblaster.lua:49: in function 'run'
    core/main.lua:58: in function <core/main.lua:32>
    [C]: in function 'xpcall'
    core/main.lua:155: in main chunk
    [C]: at 0x0044fa80
    [C]: in function 'pcall'
    core/startup.lua:1: in main chunk
    [C]: in function 'require'
    [string "require "core.startup""]:1: in main chunk

Issue #579

Make snabbnfv traffic warn when the configuration file does not exist
initially:

BINARY    2.0M snabb
$ sudo ./snabb snabbnfv traffic 0000:03:00.1 foobar baz
snabbnfv traffic starting
WARNING: File 'foobar' does not exist.
load: time: 1.00s  fps: 0         fpGbps: 0.000 fpb: 0   bpp: -    sleep: 100 us
[...]

@lukego
Copy link
Member

lukego commented Jan 4, 2016

Great! Merged onto next, sorry about the wait.

What do you think about a future policy of suppressing stacktraces for well-defined detected errors? (Showing them only for unexpected errors caused by bugs.) For example with a main.fatal(msg...) function to print and terminate. That would seem friendly to end-users.

@petebristow
Copy link
Contributor

Suppressing stack traces for configuration/setup errors and the like would be great.

@eugeneia
Copy link
Member Author

eugeneia commented Jan 4, 2016

In that case I would like to retain the ability to always print stack traces (a debug option or similar). I understand that end users might be put off by stack traces but I think developers profit from seeing the guts no matter how trivial the error.

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