Skip to content

Update liblistserial to 1.1.3 #4971

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

Merged
merged 1 commit into from
Jul 22, 2016
Merged

Conversation

facchinm
Copy link
Member

Could solve #4696, includes arduino/libserialport@d24994c

PR for @ArduinoBot

@HorstBaerbel
Copy link

HorstBaerbel commented May 19, 2016

Thanks, but does not work for me (tm). Crash log from the Windows _debug.exe version:

@facchinm
Copy link
Member Author

@HorstBaerbel , can I ask you to run listSerialC.exe from http://downloads.arduino.cc/liblistSerials/liblistSerials-1.1.1.zip and report the results here?
The command needs to be run from a cmd shell
Thank you very much

@HorstBaerbel
Copy link

The program crashes with an Access Violation. If you compile with debug information I can tell you where exactly. I have VS2013 installed for debugging.

@facchinm
Copy link
Member Author

I can only compile it using mingw at the moment, so I can try sending you a binary compiled with -g (if it can be useful).
Otherwise the sources are here, if you could compile and debug on your PC with VS I'd be EXTREMELY grateful 😄

@facchinm
Copy link
Member Author

Before unfolding the debugger, can you try running the same small executable after setting LIBSERIALPORT_DEBUG environment variable?
set LIBSERIALPORT_DEBUG=1 should be enough

@HorstBaerbel
Copy link

sp: sp_list_ports(0028FEA4) called.
sp: Enumerating ports.
sp: Opening registry key.
sp: Querying registry key value and data sizes.
sp: Iterating over values.
sp: Found port COM5.
sp: sp_get_port_by_name_desc(COM5, 007E0F00) called.
sp: Building structure for port COM5.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name_desc returning SP_OK.
sp: Found port COM4.
sp: sp_get_port_by_name_desc(COM4, 007E104C) called.
sp: Building structure for port COM4.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name_desc returning SP_OK.
sp: Found port COM3.
sp: sp_get_port_by_name_desc(COM3, 007E1050) called.
sp: Building structure for port COM3.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name_desc returning SP_OK.
sp: Found port COM6.
sp: sp_get_port_by_name_desc(COM6, 007E1324) called.
sp: Building structure for port COM6.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name_desc returning SP_OK.
sp: Found port COM7.
sp: sp_get_port_by_name_desc(COM7, 007E1328) called.
sp: Building structure for port COM7.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name_desc returning SP_OK.
sp: sp_list_ports returning SP_OK.
sp: sp_get_port_name(007E0F58) called.
sp: sp_get_port_name returning COM5.
sp: sp_get_port_by_name_desc(COM5, 0028FEA0) called.
sp: Building structure for port COM5.

COM5 is the builtin 3G modem in my Laptop. It does NOT show up in the device manager under "COM & LPT" like COM3, 4, 6, 7, but under "Modems".

@HorstBaerbel
Copy link

HorstBaerbel commented May 19, 2016

comports2
And the modem is disabled atm if that is important.

@HorstBaerbel
Copy link

And I guess compiling would take me days when looking at the sources... No mention of VS whatsoever, lots of dependencies, no CMake...
Better make clean and compile with -g. I'll try to debug it.

@facchinm
Copy link
Member Author

Here we go
Let's hope it's useful, otherwise I'll prepare some VS build for testing (thank you very much again for helping)

@HorstBaerbel
Copy link

HorstBaerbel commented May 19, 2016

I get no proper stack trace with GBD, so something is seriously b0rked. It seems to crash in serialport.c:109 in "get_port_details". It is hard to find the exact point in "get_port_details", but it is supposedly somewhere in the loop between 426 and 462. These are the variables it enters "get_port_details" with:
comports3

@HorstBaerbel
Copy link

Oh, and the crashes came when upgrading from 1.6.7 or 8 to 1.6.9...

@facchinm
Copy link
Member Author

Argh, the COM5 is listed as SP_TRANSPORT_NATIVE, so it shouldn't call the USB-related loop (lines 426 to 462).
This bug is really strange, in fact if 1.6.8 is working in your environment it should be quite easy to bisect the issue.
We can try to do this tomorrow if you have some time to spend on testing the binaries 😄

@HorstBaerbel
Copy link

I'm not at home atm, but I'll gladly test more on Wednesday if it helps you find the problem...

@HorstBaerbel
Copy link

I could test some binaries today or tomorrow. Will be unable to test saturday+sunday again...

@DKWatson
Copy link

Some fuel for the fire. IDE 1.6.5-r2 works fine. 1.6.8 crashed on startup, didn't pursue it, just went back. Just downloaded 1.6.9 and same problem as 1.6.8 so I decided to look into it and read the posts. In the end, I have a GPS using u-blox 6 driver on COM5. Unplug this and IDE starts no problem. Tried changing the GPS to COM20, IDE won't start. So there seems to be a problem when IDE starts and looks for available COM ports and doesn't play well with others.

@gknauf
Copy link

gknauf commented Jul 11, 2016

Same problem here with Arduino IDE 1.6.9 on Windows 8.1-64; crash dump:

output of liblistSerials-1.1.1:

sp: sp_list_ports(0028FE94) called.
sp: Enumerating ports.
sp: Opening registry key.
sp: Querying registry key value and data sizes.
sp: Iterating over values.
sp: Found port COM1.
sp: sp_get_port_by_name_desc(COM1, 00350E68) called.
sp: Building structure for port COM1.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name_desc returning SP_OK.
sp: Found port COM2.
sp: sp_get_port_by_name_desc(COM2, 00351134) called.
sp: Building structure for port COM2.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name_desc returning SP_OK.
sp: Found port COM9.
sp: sp_get_port_by_name_desc(COM9, 00351138) called.
sp: Building structure for port COM9.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name_desc returning SP_OK.
sp: sp_list_ports returning SP_OK.
sp: sp_get_port_name(00350EC0) called.
sp: sp_get_port_name returning COM1.
sp: sp_get_port_by_name_desc(COM1, 0028FE90) called.
sp: Building structure for port COM1.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name_desc returning SP_OK.
sp: sp_get_port_usb_vid_pid(003533F8) called.
sp: sp_get_port_usb_vid_pid returning SP_ERR_ARG: Port does not use USB transport.
sp: sp_free_port(003533F8) called.
sp: Freeing port structure.
sp: sp_free_port returning.
sp: sp_get_port_name(003531E8) called.
sp: sp_get_port_name returning COM2.
sp: sp_get_port_by_name_desc(COM2, 0028FE90) called.
sp: Building structure for port COM2.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name_desc returning SP_OK.
sp: sp_get_port_usb_vid_pid(003533F8) called.
sp: sp_get_port_usb_vid_pid returning SP_ERR_ARG: Port does not use USB transport.
sp: sp_free_port(003533F8) called.
sp: Freeing port structure.
sp: sp_free_port returning.
sp: sp_get_port_name(00353288) called.
sp: sp_get_port_name returning COM9.
sp: sp_get_port_by_name_desc(COM9, 0028FE90) called.
sp: Building structure for port COM9.

of course COM9 is the USB-GPS ....;
liblistSerials-1.1.1 then crashes with entry in event log

output of liblistSerials-1.1.0 which works - no crash:

sp: sp_list_ports(0028FE94) called.
sp: Enumerating ports.
sp: Opening registry key.
sp: Querying registry key value and data sizes.
sp: Iterating over values.
sp: Found port COM1.
sp: sp_get_port_by_name_desc(COM1, 00380E68) called.
sp: Building structure for port COM1.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name_desc returning SP_OK.
sp: Found port COM2.
sp: sp_get_port_by_name_desc(COM2, 00381134) called.
sp: Building structure for port COM2.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name_desc returning SP_OK.
sp: Found port COM9.
sp: sp_get_port_by_name_desc(COM9, 00381138) called.
sp: Building structure for port COM9.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name_desc returning SP_OK.
sp: sp_list_ports returning SP_OK.
sp: sp_get_port_usb_vid_pid(00380EC0) called.
sp: sp_get_port_usb_vid_pid returning SP_ERR_ARG: Port does not use USB transport.
sp: sp_get_port_usb_vid_pid(003831E8) called.
sp: sp_get_port_usb_vid_pid returning SP_ERR_ARG: Port does not use USB transport.
sp: sp_get_port_usb_vid_pid(00383288) called.
sp: sp_get_port_usb_vid_pid returning SP_OK.
sp: sp_get_port_usb_manufacturer(00383288) called.
sp: sp_get_port_usb_product(00383288) called.
sp: sp_get_port_usb_serial(00383288) called.
sp: sp_get_port_name(00383288) called.
sp: sp_get_port_name returning COM9.
COM9 | 1546:01A7 | (null) (null) (null)
sp: sp_free_port_list(00381130) called.
sp: Freeing port list.
sp: sp_free_port(00380EC0) called.
sp: Freeing port structure.
sp: sp_free_port returning.
sp: sp_free_port(003831E8) called.
sp: Freeing port structure.
sp: sp_free_port returning.
sp: sp_free_port(00383288) called.
sp: Freeing port structure.
sp: sp_free_port returning.
sp: sp_free_port_list returning.

output of liblistSerials-1.0.7 which works - no crash:

sp: sp_list_ports(0028FE98) called.
sp: Enumerating ports.
sp: Opening registry key.
sp: Querying registry key value and data sizes.
sp: Iterating over values.
sp: Found port COM1.
sp: sp_get_port_by_name_desc(COM1, 00790E68) cal
sp: Building structure for port COM1.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name_desc returning SP_OK.
sp: Found port COM2.
sp: sp_get_port_by_name_desc(COM2, 00791134) cal
sp: Building structure for port COM2.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name_desc returning SP_OK.
sp: Found port COM9.
sp: sp_get_port_by_name_desc(COM9, 00791138) called.
sp: Building structure for port COM9.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name_desc returning SP_OK.
sp: sp_list_ports returning SP_OK.
sp: sp_get_port_usb_vid_pid(00790EC0) called.
sp: sp_get_port_usb_vid_pid returning SP_ERR_ARG: Port does not use USB transport.
sp: sp_get_port_usb_vid_pid(007931E8) called.
sp: sp_get_port_usb_vid_pid returning SP_ERR_ARG: Port does not use USB transport.
sp: sp_get_port_usb_vid_pid(00793288) called.
sp: sp_get_port_usb_vid_pid returning SP_OK.
sp: sp_get_port_usb_manufacturer(00793288) called.
sp: sp_get_port_usb_product(00793288) called.
sp: sp_get_port_usb_serial(00793288) called.
sp: sp_get_port_name(00793288) called.
sp: sp_get_port_name returning COM9.
COM9 | 1546:01A7 | (null) (null) (null)
sp: sp_free_port_list(00791130) called.
sp: Freeing port list.
sp: sp_free_port(00790EC0) called.
sp: Freeing port structure.
sp: sp_free_port returning.
sp: sp_free_port(007931E8) called.
sp: Freeing port structure.
sp: sp_free_port returning.
sp: sp_free_port(00793288) called.
sp: Freeing port structure.
sp: sp_free_port returning.
sp: sp_free_port_list returning.

@facchinm facchinm force-pushed the libListSerial-1.1.1 branch from d5da03d to 2ecd801 Compare July 12, 2016 09:50
@gknauf
Copy link

gknauf commented Jul 12, 2016

Hi Martino,
BUILD-570 still crashes:

output of liblistSerials-1.1.2 (crashes):

sp: sp_list_ports(0028FE94) called.
sp: Enumerating ports.
sp: Opening registry key.
sp: Querying registry key value and data sizes.
sp: Iterating over values.
sp: Found port COM1.
sp: sp_get_port_by_name_desc(COM1, 00770E50) called.
sp: Building structure for port COM1.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name_desc returning SP_OK.
sp: Found port COM2.
sp: sp_get_port_by_name_desc(COM2, 0077111C) called.
sp: Building structure for port COM2.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name_desc returning SP_OK.
sp: Found port COM9.
sp: sp_get_port_by_name_desc(COM9, 00771120) called.
sp: Building structure for port COM9.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name_desc returning SP_OK.
sp: sp_list_ports returning SP_OK.
sp: sp_get_port_name(00770EA8) called.
sp: sp_get_port_name returning COM1.
sp: sp_get_port_by_name_desc(COM1, 0028FE90) called.
sp: Building structure for port COM1.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name_desc returning SP_OK.
sp: sp_get_port_usb_vid_pid(007733D0) called.
sp: sp_get_port_usb_vid_pid returning SP_ERR_ARG: Port does not use USB transport.
sp: sp_free_port(007733D0) called.
sp: Freeing port structure.
sp: sp_free_port returning.
sp: sp_get_port_name(00771130) called.
sp: sp_get_port_name returning COM2.
sp: sp_get_port_by_name_desc(COM2, 0028FE90) called.
sp: Building structure for port COM2.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name_desc returning SP_OK.
sp: sp_get_port_usb_vid_pid(007733D0) called.
sp: sp_get_port_usb_vid_pid returning SP_ERR_ARG: Port does not use USB transport.
sp: sp_free_port(007733D0) called.
sp: Freeing port structure.
sp: sp_free_port returning.
sp: sp_get_port_name(00773210) called.
sp: sp_get_port_name returning COM9.
sp: sp_get_port_by_name_desc(COM9, 0028FE90) called.
sp: Building structure for port COM9.

@facchinm
Copy link
Member Author

Hi @gknauf , which GPS receiver are you using? I'm trying to get one to properly debug this issue

@gknauf
Copy link

gknauf commented Jul 13, 2016

Hi Martino,
its a cheap U-Blox Neo 7 based one (VK-172):
http://www.ebay.com/itm/272190165001
http://www.ebay.com/itm/201594404315
driver:
https://www.u-blox.com/sites/default/files/products/tools/UBX-GNSS-CDC-ACM-windows_Driver_%28UBX-drv-v1.2.0.8%29.exe.zip
or, you can get u-center which contains this driver:
https://www.u-blox.com/sites/default/files/ublox-GNSS_u-center_windows_v8.21.zip
be prepared for shipping time of 2 - 6 weeks when ordering from China ...

@ghost
Copy link

ghost commented Jul 14, 2016

I have the exact same problem on 1.6.9 on Windows 7(64) with a Zebra DS457 USB barcode reader connected.
If connected, the Arduino IDE only gets as far as the splash screen, and crashes immediately if I plug it after the IDE has been started.

@vvedris
Copy link

vvedris commented Jul 15, 2016

Hi,

I have started experiencing the same problem when I installed my ZTE WCDMA technologies internet modem.

I tried the 570 build but it didn't help and Arduino IDE is crashing when I plug in ZTE into USB port.

@gknauf
Copy link

gknauf commented Jul 16, 2016

Hi Martino,
I doubt that you can ever cope with every serial device; so my suggestion would be to create a whitelist with VID:PID entries of the few known serial2usb converters which are currently used with Arduino devices; if you implement it as a text file and document it then everyone can just add an entry if a special device is missing ...
and everthing else not matching any VID:PID in the whitelist should then be ignored ...

just my 2ct ;-)

@HorstBaerbel
Copy link

I would advice against that. This will probably break like half of the Arduino IDE installations on the planet for no reason...
Just to add some information: I have the problem on Windows 7 x64 only. On the SAME laptop with Ubuntu 14.04 x64 installed the Arduino IDE works flawlessly. This is my workaround atm.

@facchinm
Copy link
Member Author

The problem here is that Windows handles serial ports terribly. Coping a serial port name with a VID/PID/ISERIAL triplet take ~10 times the code we need on Linux/OSX, and the results differ a lot if the device is composite. The old code (which spawned listComPorts executable every 3 seconds) was really inefficient and you could only get the serial number of non-composite devices.
However, the whole bug should be quite easy to tackle once we can get a device which crashes the list ports routine and stop doing blind fixes 😄 We are working on it so don't worry 😉

Solves arduino#4696, arm binaries are now rPi1 compatible (armv6)
@facchinm facchinm force-pushed the libListSerial-1.1.1 branch from 2ecd801 to 8f4ee6d Compare July 21, 2016 14:40
@facchinm facchinm changed the title Update liblistserial to 1.1.1 Update liblistserial to 1.1.3 Jul 21, 2016
@facchinm
Copy link
Member Author

Hi everyone, I believe I've found the root cause of the crashes (it was a memory corruption due to charset conversions).
@ArduinoBot should be on its way with a fresh build in a matter of an hour.
Tested with ublox7 GPS receiver and a great variety of serial CDC ports on Win xp and Win10. Please test on your system and report here the results.

@HorstBaerbel @DKWatson @gknauf @thedayofcondor @vvedris

@facchinm
Copy link
Member Author

If you want to test it withoud downloading the full-blown IDE the link is http://downloads.arduino.cc/liblistSerials/liblistSerials-1.1.3.zip (replace the dll as usual)

@DKWatson
Copy link

Just downloaded full IDE, replaced 1.6.5, fired up my navigation software with GPS on com16 using u-blox 6 driver, Uno on com15 and both seem to be co-existing just fine. One warning message on compile,
WARNING: Category ' ' in library ArduinoUnit is not valid, Setting to 'Uncategorized'
and multiple Invalid library found messages, no doubt to hasty copy and no housekeeping.

David Watson

  From: Martino Facchin <notifications@github.com>

To: arduino/Arduino Arduino@noreply.github.com
Cc: DKWatson apengineering@yahoo.com; Mention mention@noreply.github.com
Sent: Thursday, 21 July 2016, 22:30
Subject: Re: [arduino/Arduino] Update liblistserial to 1.1.3 (#4971)

If you want to test it withoud downloading the full-blown IDE the link is http://downloads.arduino.cc/liblistSerials/liblistSerials-1.1.3.zip (replace the dll as usual)—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@facchinm facchinm merged commit 1d98491 into arduino:master Jul 22, 2016
@facchinm
Copy link
Member Author

Merging to give it some nightly test, revert if necessary

@cmaglie cmaglie added this to the Release 1.6.10 milestone Jul 22, 2016
@ghost
Copy link

ghost commented Jul 22, 2016

Replaced listSerialsj.dll in the arduino lib folder, I can confirm it is working correctly now.

Thank you very much for the quick response!

@vvedris
Copy link

vvedris commented Jul 23, 2016

Hi Martino,

Also replaced listSerialsj.dll and now Arduino IDE works without any problem.

Thanks!

@DKWatson
Copy link

Just for completeness, I reported the other day that I did an install of the new IDE and everything worked fine. On another machine, running 1.6.9 that would not start with the GPS attached. I replaced the listSerials.dll and it too now works fine.

Good work. Next time I see you, beer's on me.
 David Watson

  From: Vedran <notifications@github.com>

To: arduino/Arduino Arduino@noreply.github.com
Cc: DKWatson apengineering@yahoo.com; Mention mention@noreply.github.com
Sent: Sunday, 24 July 2016, 2:07
Subject: Re: [arduino/Arduino] Update liblistserial to 1.1.3 (#4971)

Hi Martino,Also replaced listSerialsj.dll and now Arduino IDE works without any problem.Thanks!—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@gknauf
Copy link

gknauf commented Jul 25, 2016

Hi Martino,
just tested IDE 1.6.9 + listSerialsj.dll 1.1.3 and it starts now fine with connected UsbGPS; well done, great!
Thanks!

@DKWatson
Copy link

DKWatson commented Jul 27, 2016

Sorry guys. After all that good work to get past the comm port issue, too many warnings/errors trying to compile code that works. The comm port problem allowed 1.6.9/10 to 'not crash' on startup. Since then, I've been trying it out with programs the work.
I have two i5 machines that get FileSynced every day. The platforms and files are identical. I reverted one machine back to 1.6.5r5 and a simple timer interrupt compiles without incident.

#include <TimerOne.h>

void setup()
{
  bitSet(DDRB,5);
  Timer1.initialize(1000000);
  Timer1.attachInterrupt(b);
}

void loop(){}

void b(){
  bitSet(PINB,5);
}

With 1.6.10 there was a page full of warnings and errors before aborting the compile. Mostly stating that TimerOne had no such methods.
In any event, keep up the good work. I have reverted all back to 1.6.5r5 for now. Waiting for 1.7.
Cheers. David Watson

@facchinm
Copy link
Member Author

Hi David,

the problem you are experiencing is a side effect of third party boards (the new avr core uses a feature only available in the new compiler, but the builder chooses the old compiler).
A simple workaround is to navigate to C:\$youruser/$Appdata/Local/Arduino15/packages/arduino/tools/ and remove avr-gcc folder.
In any case, please open another issue to track this problem reporting the full verbose output of the compilation.
Thanks

@HorstBaerbel
Copy link

Looking forward to trying this out in 1.6.10 :)

@xpiolx
Copy link

xpiolx commented Sep 27, 2016

Thank you very much!

Tried again MCP2221 on Arduino IDE and now it is working great with version 1.1.3 !
#4792 (comment)

@facchinm facchinm deleted the libListSerial-1.1.1 branch January 4, 2017 15:41
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.

8 participants