ngscopeclient / scopehal

Test and measurement hardware abstraction library and protocol decodes. This is the library only. Most users should use scopehal-apps.
BSD 3-Clause "New" or "Revised" License
216 stars 97 forks source link

Crash if agilent driver is used on RS scope #433

Open fsedano opened 3 years ago

fsedano commented 3 years ago

Used wrong driver by mistake (used agilent on an RS scope), got a crash. Probably worth doing some sanitization and fail more gracefully.

fsedano@fsedano-NUC8i5BEH:~/scopehal-apps/build/src/glscopeclient$ ./glscopeclient --debug m:agilent:lan:192.168.30.139
Warning: glscopeclient works best with the OMP_WAIT_POLICY environment variable set to PASSIVE
Detecting CPU features...
    * AVX2

OpenCL support: not present at compile time. GPU acceleration disabled.

Connecting to SCPI oscilloscope at 192.168.30.139:5025
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::substr: __pos (which is 18446744073709551615) > this->size() (which is 2)
Aborted (core dumped)
fsedano@fsedano-NUC8i5BEH:~/scopehal-apps/build/src/glscopeclient$ 
azonenberg commented 3 years ago

Transferring this to scopehal as it's a driver issue not a UI problem.

azonenberg commented 3 years ago

This is probably a more general issue, most drivers should sanity check the *IDN? and make sure that they're being invoked on a compatible instrument.