[SailfishDevel] QML creates a Segfault
Hi, when trying to download data in a WorkerScript thread I got this: bash: line 1: 1459 Segmentation fault QT_NO_JOURNALD_LOG=1 DISPLAY=:0.0 /usr/bin/CalDav Can somebody explain if I can avoid this or what the reason is ? Thanks. Ciao Matze ___ SailfishOS.org Devel mailing list To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org
Re: [SailfishDevel] QML creates a Segfault
Unknown script doing unknown work and producing unknown error. At least for me all working as expected :D 13.05.2014 17:00, Matthias Barmeier ?: Hi, when trying to download data in a WorkerScript thread I got this: bash: line 1: 1459 Segmentation fault QT_NO_JOURNALD_LOG=1 DISPLAY=:0.0 /usr/bin/CalDav Can somebody explain if I can avoid this or what the reason is ? Thanks. Ciao Matze ___ SailfishOS.org Devel mailing list To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org ___ SailfishOS.org Devel mailing list To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org
Re: [SailfishDevel] QML creates a Segfault
On 13.05.2014 14:00, Matthias Barmeier wrote: Hi, when trying to download data in a WorkerScript thread I got this: bash: line 1: 1459 Segmentation fault QT_NO_JOURNALD_LOG=1 DISPLAY=:0.0 /usr/bin/CalDav Can somebody explain if I can avoid this or what the reason is ? That script part is how Qt Creator runs your application in the device/emulator. So it just means that /usr/bin/CalDav crashed to a SEGFAULT and you'll need to figure out why. Qt Creator launches the application in the device/emulator almost like this: ssh nemo@device_address QT_NO_JOURNALD_LOG=1 DISPLAY=:0.0 /usr/bin/applicationname It does not use ssh command, but an ssh library, which is part of Qt Creator. The QT_NO_JOURNALD_LOG =1 is there to make the application not put its output to journald, but to stdout/stderr instead so that Qt Creator can display it. Best regards, Juha ___ SailfishOS.org Devel mailing list To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org
[SailfishDevel] Not receiving broadcasted UDP replies (Jolla, Python)
Hi, (uh, first post to this mailing list - exciting!) I am trying to write a small app for my Jolla phone (and hopefully for others' too, later), using QML, PyOtherSide and some 3rd-party python-based network code. The app is supposed to control LIFX lightbulbs via wifi. The network code works fine on Desktop (I tested it on OSX in an app, and from the Python CLI), and was ported to Python3. On the Jolla phone, and in the Sailfish emulator on my laptop, the network code never gets a reply from the lightbulbs, despite the lightbulbs sending one. If run from the CLI, merely hangs, waiting for data; if run as a QML app, the app continues, but the python code still stalls, and eventually a message comes up about an unresponsive process. In the emulator I've mostly concluded that the network settings use aren't conducive to this setup, and that I'll mostly have to work directly on the phone. Using tcpdump, I have determined that the broadcasts from the Python code is sent out and reaches the bulbs, and a reply is also transmitted from the bulbs, but never received on the phone. This was done by having a laptop on the same wifi as the phone and bulbs, and running tcpdump on both. Dump from the Jolla phone: [root@Jolla nemo]# tcpdump -n broadcast or multicast tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on wlan0, link-type EN10MB (Ethernet), capture size 65535 bytes 10:38:21.919881 IP 192.168.1.11.56700 255.255.255.255.56700: UDP, length 36 10:38:21.920278 IP 192.168.1.11.56700 255.255.255.255.56700: UDP, length 36 10:38:21.920552 IP 192.168.1.11.56700 255.255.255.255.56700: UDP, length 36 10:38:21.920827 IP 192.168.1.11.56700 255.255.255.255.56700: UDP, length 36 10:38:21.921102 IP 192.168.1.11.56700 255.255.255.255.56700: UDP, length 36 12:34:33.460396 ARP, Request who-has 192.168.1.11 tell 192.168.1.1, length 28 12:37:45.263353 IP 192.168.1.10.138 255.255.255.255.138: NBT UDP PACKET(138) 12:37:47.310354 ARP, Request who-has 192.168.1.10 tell 192.168.1.1, length 28 (data broadcast from 192.168.1.11 = phone) Dump from the laptop (concurrent to the above): Nielss-MacBook-Pro:projects nc$ sudo tcpdump -n broadcast or multicast tcpdump: data link type PKTAP tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on pktap, link-type PKTAP (Packet Tap), capture size 65535 bytes 10:37:50.417809 ARP, Request who-has 192.168.1.10 tell 192.168.1.1, length 28 10:38:26.071691 IP 192.168.1.11.56700 255.255.255.255.56700: UDP, length 36 10:38:26.073139 IP 192.168.1.11.56700 255.255.255.255.56700: UDP, length 36 10:38:26.074562 IP 192.168.1.11.56700 255.255.255.255.56700: UDP, length 36 10:38:26.075840 IP 192.168.1.11.56700 255.255.255.255.56700: UDP, length 36 10:38:26.081271 IP 192.168.1.11.56700 255.255.255.255.56700: UDP, length 36 10:38:26.082544 IP 192.168.1.6.56700 192.168.1.255.56700: UDP, length 41 10:38:26.084234 IP 192.168.1.6.56700 192.168.1.255.56700: UDP, length 41 10:38:26.085967 IP 192.168.1.6.56700 192.168.1.255.56700: UDP, length 41 10:38:26.087745 IP 192.168.1.6.56700 192.168.1.255.56700: UDP, length 41 10:38:26.089417 IP 192.168.1.6.56700 192.168.1.255.56700: UDP, length 41 10:38:26.091339 IP 192.168.1.6.56700 192.168.1.255.56700: UDP, length 41 10:38:26.093355 IP 192.168.1.6.56700 192.168.1.255.56700: UDP, length 41 10:38:26.095297 IP 192.168.1.6.56700 192.168.1.255.56700: UDP, length 41 10:38:26.097493 IP 192.168.1.6.56700 192.168.1.255.56700: UDP, length 41 10:38:26.099300 IP 192.168.1.6.56700 192.168.1.255.56700: UDP, length 41 (data broadcast from 192.168.1.11 = phone, from 192.168.1.6 = lightbulbs) We can see the 5 UDP packets from the phone in both dumps, but the reply-packets only in the dump from the laptop. Note: All devices are on the same wifi, connected to the same router. I can provide more detailed dumps, if anyone wishes. The relevant python-code, which is basically stalling in the udpsock.recvfrom(1024) call: - IP = '0.0.0.0' BCAST = '255.255.255.255' PORT = 56700 connection = None debug = False site = b'\00\00\00\00\00\00' def connect(): global connection, site udpsock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) udpsock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) udpsock.bind((IP, PORT)) p = packetcodec.Packet(packetcodec.GetPANGatewayPayload()) for x in range(5): udpsock.sendto(p.__bytes__(), (BCAST, PORT)) while True: data, addr = udpsock.recvfrom(1024) packet = packetcodec.decode_packet(data) if packet is not None and \ isinstance(packet.payload, packetcodec.PANGatewayPayload): break udpsock.close() if debug: print 'found light: %s' % (addr[0], ) tcpsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) tcpsock.settimeout(2.0) tcpsock.connect(addr) connection = tcpsock site = packet.site if debug: print
Re: [SailfishDevel] QML creates a Segfault
hehe, yes. I was a bit confused about the segfault. I thought that QML runs in a container that could give me some more information. I will avoid the workerscript without ist works OK just a bit uncomforatable. Thanks. Am 13.05.2014 13:12, schrieb Andrey Kozhevnikov: Unknown script doing unknown work and producing unknown error. At least for me all working as expected :D 13.05.2014 17:00, Matthias Barmeier ?: Hi, when trying to download data in a WorkerScript thread I got this: bash: line 1: 1459 Segmentation fault QT_NO_JOURNALD_LOG=1 DISPLAY=:0.0 /usr/bin/CalDav Can somebody explain if I can avoid this or what the reason is ? Thanks. Ciao Matze ___ SailfishOS.org Devel mailing list To unsubscribe, please send a mail todevel-unsubscr...@lists.sailfishos.org ___ SailfishOS.org Devel mailing list To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org ___ SailfishOS.org Devel mailing list To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org
Re: [SailfishDevel] QML creates a Segfault
OK, its just a bit weird that the same program works without a WorkerScript. The WorkerScript is just to make the gui more repsonsive it has no relevance to the function. Thanks. Am 13.05.2014 13:31, schrieb Juha Kallioinen: On 13.05.2014 14:00, Matthias Barmeier wrote: Hi, when trying to download data in a WorkerScript thread I got this: bash: line 1: 1459 Segmentation fault QT_NO_JOURNALD_LOG=1 DISPLAY=:0.0 /usr/bin/CalDav Can somebody explain if I can avoid this or what the reason is ? That script part is how Qt Creator runs your application in the device/emulator. So it just means that /usr/bin/CalDav crashed to a SEGFAULT and you'll need to figure out why. Qt Creator launches the application in the device/emulator almost like this: ssh nemo@device_address QT_NO_JOURNALD_LOG=1 DISPLAY=:0.0 /usr/bin/applicationname It does not use ssh command, but an ssh library, which is part of Qt Creator. The QT_NO_JOURNALD_LOG =1 is there to make the application not put its output to journald, but to stdout/stderr instead so that Qt Creator can display it. Best regards, Juha ___ SailfishOS.org Devel mailing list To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org ___ SailfishOS.org Devel mailing list To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org
Re: [SailfishDevel] QML creates a Segfault
http://qt-project.org/doc/qt-5/qml-qtquick-workerscript.html#restrictions Maybe you just didn't notice the restrictions part (ie script cannot access properties, methods or other attributes of the qml item etc). Hard to say without seeing your workerscript implementation. re, Jonni From: devel-boun...@lists.sailfishos.org [devel-boun...@lists.sailfishos.org] on behalf of Matthias Barmeier [barme...@barmeier.com] Sent: Tuesday, May 13, 2014 2:57 PM To: Sailfish OS Developers Subject: Re: [SailfishDevel] QML creates a Segfault OK, its just a bit weird that the same program works without a WorkerScript. The WorkerScript is just to make the gui more repsonsive it has no relevance to the function. Thanks. Am 13.05.2014 13:31, schrieb Juha Kallioinen: On 13.05.2014 14:00, Matthias Barmeier wrote: Hi, when trying to download data in a WorkerScript thread I got this: bash: line 1: 1459 Segmentation fault QT_NO_JOURNALD_LOG=1 DISPLAY=:0.0 /usr/bin/CalDav Can somebody explain if I can avoid this or what the reason is ? That script part is how Qt Creator runs your application in the device/emulator. So it just means that /usr/bin/CalDav crashed to a SEGFAULT and you'll need to figure out why. Qt Creator launches the application in the device/emulator almost like this: ssh nemo@device_address QT_NO_JOURNALD_LOG=1 DISPLAY=:0.0 /usr/bin/applicationname It does not use ssh command, but an ssh library, which is part of Qt Creator. The QT_NO_JOURNALD_LOG =1 is there to make the application not put its output to journald, but to stdout/stderr instead so that Qt Creator can display it. Best regards, Juha ___ SailfishOS.org Devel mailing list To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.orgmailto:devel-unsubscr...@lists.sailfishos.org ___ SailfishOS.org Devel mailing list To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org
Re: [SailfishDevel] Not receiving broadcasted UDP replies (Jolla, Python)
Uki, got some feedback from IRC (SOLVED - somewhat) Changing McastBcastFilter to either 0 (allow all) or 1 (filter MCAST) allows the phone to receive BCAST messages, but this is by default set to 3 (Filter MCAST+BCAST), and will drain power is left at a lower level. iwpriv wlan0 setMCBCFilter 1 In my case I've reached out to the LIFX developers to hear if the behaviour of their lightbulbs could possibly be changed. Regards Nc. Log from IRC (abbreviate) tigeli # Flags to filter Mcast abd Bcast RX packets. tigeli # Value 0: No filtering, 1: Filter all Multicast. tigeli # 2: Filter all Broadcast. 3: Filter all Mcast abd Bcast tigeli McastBcastFilter=3 tigeli which explains lots of things ;) Stskeeps okay, why would we do this.. tigeli Stskeeps: to save battery tigeli no other reasons Stskeeps tigeli: aren't dhcp broadcast? tigeli Stskeeps: yes, but you don't have to listen for those, only server needs to tigeli Stskeeps: the reply will back straight to you tigeli Stskeeps: but ARP is brodcast, which is handled on the chip Stskeeps hmm ok tigeli Stskeeps: and if we set that to 0, it will consume a lot of power in busy wlan network Nc_ tigeli: so issue is that phone is filtering out bcast/mcast due to powersaving settings? tigeli Nc_: yes tigeli Nc_: you could confirm this by changint that McastBcastFilter to 0 for a test tigeli Nc_: mount -t ext4 -o remount,rw /dev/mmcblk0p25 /persist tigeli Nc_: and then edit /persist/WCNSS_qcom_cfg.ini tigeli Nc_: and reboot Nc_ but from your description, sounds like this is not something that can be controlled at runtime :/ tigeli Nc_: I understand why you want to use broadcasting but with mobile devices which want to conserve power it might not be good idea. :( tigeli Nc_: yeah. :( At least I'm not aware of how.. unless there some nice API on the driver itself which could enable to change that filter during the runtime. Stskeeps iwpriv maybe? javispedro these days MS is also filtering bcasts when on connected standby, so it's pretty much the norm. tigeli Stskeeps: at least there is setMCBCFilter in iwpriv tigeli Stskeeps: Nc_: iwpriv wlan0 setMCBCFilter 1 seems to be working also Nc_ w tigeli works? Nc_ got a reply from the LIFX bulbs (setting 0) Nc_ and I just turned on a lightbulb using the CLI on my phone :p Nc_ and yes, seems iwpriv turns it on/off depending on setting end log 2014-05-13 13:44 GMT+02:00 Niels Christian Ørgaard ncoth...@gmail.com: Hi, (uh, first post to this mailing list - exciting!) I am trying to write a small app for my Jolla phone (and hopefully for others' too, later), using QML, PyOtherSide and some 3rd-party python-based network code. The app is supposed to control LIFX lightbulbs via wifi. The network code works fine on Desktop (I tested it on OSX in an app, and from the Python CLI), and was ported to Python3. On the Jolla phone, and in the Sailfish emulator on my laptop, the network code never gets a reply from the lightbulbs, despite the lightbulbs sending one. If run from the CLI, merely hangs, waiting for data; if run as a QML app, the app continues, but the python code still stalls, and eventually a message comes up about an unresponsive process. In the emulator I've mostly concluded that the network settings use aren't conducive to this setup, and that I'll mostly have to work directly on the phone. Using tcpdump, I have determined that the broadcasts from the Python code is sent out and reaches the bulbs, and a reply is also transmitted from the bulbs, but never received on the phone. This was done by having a laptop on the same wifi as the phone and bulbs, and running tcpdump on both. Dump from the Jolla phone: [root@Jolla nemo]# tcpdump -n broadcast or multicast tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on wlan0, link-type EN10MB (Ethernet), capture size 65535 bytes 10:38:21.919881 IP 192.168.1.11.56700 255.255.255.255.56700: UDP, length 36 10:38:21.920278 IP 192.168.1.11.56700 255.255.255.255.56700: UDP, length 36 10:38:21.920552 IP 192.168.1.11.56700 255.255.255.255.56700: UDP, length 36 10:38:21.920827 IP 192.168.1.11.56700 255.255.255.255.56700: UDP, length 36 10:38:21.921102 IP 192.168.1.11.56700 255.255.255.255.56700: UDP, length 36 12:34:33.460396 ARP, Request who-has 192.168.1.11 tell 192.168.1.1, length 28 12:37:45.263353 IP 192.168.1.10.138 255.255.255.255.138: NBT UDP PACKET(138) 12:37:47.310354 ARP, Request who-has 192.168.1.10 tell 192.168.1.1, length 28 (data broadcast from 192.168.1.11 = phone) Dump from the laptop (concurrent to the above): Nielss-MacBook-Pro:projects nc$ sudo tcpdump -n broadcast or multicast tcpdump: data link type PKTAP tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on pktap, link-type PKTAP (Packet Tap), capture size 65535 bytes 10:37:50.417809 ARP, Request who-has
[SailfishDevel] Where did devel-su come from and what's its purpose?
Hi, I'm been googling long and hard but haven't been able to find much information about the 'devel-su' command, beyond the fact that it's the command to use on Sailfish to switch to the root user. I also couldn't find the source code for it anywhere. If there is someone with more insider knowledge here, I'd love to hear about where this command came from and how it differs from 'su'. The first mentions of 'devel-su' I've been able to find were from 2011 in relation to MeeGo. I couldn't find any information about why this command was created for MeeGo though. It may have been related to MeeGo's security platform Aegis (part of the Mobile Simplified Security Framework it seems) but there's precious little information about Aegis or MSSF out there. Back in the Meego days, 'devel-su' would let you switch to, quite literally, a developer super user account, which had more privileges than a normal user but wasn't quite root (or at least it seems that way from the few user complaints I could find). Sailfish is very different however. There's no Aegis there. The 'devel-su' command lets you switch to the real root user and gives you full root access to your device. In fact, once you're root, you can just reset the root user password (which appears to not be set or be set to a random value by default) and then just use the 'su' command normally instead of 'devel-su' ( https://together.jolla.com/question/30565/howto-using-su-instead-of-devel-su/ ). So why 'devel-su' then? AFAICS, one difference between 'su' and 'devel-su' is that 'devel-su' checks the password set in the device's Developer Mode settings instead of using the normal root password. So you can disable root login via 'devel-su' or change the 'devel-su' password there. Any insider info would be greatly appreciated :) Mehdi ___ SailfishOS.org Devel mailing list To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org
Re: [SailfishDevel] QML creates a Segfault
haven't noticed the restrictions, but I give a listmodel to the WorkerScript and send a text back. No Operations on that, bat the listmodel is tied to listview. Maybe this creates the problem. Am 13.05.2014 14:13, schrieb Jonni Rainisto: http://qt-project.org/doc/qt-5/qml-qtquick-workerscript.html#restrictions Maybe you just didn't notice the restrictions part (ie script cannot access properties, methods or other attributes of the qml item etc). Hard to say without seeing your workerscript implementation. re, Jonni *From:* devel-boun...@lists.sailfishos.org [devel-boun...@lists.sailfishos.org] on behalf of Matthias Barmeier [barme...@barmeier.com] *Sent:* Tuesday, May 13, 2014 2:57 PM *To:* Sailfish OS Developers *Subject:* Re: [SailfishDevel] QML creates a Segfault OK, its just a bit weird that the same program works without a WorkerScript. The WorkerScript is just to make the gui more repsonsive it has no relevance to the function. Thanks. Am 13.05.2014 13:31, schrieb Juha Kallioinen: On 13.05.2014 14:00, Matthias Barmeier wrote: Hi, when trying to download data in a WorkerScript thread I got this: bash: line 1: 1459 Segmentation fault QT_NO_JOURNALD_LOG=1 DISPLAY=:0.0 /usr/bin/CalDav Can somebody explain if I can avoid this or what the reason is ? That script part is how Qt Creator runs your application in the device/emulator. So it just means that /usr/bin/CalDav crashed to a SEGFAULT and you'll need to figure out why. Qt Creator launches the application in the device/emulator almost like this: ssh nemo@device_address QT_NO_JOURNALD_LOG=1 DISPLAY=:0.0 /usr/bin/applicationname It does not use ssh command, but an ssh library, which is part of Qt Creator. The QT_NO_JOURNALD_LOG =1 is there to make the application not put its output to journald, but to stdout/stderr instead so that Qt Creator can display it. Best regards, Juha ___ SailfishOS.org Devel mailing list To unsubscribe, please send a mail todevel-unsubscr...@lists.sailfishos.org ___ SailfishOS.org Devel mailing list To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org ___ SailfishOS.org Devel mailing list To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org
Re: [SailfishDevel] Where did devel-su come from and what's its purpose?
Mehdi El Gueddari me...@tickmeet.com writes: I'm been googling long and hard but haven't been able to find much information about the 'devel-su' command, beyond the fact that it's the command to use on Sailfish to switch to the root user. I also couldn't find the source code for it anywhere. I'm the author, and the source is (currently) not open. It is on the list of stuff I'd like to see opened up when I have time for that, though. It's one of those small utilities you can easily write during your lunch break, if you have a basic understanding of UNIX concepts. If there is someone with more insider knowledge here, I'd love to hear about where this command came from and how it differs from 'su'. The first mentions of 'devel-su' I've been able to find were from 2011 in relation to MeeGo. I couldn't find any information about why this command was created for MeeGo though. It may have been related to MeeGo's security platform Aegis (part of the Mobile Simplified Security Framework it seems) but there's precious little information about Aegis or MSSF out there. Back in the Meego days, 'devel-su' would let you switch to, quite literally, a developer super user account, which had more privileges than a normal user but wasn't quite root (or at least it seems that way from the few user complaints I could find). This devel-su did indeed have ties to aegis, and it let you do everything not explicitely prevented by aegis settings. Aegis blocked several useful things, which caused the annoyance. The Sailfish devel-su only shares the name -- it was chosen to have it easily discoverable for developers coming from MeeGo/Harmattan, but was written from scratch. It's available as su-devel as well to make it better discoverable for people without MeeGo background. Sailfish is very different however. There's no Aegis there. The 'devel-su' command lets you switch to the real root user and gives you full root access to your device. In fact, once you're root, you can just reset the root user password (which appears to not be set or be set to a random value by default) and then just use the 'su' command normally instead of 'devel-su' ( https://together.jolla.com/question/30565/howto-using-su-instead-of-devel-su/ ). So why 'devel-su' then? AFAICS, one difference between 'su' and 'devel-su' is that 'devel-su' checks the password set in the device's Developer Mode settings instead of using the normal root password. So you can disable root login via 'devel-su' or change the 'devel-su' password there. To be more precise, the settings page sets the password for the nemo user, and devel-su authenticates using the users password, instead of the root password, as used by su. Reason for that setup is just to be as paranoid as possible when it comes to access of your device, which includes a disabled root user. You're free to do whatever you want with your device, though. The other question which might come up would be why not sudo: Back when we were building the phone sudo did not work very well with systemd. Additionally it's pretty complex, easy to break, and had its share of exploits. devel-su is about 150 lines, including boilerplate, so quite easy to audit. Bernd ___ SailfishOS.org Devel mailing list To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org
Re: [SailfishDevel] Where did devel-su come from and what's its purpose?
On 13. mai 2014 15:14, Mehdi El Gueddari wrote: Back in the Meego days, 'devel-su' would let you switch to, quite literally, a developer super user account, which had more privileges than a normal user but wasn't quite root (or at least it seems that way from the few user complaints I could find). Well, not quite. Under Aegis, devel-su escalated your privileges to the max, but did not actually change to another account. (You could set up a developer account for interaction with the SDK, but it had no special privileges.) Also, under Aegis, root didn't have any special permissions, you were actually more privileged as a regular user than you were as root. Thus, regular su was useless. You just needed devel-su if you wanted to do stuff. ___ SailfishOS.org Devel mailing list To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org