Explore all Security Framework open source software, libraries, packages, source code, cloud functions and APIs.

Popular New Releases in Security Framework

jeecg-boot

3.1.0 版本发布,基于代码生成器的企业级低代码平台

jeecg-boot

JeecgBoot 2.4.5 版本发布,钉钉与企业微信集成版本

xboot

20210305-3.3.3版本发布

psi-probe

Psi-probe 3.5.5 Release

ShiroExploit-Deprecated

ShiroExploit v2.51 Final

Popular Libraries in Security Framework

jeecg-boot

by jeecgboot doticonjavadoticon

star image 28804 doticonApache-2.0

「企业级低代码平台」前后端分离架构SpringBoot 2.x,SpringCloud,Ant Design&Vue,Mybatis,Shiro,JWT。强大的代码生成器让前后端代码一键生成,无需写任何代码! 引领新的开发模式OnlineCoding->代码生成->手工MERGE,帮助Java项目解决70%重复工作,让开发更关注业务,既能快速提高效率,帮助公司节省成本,同时又不失灵活性。

jeecg-boot

by zhangdaiscott doticonjavadoticon

star image 23410 doticonApache-2.0

「企业级低代码平台」前后端分离架构SpringBoot 2.x,SpringCloud,Ant Design&Vue,Mybatis-plus,Shiro,JWT。强大的代码生成器让前后端代码一键生成,无需写任何代码! 引领新的开发模式OnlineCoding->代码生成->手工MERGE,帮助Java项目解决70%重复工作,让开发更关注业务,既能快速提高效率,帮助公司节省成本,同时又不失灵活性。

SpringAll

by wuyouzhuguli doticonjavadoticon

star image 22686 doticonMIT

循序渐进,学习Spring Boot、Spring Boot & Shiro、Spring Batch、Spring Cloud、Spring Cloud Alibaba、Spring Security & Spring Security OAuth2,博客Spring系列源码:https://mrbird.cc

FEBS-Shiro

by febsteam doticonjavadoticon

star image 5487 doticonApache-2.0

Spring Boot 2.4.2,Shiro1.6.0 & Layui 2.5.6 权限管理系统。预览地址:http://47.104.70.138:8080/login

springBoot

by 527515025 doticonjavadoticon

star image 5395 doticon

springboot 框架与其它组件结合如 jpa、mybatis、websocket、security、shiro、cache等

shiro-example

by zhangkaitao doticonhtmldoticon

star image 4736 doticon

跟我学Shiro(我的公众号:kaitao-1234567,我的新书:《亿级流量网站架构核心技术》)

Spring-Boot-In-Action

by hansonwang99 doticonjavadoticon

star image 4247 doticon

Spring Boot 系列实战合集

shiro

by apache doticonjavadoticon

star image 3773 doticonApache-2.0

Apache Shiro

xboot

by Exrick doticonjavadoticon

star image 3288 doticonGPL-3.0

基于Spring Boot 2.x的一站式前后端分离快速开发平台XBoot 微信小程序+Uniapp 前端:Vue+iView Admin 后端:Spring Boot 2.x/Spring Security/JWT/JPA+Mybatis-Plus/Redis/Elasticsearch/Activiti 分布式限流/同步锁/验证码/SnowFlake雪花算法ID 动态权限 数据权限 工作流 代码生成 定时任务 社交账号 短信登录 单点登录 OAuth2开放平台 客服机器人 数据大屏 暗黑模式

Trending New libraries in Security Framework

ShiroExploit-Deprecated

by feihong-cs doticonjavadoticon

star image 1066 doticon

Shiro550/Shiro721 一键化利用工具,支持多种回显方式

ShiroExploit

by feihong-cs doticonjavadoticon

star image 631 doticon

Shiro550/Shiro721 一键化利用工具,支持多种回显方式

ShiroScan

by fupinglee doticonjavadoticon

star image 568 doticon

Shiro RememberMe 1.2.4 反序列化漏洞图形化检测工具(Shiro-550)

NBlog

by Naccl doticonjavadoticon

star image 545 doticonMIT

🍓 Spring Boot + Vue 前后端分离博客系统 https://naccl.top

springboot-manager

by aitangbao doticonjavadoticon

star image 407 doticonMIT

基于SpringBoot + Thymeleaf + Layui + Apache Shiro + Redis + Mybatis Plus 的后台管理系统 提供代码生成器,基本增删改查无需编写,可快速完成开发任务。 后台接口RESTful 风格,支持前后端分离,可与app公用一套接口。 开发最精简,可当脚手架,适合你来diy

Shiro_exploit

by insightglacier doticonpythondoticon

star image 283 doticon

Apache Shiro 反序列化漏洞检测与利用工具

excel-spring-boot-starter

by pig-mesh doticonjavadoticon

star image 154 doticonApache-2.0

alibaba easyexcel spring boot starter

shiro-app

by Blatzar doticonkotlindoticon

star image 148 doticonGPL-3.0

Source code for the shiro app

no

by deceptions doticonkotlindoticon

star image 117 doticonMIT

Top Authors in Security Framework

1

hiwepy

8 Libraries

star icon35

2

zhangkaitao

4 Libraries

star icon7914

3

infowangxin

3 Libraries

star icon332

4

alexxiyang

3 Libraries

star icon1024

5

telzhou618

3 Libraries

star icon43

6

apache

3 Libraries

star icon3826

7

perfree

3 Libraries

star icon67

8

zykzhangyukang

2 Libraries

star icon22

9

lhazlewood

2 Libraries

star icon256

10

zhangyd-c

2 Libraries

star icon1025

1

8 Libraries

star icon35

2

4 Libraries

star icon7914

3

3 Libraries

star icon332

4

3 Libraries

star icon1024

5

3 Libraries

star icon43

6

3 Libraries

star icon3826

7

3 Libraries

star icon67

8

2 Libraries

star icon22

9

2 Libraries

star icon256

10

2 Libraries

star icon1025

Trending Kits in Security Framework

Here is the top collection of PHP Security Libraries for developers. PHP Security Libraries will offer the developers a comprehensive security framework for writing applications. It also provides the administrator or user with various tools for securely managing those applications. 


PHP Security Libraries include large tools, APIs, and implementations commonly used for security protocols, algorithms, and mechanisms. The PHP Security APIs span various areas like public key infrastructure, authentication, cryptography, access control, and secure communication. 


We have handpicked the top 10 PHP Security Libraries for developers in 2024 for your reference: 

SecLists: 

  • Known as the security tester's companion.  
  • Is a collection of several types of lists used during security assessments collected in a single place.  
  • This might include passwords, usernames, sensitive data patterns, website URLs, web shells, fuzzing payloads, etc. 

awesome-appsec: 

  • Is a curated set of resources which helps to learn about application security. 
  • Contains websites, self-assessment quizzes, books, and blog posts. 
  • Helps in understanding the importance of end-to-end network-layer encryption and secure encryption for idle data. 

phpseclib: 

  • Takes in strings and not file paths.  
  • Does not need a public key; private keys have the public key embedded within them, which will be extracted when required.  
  • Can take in any standardized format of keys like XML signature keys, PXKS#1 formatted keys, and PuTTY keys. 

security-bundle: 

  • Provides a tight integration of the Security Component into the Symfony full-stack framework.  
  • Offers advanced options like firewalls, role_hierarchy, access_control, providers, and hashers. 
  • Also provides options to erase credentials, hide users who are not found, and access denied messages.  

security-core: 

  • Provides an infrastructure for sophisticated authorization systems that makes it possible to separate the actual authorization logic from user providers who hold the user credentials. 
  • Some HTTP-related security tools like CSRF protection and secure session cookies are provided. 
  • Offers all authentication and authorization features required for securing your application. 

security-core: 

  • Provides an infrastructure for sophisticated authorization systems that makes it possible to separate the actual authorization logic from user providers who hold the user credentials. 
  • Some HTTP-related security tools like CSRF protection and secure session cookies are provided. 
  • Offers all authentication and authorization features required for securing your application. 

security-csrf: 

  • Provides a class CsrfTokenManager to generate and validate CSRF tokens. 
  • Offers many tools for securing your application, like HTTP-related security tools like CSRF protection and secure session cookies. 
  • Provides authorization and authentication features for securing your application. 

security-http: 

  • The Security HTTP component will offer an HTTP integration of the core security component. 
  • Allows securing your application with the help of firewalls. 
  • Provides authenticators for authenticating users who visit your application. 

iniscan: 

  • Is a tool designed for scanning the php.ini file for common security practices and reporting the results.  
  • Used only in the command line and reports the results for displaying the passed and failed test cases.  
  • Offers a few commands for checking and showing the contents of your php.ini. 

Do you have the Software Bill of Materials (SBOM) for the open source project you are integrating into your application? Are you aware of potential vulnerabilities that you may be cascading to your users? The Log4j exploit and similar incidents have highlighted the spread and criticality of open source software and their security to the extent that the Federal Trade Commission (FTC) had urged U.S. organizations to patch the Log4Shell vulnerability immediately or risk facing punitive action from the agency. This year U.S. President Joe Biden signed an executive order on improving cybersecurity defenses. An SBOM is a formal, machine-readable inventory of software components and dependencies, information about those components, and their hierarchical relationships. SBOM help improves software development, supply chain management, vulnerability management, asset management, procurement, and high assurance processes while reducing cost, security risk, license risk, and compliance risk. Having the SBOM for your software and its dependencies is a critical step in knowing your user's impact from vulnerabilities. Software Package Data Exchange (SPDX) is the most widely used format for identifying software entities and conveying associated metadata. The kandi kit on Managing Software Bill Of Materials in OSS covers popular open source tools across the software supply chain's transform, produce, and consume steps and help you manage your SBOM. Take your first step in securing your software and users, using open source.

Trending Discussions on Security Framework

Upgrading Encryption Algos for Swift Dependencies

Having trouble stopping U-Boot autoboot

derby embedded database does not take path from application.properties

Run JMeter test on AWS ec2 instance (ubuntu)

Xamarin.iOS binding library cannot use the SecKey API from the Security framework

AWC EC2 Amazon Linux 2 Instances failed to boot after applying os updates

Prevent GCC from using dynamic jumps / functions invocations

ios kSecClassCertificate yields -25303

USB: why USB devices the modules automatically loaded

How reliable is NSWorkspace's runningApplications?

QUESTION

Upgrading Encryption Algos for Swift Dependencies

Asked 2022-Mar-19 at 16:26

I am using the open source MobSF security framework to scan my Swift project's source code and its dependences for vulnerabilities. Most things look pretty good however I'm concerned that it is showing me that encryption algorithms (MD5, SHA1) in my dependencies are not sufficiently secure.

What would be standard practice for solving this? I made sure to pull the latest branches for most of these but they seem to insist on using outdated algos. I am reluctant to go in and have to change their source code only to have it wiped out each time I rebuild the Podfile.

ANSWER

Answered 2022-Mar-19 at 16:26

First, it depends on why they're using these algorithms. For certain uses, there are no security problems with MD5 or SHA-1, and they may be necessary for compatibility with existing standards or backward compatibility.

As an example, PBKDF2 is perfectly secure using SHA-1 as its hash. It doesn't require a very strong hash function to maintain its own security. It's even secure using MD5. Switching to SHA-2 with PBKDF2 doesn't improve security, it's just "security hygiene," which is "avoid algorithms that have known problems even being in your code, even if they cause no problems in your particular use case." Security hygiene is a good practice, but it's not the same thing as security.

For other use cases, the security of the hash function is critical. If a framework is authenticating arbitrary messages using MD5, that's completely broken. Don't take this answer to suggest that algorithms don't matter. They do! But not in every use case. And if you want to decode credit card swipe transactions, you're probably going to need DES to be in your code, which is horribly broken, but you're still going to need it because that's how magnetic stripes are encrypted. It doesn't make your framework "insecure."

When you say "but they seem to insist on using outdated algos," I assume you mean you opened a PR and they rejected it, in which case I assume they have a good reason (such as backward compatibility when there is no actual security problem). If you haven't, then obviously the first step would be to open a PR.

That said, if you want to change this because you feel there is an actual security problem that they will not resolve, or purely for hygiene, then with CocoaPods you would fork the project, modify it, and point to your own version using the source attribute to the pod keyword.

Maintaining a cryptography framework myself, I often get bug reports that are simply wrong from developers using these scanners. Make sure that you know what the scanner is telling you and how to evaluate the findings. False positives are extremely common with these. These tools are useful, but you need to have some expertise to read their reports.

Source https://stackoverflow.com/questions/71517839

QUESTION

Having trouble stopping U-Boot autoboot

Asked 2021-Apr-22 at 15:51

Background:

I have an old Seagate BlackArmor NAS 110 that I'm trying to install Debian on by following the instructions here: https://github.com/hn/seagate-blackarmor-nas.

I have a couple of USB to TTL serial adapters (one FTDI chipset and the other Prolific) that I've tried and have run into the same issue with both. I have made the connection to the serial port on the board of the NAS using a multimeter to make sure I've gotten the pinout correct.

Problem:

I'm not able to stop the autoboot process by pressing keys and any point during the boot process. The device also does not seem to respond to any keystrokes although they are echoed back.

What I've Tried So Far:

  • Using USB to TTL serial adapters with two different chipsets
  • Using the adapters on two different computers (MacBook Pro and a ThinkPad)
  • Using different operating systems (MacOS, Windows 10, Ubuntu 20.04)
  • Using different terminal programs (Screen, Minicom, Putty)
  • Turned off hardware and software flow control
  • Tested output of adapters by shorting RX and TX pins and seeing keystrokes echoed back
  • Commands seem to be sent to device as when I type I see my commands echoed back (not sure if this is supposed to happen)

I've been at this for a few days and can't figure it out. I've also recorded my screen while experiencing the issue: https://streamable.com/xl43br. Can anyone see where I'm going wrong?

Terminal output while experiencing the problem:

1Welcome to minicom 2.7.1
2
3OPTIONS: 
4Compiled on Nov 15 2020, 08:12:42.
5Port /dev/tty.usbserial-AQ00KV6T, 16:51:31
6
7Press Meta-Z for help on special keys
8
9???
10         __  __                      _ _
11        |  \/  | __ _ _ ____   _____| | |
12        | |\/| |/ _` | '__\ \ / / _ \ | |
13        | |  | | (_| | |   \ V /  __/ | |
14        |_|  |_|\__,_|_|    \_/ \___|_|_|
15 _   _     ____              _
16| | | |   | __ )  ___   ___ | |_ 
17| | | |___|  _ \ / _ \ / _ \| __| 
18| |_| |___| |_) | (_) | (_) | |_ 
19 \___/    |____/ \___/ \___/ \__|  ** uboot_ver:v0.0.5 **
20
21 ** MARVELL BOARD: MONO LE 
22
23U-Boot 1.1.4 (Nov  6 2009 - 11:15:26) Marvell version: 3.4.18
24
25U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CDE60
26
27Soc: 88F6192 A1 (DDR2)
28CPU running @ 800Mhz L2 running @ 400Mhz
29SysClock = 200Mhz , TClock = 166Mhz 
30
31DRAM CAS Latency = 3 tRP = 3 tRAS = 8 tRCD=3
32DRAM CS[0] base 0x00000000   size 128MB 
33DRAM Total size 128MB  16bit width
34Addresses 8M - 0M are saved for the U-Boot usage.
35Mem malloc Initialization (8M - 7M): Done
36NAND:d32 MB
37
38Marvell Serial ATA Adapter
39Integrated Sata device found
40
41
42CPU : Marvell Feroceon (Rev 1)
43Scanning partition header:
44Found sign PrEr at c0000
45Found sign KrNl at 2c0000
46Found sign RoOt at 540000
47
48Streaming disabled 
49Write allocate disabled
50
51
52USB 0: host mode
53PEX 0: interface detected no Link.
54Net:   egiga0 [PRIME]
55 0  any key to stop autoboot:  1 
56
57NAND read: device 0 offset 0xc4000, size 0x195200
58
59Reading data from 0x259000 -- 100% complete.
60 1659392 bytes read: OK
61Calculate CRC32:
62crc32 checksum Pass
63
64NAND read: device 0 offset 0x2c4000, size 0x21c000
65
66Reading data from 0x4dfe00 -- 100% complete.
67 2211840 bytes read: OK
68Calculate CRC32:
69crc32 checksum Pass
70## Booting image at 00040000 ...
71   Image Name:   Linux-2.6.22.18
72   Created:      2009-11-06   3:38:29 UTC
73   Image Type:   ARM Linux Kernel Image (uncompressed)
74   Data Size:    2211388 Bytes =  2.1 MB
75   Load Address: 00008000
76   Entry Point:  00008000
77   Verifying Checksum ... OK
78OK
79
80Starting kernel ...
81
82Uncompressing Linux.......................................................................................................................................... done, booting the kernel.
83Linux version 2.6.22.18 (root@jasonDev.localdomain) (gcc version 4.2.1) #1 Fri Nov 6 11:38:22 CST 2009 v0.0.7
84CPU: ARM926EJ-S [56251311] revision 1 (ARMv5TE), cr=00053977
85Machine: Feroceon-KW
86Using UBoot passing parameters structure
87Memory policy: ECC disabled, Data cache writeback
88CPU0: D VIVT write-back cache
89CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
90CPU0: D cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
91Built 1 zonelists.  Total pages: 32512
92Kernel command line: console=ttyS0,115200 mtdparts=nand_mtd:0x000a0000@0x0(uboot),0x00010000@0x000a0000(param),0x00200000@0x000c0000(preroot),0x00280000@0x002c0000(uimage),0x01a000000
93PID hash table entries: 512 (order: 9, 2048 bytes)
94Console: colour dummy device 80x30
95Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
96Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
97Memory: 128MB 0MB 0MB 0MB = 128MB total
98Memory: 109056KB available (4048K code, 289K data, 128K init)
99Security Framework v1.0.0 initialized
100Mount-cache hash table entries: 512
101CPU: Testing write buffer coherency: ok
102NET: Registered protocol family 16
103
104CPU Interface
105-------------
106SDRAM_CS0 ....base 00000000, size 128MB 
107SDRAM_CS1 ....disable
108SDRAM_CS2 ....disable
109SDRAM_CS3 ....disable
110PEX0_MEM ....base e8000000, size 128MB 
111PEX0_IO ....base f2000000, size   1MB 
112INTER_REGS ....base f1000000, size   1MB 
113NFLASH_CS ....base fa000000, size   2MB 
114SPI_CS ....base f4000000, size  16MB 
115BOOT_ROM_CS ....no such
116DEV_BOOTCS ....no such
117CRYPT_ENG ....base f0000000, size   2MB 
118
119  Marvell Development Board (LSP Version KW_LSP_4.2.7_patch21_with_rx_desc_tuned)-- MONO  Soc: 88F6192 A1 LE
120
121 Detected Tclk 166666667 and SysClk 200000000 
122MV Buttons Device Load
123Marvell USB EHCI Host controller #0: c05b4600
124PEX0 interface detected no Link.
125PCI: bus0: Fast back to back transfers enabled
126SCSI subsystem initialized
127usbcore: registered new interface driver usbfs
128usbcore: registered new interface driver hub
129usbcore: registered new device driver usb
130NET: Registered protocol family 2
131Time: kw_clocksource clocksource has been installed.
132IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
133TCP established hash table entries: 4096 (order: 3, 32768 bytes)
134TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
135TCP: Hash tables configured (established 4096 bind 4096)
136TCP reno registered
137checking if image is initramfs...it isn't (bad gzip magic numbers); looks like an initrd
138Freeing initrd memory: 16384K
139RTC registered
140Use the XOR engines (acceleration) for enhancing the following functions:
141  o RAID 5 Xor calculation
142  o kernel memcpy
143  o kenrel memzero
144Number of XOR engines to use: 4
145cesadev_init(c00116c4)
146mvCesaInit: sessions=640, queue=64, pSram=f0000000
147MV Buttons Driver Load
148VFS: Disk quotas dquot_6.5.1
149Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
150Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
151JFFS2 version 2.2. (NAND) ?Â?© 2001-2006 Red Hat, Inc.
152fuse init (API version 7.8)
153SGI XFS with large block numbers, no debug enabled
154io scheduler noop registered
155io scheduler anticipatory registered (default)
156Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled
157serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
158serial8250.0: ttyS1 at MMIO 0xf1012100 (irq = 34) is a 16550A
159RAMDISK driver initialized: 2 RAM disks of 16384K size 1024 blocksize
160loop: module loaded
161Loading Marvell Ethernet Driver:
162  o Cached descriptors in DRAM
163  o DRAM SW cache-coherency
164  o Single RX Queue support - ETH_DEF_RXQ=0
165  o Single TX Queue support - ETH_DEF_TXQ=0
166  o TCP segmentation offload enabled
167  o Receive checksum offload enabled
168  o Transmit checksum offload enabled
169  o Network Fast Processing (Routing) supported
170  o Driver ERROR statistics enabled
171  o Driver INFO statistics enabled
172  o Proc tool API enabled
173  o Rx descripors: q0=256
174  o Tx descripors: q0=532
175  o Loading network interface(s):
176    o egiga0, ifindex = 1, GbE port = 0
177
178Warning: Giga 1 is Powered Off
179
180mvFpRuleDb (c73ab000): 1024 entries, 4096 bytes
181e100: Intel(R) PRO/100 Network Driver, 3.5.17-k4-NAPI
182e100: Copyright(c) 1999-2006 Intel Corporation
183Integrated Sata device found
184scsi0 : Marvell SCSI to SATA adapter
185scsi1 : Marvell SCSI to SATA adapter
186NFTL driver: nftlcore.c $Revision: 1.98 $, nftlmount.c $Revision: 1.41 $
187NAND device: Manufacturer ID: 0xec, Chip ID: 0x75 (Samsung NAND 32MiB 3,3V 8-bit)
188Scanning device for bad blocks
1897 cmdlinepart partitions found on MTD device nand_mtd
190Using command line partition definition
191Creating 7 MTD partitions on "nand_mtd":
1920x00000000-0x000a0000 : "uboot"
1930x000a0000-0x000b0000 : "param"
1940x000c0000-0x002c0000 : "preroot"
1950x002c0000-0x00540000 : "uimage"
1960x00540000-0x01f40000 : "rootfs"
1970x01f40000-0x02000000 : "misc"
1980x00000000-0x02000000 : "flash"
199ehci_marvell ehci_marvell.70059: Marvell Orion EHCI
200ehci_marvell ehci_marvell.70059: new USB bus registered, assigned bus number 1
201ehci_marvell ehci_marvell.70059: irq 19, io base 0xf1050100
202ehci_marvell ehci_marvell.70059: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
203usb usb1: configuration #1 chosen from 1 choice
204hub 1-0:1.0: USB hub found
205hub 1-0:1.0: 1 port detected
206USB Universal Host Controller Interface driver v3.0
207usb 1-1: new high speed USB device using ehci_marvell and address 2
208usb 1-1: configuration #1 chosen from 1 choice
209hub 1-1:1.0: USB hub found
210hub 1-1:1.0: 4 ports detected
211usbcore: registered new interface driver usblp
212drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver
213Initializing USB Mass Storage driver...
214usbcore: registered new interface driver usb-storage
215USB Mass Storage support registered.
216mice: PS/2 mouse device common for all mice
217i2c /dev entries driver
218attach_adapter....
219md: linear personality registered for level -1
220md: raid0 personality registered for level 0
221md: raid1 personality registered for level 1
222md: raid10 personality registered for level 10
223raid6: int32x1     73 MB/s
224raid6: int32x2     80 MB/s
225raid6: int32x4     83 MB/s
226raid6: int32x8     74 MB/s
227raid6: using algorithm int32x4 (83 MB/s)
228md: raid6 personality registered for level 6
229md: raid5 personality registered for level 5
230md: raid4 personality registered for level 4
231raid5: measuring checksumming speed
232   arm4regs  :   722.800 MB/sec
233   8regs     :   503.200 MB/sec
234   32regs    :   600.000 MB/sec
235raid5: using function: arm4regs (722.800 MB/sec)
236device-mapper: ioctl: 4.11.0-ioctl (2006-10-12) initialised: dm-devel@redhat.com
237dm_crypt using the OCF package.
238usbcore: registered new interface driver hiddev
239usbcore: registered new interface driver usbhid
240drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver
241wix gpio_init
242Advanced Linux Sound Architecture Driver Version 1.0.14 (Thu May 31 09:03:25 2007 UTC).
243ALSA device list:
244  No soundcards found.
245TCP cubic registered
246NET: Registered protocol family 1
247NET: Registered protocol family 17
248md: Autodetecting RAID arrays.
249md: autorun ...
250md: ... autorun DONE.
251RAMDISK: cramfs filesystem found at block 0
252RAMDISK: Loading 1620KiB [1 disk] into ram disk... done.
253VFS: Mounted root (cramfs filesystem) readonly.
254Freeing init memory: 128K
255Enter Pre-Root FileSystem:
256FW_UPDATE_FLAG_RES:1
257BOARDTEST_FALG:0
258DSK1_RES:1
259DSK2_RES:1
260DSK3_RES:1
261DSK4_RES:1
262DSK1_S_RES:
263DSK2_S_RES:
264DSK3_S_RES:
265DSK4_S_RES:
266CHK_RES:1
267MD0CHK_RES:1
268init started:  BusyBox v1.1.1 (2008.10.08-08:58+0000) multi-call binary
269Starting pid 396, console /dev/ttyS0: '/etc/init.d/rcS'
270Starting network...
271Starting inetd... OK
272NOT_DEF_RES:0
273EXT3-fs: unable to read superblock
274FAT: unable to read boot sector
275EXT3-fs: unable to read superblock
276EXT2-fs: unable to read superblock
277FAT: unable to read boot sector
278FAT: unable to read boot sector
279egiga0: started
280admindasdas
281

ANSWER

Answered 2021-Apr-22 at 15:51

So it turns out there is a short somewhere between the RX pin and the +3.3V pin which is not allowing me to send anything to the board. Thank you to those who have commented.

Source https://stackoverflow.com/questions/67169585

QUESTION

derby embedded database does not take path from application.properties

Asked 2020-Nov-26 at 09:53

I want to make derby persistent but giving path at application.properties in spring batch but the derby is getting initialized as in memory without the recognizing the path .is there anyway i can specify the path in data source in embedded derby

here is the application.properties

1spring.batch.initialize-schema=ALWAYS
2spring.datasource.url=jdbc:derby:c:/new123/mydb;create=true
3spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.DerbyTenSevenDialect
4spring.jpa.hibernate.ddl-auto=create
5

here is the configuration class

1spring.batch.initialize-schema=ALWAYS
2spring.datasource.url=jdbc:derby:c:/new123/mydb;create=true
3spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.DerbyTenSevenDialect
4spring.jpa.hibernate.ddl-auto=create
5package com.example.demo;
6
7import java.io.FileNotFoundException;
8import java.sql.PreparedStatement;
9import java.sql.SQLException;
10import java.util.HashMap;
11import java.util.Map;
12
13import javax.sql.DataSource;
14import javax.xml.stream.XMLStreamException;
15
16import org.springframework.batch.core.Job;
17import org.springframework.batch.core.Step;
18import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
19import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
20import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
21import org.springframework.batch.core.launch.support.RunIdIncrementer;
22import org.springframework.batch.item.database.ItemPreparedStatementSetter;
23import org.springframework.batch.item.database.JdbcBatchItemWriter;
24import org.springframework.batch.item.xml.StaxEventItemReader;
25import org.springframework.beans.factory.annotation.Autowired;
26import org.springframework.boot.context.properties.ConfigurationProperties;
27import org.springframework.context.annotation.Bean;
28import org.springframework.context.annotation.Configuration;
29import org.springframework.context.annotation.PropertySource;
30import org.springframework.core.io.ClassPathResource;
31import org.springframework.jdbc.datasource.DriverManagerDataSource;
32import org.springframework.jdbc.datasource.embedded.ConnectionProperties;
33import org.springframework.jdbc.datasource.embedded.DataSourceFactory;
34import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
35import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
36import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
37import org.springframework.oxm.xstream.XStreamMarshaller;
38
39import com.example.demo.maintablelogic.XmlMainTable;
40import com.thoughtworks.xstream.XStream;
41import com.thoughtworks.xstream.io.xml.DomDriver;
42import com.thoughtworks.xstream.mapper.CannotResolveClassException;
43import com.thoughtworks.xstream.mapper.MapperWrapper;
44
45@Configuration
46@EnableBatchProcessing
47@PropertySource("application.properties")
48public class BatchConfiguration {
49
50    @Autowired
51    public JobBuilderFactory jobBuilderFactory;
52
53    @Autowired
54    public StepBuilderFactory stepBuilderFactory;
55
56    @Autowired
57    private DataSource dataSource;
58
59    
60      @Bean public DataSource dataSource() { EmbeddedDatabaseBuilder builder = new
61      EmbeddedDatabaseBuilder(); EmbeddedDatabase db =
62      builder.setType(EmbeddedDatabaseType.DERBY).addScript("test.sql").build();
63      return db;
64     
65      }
66    
67    @Bean
68    public StaxEventItemReader<MessageDto> reader() {
69        StaxEventItemReader<MessageDto> reader = new StaxEventItemReader<MessageDto>();
70        reader.setResource(new ClassPathResource("ssa_msg_list.xml"));
71        reader.setFragmentRootElementName("Message");
72
73        Map<String, String> aliases = new HashMap<String, String>();
74        aliases.put("Message", "com.example.demo.MessageDto");
75        CustomXStreamMarshaller xStreamMarshaller = new CustomXStreamMarshaller();
76        xStreamMarshaller.setAliases(aliases);
77        reader.setUnmarshaller(xStreamMarshaller);
78
79        return reader;
80    }
81
82    @Bean
83    public JdbcBatchItemWriter<MessageDto> writer() {
84        JdbcBatchItemWriter<MessageDto> writer = new JdbcBatchItemWriter<MessageDto>();
85        writer.setDataSource(dataSource);
86
87        writer.setSql(
88                "INSERT INTO ssa_msg_list (Uumid,UumidSuffix,BIC,Service, Status,FormatName,Message_Identifier, Date,Subformat, CreationDate, UETR,MURID) values (?,?,?,?,?,?,?,?,?,?,?,?)");
89        writer.setItemPreparedStatementSetter(new UserItemPreparedStmSetter());
90        
91
92        return writer;
93    }
94
95    private class UserItemPreparedStmSetter implements ItemPreparedStatementSetter<MessageDto> {
96
97        @Override
98        public void setValues(MessageDto user, PreparedStatement ps) throws SQLException {
99            XmlMainTable obj = new XmlMainTable();
100            try {
101                obj.createmaintable(user, ps);
102            } catch (ClassNotFoundException e) {
103                // TODO Auto-generated catch block
104                e.printStackTrace();
105            } catch (FileNotFoundException e) {
106                // TODO Auto-generated catch block
107                e.printStackTrace();
108            } catch (SQLException e) {
109                // TODO Auto-generated catch block
110                e.printStackTrace();
111            } catch (XMLStreamException e) {
112                // TODO Auto-generated catch block
113                e.printStackTrace();
114            }
115        }
116
117    }
118
119    @Bean
120    public Step step1() {
121        return stepBuilderFactory.get("step1").<MessageDto, MessageDto>chunk(10).reader(reader()).writer(writer())
122                .build();
123    }
124
125    @Bean
126    public Job importUserJob() {
127        return jobBuilderFactory.get("importUserJob").incrementer(new RunIdIncrementer()).flow(step1()).end().build();
128
129    }
130}
131

here is the console log

1spring.batch.initialize-schema=ALWAYS
2spring.datasource.url=jdbc:derby:c:/new123/mydb;create=true
3spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.DerbyTenSevenDialect
4spring.jpa.hibernate.ddl-auto=create
5package com.example.demo;
6
7import java.io.FileNotFoundException;
8import java.sql.PreparedStatement;
9import java.sql.SQLException;
10import java.util.HashMap;
11import java.util.Map;
12
13import javax.sql.DataSource;
14import javax.xml.stream.XMLStreamException;
15
16import org.springframework.batch.core.Job;
17import org.springframework.batch.core.Step;
18import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
19import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
20import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
21import org.springframework.batch.core.launch.support.RunIdIncrementer;
22import org.springframework.batch.item.database.ItemPreparedStatementSetter;
23import org.springframework.batch.item.database.JdbcBatchItemWriter;
24import org.springframework.batch.item.xml.StaxEventItemReader;
25import org.springframework.beans.factory.annotation.Autowired;
26import org.springframework.boot.context.properties.ConfigurationProperties;
27import org.springframework.context.annotation.Bean;
28import org.springframework.context.annotation.Configuration;
29import org.springframework.context.annotation.PropertySource;
30import org.springframework.core.io.ClassPathResource;
31import org.springframework.jdbc.datasource.DriverManagerDataSource;
32import org.springframework.jdbc.datasource.embedded.ConnectionProperties;
33import org.springframework.jdbc.datasource.embedded.DataSourceFactory;
34import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
35import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
36import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
37import org.springframework.oxm.xstream.XStreamMarshaller;
38
39import com.example.demo.maintablelogic.XmlMainTable;
40import com.thoughtworks.xstream.XStream;
41import com.thoughtworks.xstream.io.xml.DomDriver;
42import com.thoughtworks.xstream.mapper.CannotResolveClassException;
43import com.thoughtworks.xstream.mapper.MapperWrapper;
44
45@Configuration
46@EnableBatchProcessing
47@PropertySource("application.properties")
48public class BatchConfiguration {
49
50    @Autowired
51    public JobBuilderFactory jobBuilderFactory;
52
53    @Autowired
54    public StepBuilderFactory stepBuilderFactory;
55
56    @Autowired
57    private DataSource dataSource;
58
59    
60      @Bean public DataSource dataSource() { EmbeddedDatabaseBuilder builder = new
61      EmbeddedDatabaseBuilder(); EmbeddedDatabase db =
62      builder.setType(EmbeddedDatabaseType.DERBY).addScript("test.sql").build();
63      return db;
64     
65      }
66    
67    @Bean
68    public StaxEventItemReader<MessageDto> reader() {
69        StaxEventItemReader<MessageDto> reader = new StaxEventItemReader<MessageDto>();
70        reader.setResource(new ClassPathResource("ssa_msg_list.xml"));
71        reader.setFragmentRootElementName("Message");
72
73        Map<String, String> aliases = new HashMap<String, String>();
74        aliases.put("Message", "com.example.demo.MessageDto");
75        CustomXStreamMarshaller xStreamMarshaller = new CustomXStreamMarshaller();
76        xStreamMarshaller.setAliases(aliases);
77        reader.setUnmarshaller(xStreamMarshaller);
78
79        return reader;
80    }
81
82    @Bean
83    public JdbcBatchItemWriter<MessageDto> writer() {
84        JdbcBatchItemWriter<MessageDto> writer = new JdbcBatchItemWriter<MessageDto>();
85        writer.setDataSource(dataSource);
86
87        writer.setSql(
88                "INSERT INTO ssa_msg_list (Uumid,UumidSuffix,BIC,Service, Status,FormatName,Message_Identifier, Date,Subformat, CreationDate, UETR,MURID) values (?,?,?,?,?,?,?,?,?,?,?,?)");
89        writer.setItemPreparedStatementSetter(new UserItemPreparedStmSetter());
90        
91
92        return writer;
93    }
94
95    private class UserItemPreparedStmSetter implements ItemPreparedStatementSetter<MessageDto> {
96
97        @Override
98        public void setValues(MessageDto user, PreparedStatement ps) throws SQLException {
99            XmlMainTable obj = new XmlMainTable();
100            try {
101                obj.createmaintable(user, ps);
102            } catch (ClassNotFoundException e) {
103                // TODO Auto-generated catch block
104                e.printStackTrace();
105            } catch (FileNotFoundException e) {
106                // TODO Auto-generated catch block
107                e.printStackTrace();
108            } catch (SQLException e) {
109                // TODO Auto-generated catch block
110                e.printStackTrace();
111            } catch (XMLStreamException e) {
112                // TODO Auto-generated catch block
113                e.printStackTrace();
114            }
115        }
116
117    }
118
119    @Bean
120    public Step step1() {
121        return stepBuilderFactory.get("step1").<MessageDto, MessageDto>chunk(10).reader(reader()).writer(writer())
122                .build();
123    }
124
125    @Bean
126    public Job importUserJob() {
127        return jobBuilderFactory.get("importUserJob").incrementer(new RunIdIncrementer()).flow(step1()).end().build();
128
129    }
130}
131( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
132 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
133  '  |____| .__|_| |_|_| |_\__, | / / / /
134 =========|_|==============|___/=/_/_/_/
135 :: Spring Boot ::                (v2.4.0)
136
1372020-11-26 14:42:40.694  INFO 17552 --- [           main] com.example.demo.DemoApplication         : Starting DemoApplication using Java 15.0.1 on LAPTOP-RODPBL05 with PID 17552 (C:\Users\shanil\Desktop\demov4\demo\target\classes started by shanil in C:\Users\shanil\Desktop\demov4\demo)
1382020-11-26 14:42:40.696  INFO 17552 --- [           main] com.example.demo.DemoApplication         : No active profile set, falling back to default profiles: default
1392020-11-26 14:42:41.586  INFO 17552 --- [           main] o.s.j.d.e.EmbeddedDatabaseFactory        : Starting embedded database: url='jdbc:derby:memory:testdb;create=true', username='sa'
140successsfullly
1412020-11-26 14:42:42.525  INFO 17552 --- [           main] o.s.b.c.r.s.JobRepositoryFactoryBean     : No database type set, using meta data indicating: DERBY
1422020-11-26 14:42:42.714  INFO 17552 --- [           main] o.s.b.c.l.support.SimpleJobLauncher      : No TaskExecutor has been set, defaulting to synchronous executor.
1432020-11-26 14:42:42.824  INFO 17552 --- [           main] com.example.demo.DemoApplication         : Started DemoApplication in 2.554 seconds (JVM running for 2.971)
1442020-11-26 14:42:42.827  INFO 17552 --- [           main] o.s.b.a.b.JobLauncherApplicationRunner   : Running default command line with: []
1452020-11-26 14:42:43.057  INFO 17552 --- [           main] o.s.b.c.l.support.SimpleJobLauncher      : Job: [FlowJob: [name=importUserJob]] launched with the following parameters: [{run.id=1}]
1462020-11-26 14:42:43.178  INFO 17552 --- [           main] o.s.batch.core.job.SimpleStepHandler     : Executing step: [step1]
147WARNING: An illegal reflective access operation has occurred
148WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/C:/Users/shanil/.m2/repository/com/thoughtworks/xstream/xstream/1.4.11.1/xstream-1.4.11.1.jar) to field java.util.TreeMap.comparator
149WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields
150WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
151WARNING: All illegal access operations will be denied in a future release
152Security framework of XStream not initialized, XStream is probably vulnerable.
1532020-11-26 14:42:44.070  INFO 17552 --- [           main] o.s.batch.core.step.AbstractStep         : Step: [step1] executed in 891ms
1542020-11-26 14:42:44.085  INFO 17552 --- [           main] o.s.b.c.l.support.SimpleJobLauncher      : Job: [FlowJob: [name=importUserJob]] completed with the following parameters: [{run.id=1}] and the following status: [COMPLETED] in 1s1ms
1552020-11-26 14:42:44.089  INFO 17552 --- [extShutdownHook] o.s.j.d.e.EmbeddedDatabaseFactory        : Shutting down embedded database: url='jdbc:derby:memory:testdb;create=true'
156

ANSWER

Answered 2020-Nov-26 at 09:53

The reason for that is that you have defined the following embedded datasource:

1spring.batch.initialize-schema=ALWAYS
2spring.datasource.url=jdbc:derby:c:/new123/mydb;create=true
3spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.DerbyTenSevenDialect
4spring.jpa.hibernate.ddl-auto=create
5package com.example.demo;
6
7import java.io.FileNotFoundException;
8import java.sql.PreparedStatement;
9import java.sql.SQLException;
10import java.util.HashMap;
11import java.util.Map;
12
13import javax.sql.DataSource;
14import javax.xml.stream.XMLStreamException;
15
16import org.springframework.batch.core.Job;
17import org.springframework.batch.core.Step;
18import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
19import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
20import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
21import org.springframework.batch.core.launch.support.RunIdIncrementer;
22import org.springframework.batch.item.database.ItemPreparedStatementSetter;
23import org.springframework.batch.item.database.JdbcBatchItemWriter;
24import org.springframework.batch.item.xml.StaxEventItemReader;
25import org.springframework.beans.factory.annotation.Autowired;
26import org.springframework.boot.context.properties.ConfigurationProperties;
27import org.springframework.context.annotation.Bean;
28import org.springframework.context.annotation.Configuration;
29import org.springframework.context.annotation.PropertySource;
30import org.springframework.core.io.ClassPathResource;
31import org.springframework.jdbc.datasource.DriverManagerDataSource;
32import org.springframework.jdbc.datasource.embedded.ConnectionProperties;
33import org.springframework.jdbc.datasource.embedded.DataSourceFactory;
34import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
35import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
36import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
37import org.springframework.oxm.xstream.XStreamMarshaller;
38
39import com.example.demo.maintablelogic.XmlMainTable;
40import com.thoughtworks.xstream.XStream;
41import com.thoughtworks.xstream.io.xml.DomDriver;
42import com.thoughtworks.xstream.mapper.CannotResolveClassException;
43import com.thoughtworks.xstream.mapper.MapperWrapper;
44
45@Configuration
46@EnableBatchProcessing
47@PropertySource("application.properties")
48public class BatchConfiguration {
49
50    @Autowired
51    public JobBuilderFactory jobBuilderFactory;
52
53    @Autowired
54    public StepBuilderFactory stepBuilderFactory;
55
56    @Autowired
57    private DataSource dataSource;
58
59    
60      @Bean public DataSource dataSource() { EmbeddedDatabaseBuilder builder = new
61      EmbeddedDatabaseBuilder(); EmbeddedDatabase db =
62      builder.setType(EmbeddedDatabaseType.DERBY).addScript("test.sql").build();
63      return db;
64     
65      }
66    
67    @Bean
68    public StaxEventItemReader<MessageDto> reader() {
69        StaxEventItemReader<MessageDto> reader = new StaxEventItemReader<MessageDto>();
70        reader.setResource(new ClassPathResource("ssa_msg_list.xml"));
71        reader.setFragmentRootElementName("Message");
72
73        Map<String, String> aliases = new HashMap<String, String>();
74        aliases.put("Message", "com.example.demo.MessageDto");
75        CustomXStreamMarshaller xStreamMarshaller = new CustomXStreamMarshaller();
76        xStreamMarshaller.setAliases(aliases);
77        reader.setUnmarshaller(xStreamMarshaller);
78
79        return reader;
80    }
81
82    @Bean
83    public JdbcBatchItemWriter<MessageDto> writer() {
84        JdbcBatchItemWriter<MessageDto> writer = new JdbcBatchItemWriter<MessageDto>();
85        writer.setDataSource(dataSource);
86
87        writer.setSql(
88                "INSERT INTO ssa_msg_list (Uumid,UumidSuffix,BIC,Service, Status,FormatName,Message_Identifier, Date,Subformat, CreationDate, UETR,MURID) values (?,?,?,?,?,?,?,?,?,?,?,?)");
89        writer.setItemPreparedStatementSetter(new UserItemPreparedStmSetter());
90        
91
92        return writer;
93    }
94
95    private class UserItemPreparedStmSetter implements ItemPreparedStatementSetter<MessageDto> {
96
97        @Override
98        public void setValues(MessageDto user, PreparedStatement ps) throws SQLException {
99            XmlMainTable obj = new XmlMainTable();
100            try {
101                obj.createmaintable(user, ps);
102            } catch (ClassNotFoundException e) {
103                // TODO Auto-generated catch block
104                e.printStackTrace();
105            } catch (FileNotFoundException e) {
106                // TODO Auto-generated catch block
107                e.printStackTrace();
108            } catch (SQLException e) {
109                // TODO Auto-generated catch block
110                e.printStackTrace();
111            } catch (XMLStreamException e) {
112                // TODO Auto-generated catch block
113                e.printStackTrace();
114            }
115        }
116
117    }
118
119    @Bean
120    public Step step1() {
121        return stepBuilderFactory.get("step1").<MessageDto, MessageDto>chunk(10).reader(reader()).writer(writer())
122                .build();
123    }
124
125    @Bean
126    public Job importUserJob() {
127        return jobBuilderFactory.get("importUserJob").incrementer(new RunIdIncrementer()).flow(step1()).end().build();
128
129    }
130}
131( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
132 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
133  '  |____| .__|_| |_|_| |_\__, | / / / /
134 =========|_|==============|___/=/_/_/_/
135 :: Spring Boot ::                (v2.4.0)
136
1372020-11-26 14:42:40.694  INFO 17552 --- [           main] com.example.demo.DemoApplication         : Starting DemoApplication using Java 15.0.1 on LAPTOP-RODPBL05 with PID 17552 (C:\Users\shanil\Desktop\demov4\demo\target\classes started by shanil in C:\Users\shanil\Desktop\demov4\demo)
1382020-11-26 14:42:40.696  INFO 17552 --- [           main] com.example.demo.DemoApplication         : No active profile set, falling back to default profiles: default
1392020-11-26 14:42:41.586  INFO 17552 --- [           main] o.s.j.d.e.EmbeddedDatabaseFactory        : Starting embedded database: url='jdbc:derby:memory:testdb;create=true', username='sa'
140successsfullly
1412020-11-26 14:42:42.525  INFO 17552 --- [           main] o.s.b.c.r.s.JobRepositoryFactoryBean     : No database type set, using meta data indicating: DERBY
1422020-11-26 14:42:42.714  INFO 17552 --- [           main] o.s.b.c.l.support.SimpleJobLauncher      : No TaskExecutor has been set, defaulting to synchronous executor.
1432020-11-26 14:42:42.824  INFO 17552 --- [           main] com.example.demo.DemoApplication         : Started DemoApplication in 2.554 seconds (JVM running for 2.971)
1442020-11-26 14:42:42.827  INFO 17552 --- [           main] o.s.b.a.b.JobLauncherApplicationRunner   : Running default command line with: []
1452020-11-26 14:42:43.057  INFO 17552 --- [           main] o.s.b.c.l.support.SimpleJobLauncher      : Job: [FlowJob: [name=importUserJob]] launched with the following parameters: [{run.id=1}]
1462020-11-26 14:42:43.178  INFO 17552 --- [           main] o.s.batch.core.job.SimpleStepHandler     : Executing step: [step1]
147WARNING: An illegal reflective access operation has occurred
148WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/C:/Users/shanil/.m2/repository/com/thoughtworks/xstream/xstream/1.4.11.1/xstream-1.4.11.1.jar) to field java.util.TreeMap.comparator
149WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields
150WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
151WARNING: All illegal access operations will be denied in a future release
152Security framework of XStream not initialized, XStream is probably vulnerable.
1532020-11-26 14:42:44.070  INFO 17552 --- [           main] o.s.batch.core.step.AbstractStep         : Step: [step1] executed in 891ms
1542020-11-26 14:42:44.085  INFO 17552 --- [           main] o.s.b.c.l.support.SimpleJobLauncher      : Job: [FlowJob: [name=importUserJob]] completed with the following parameters: [{run.id=1}] and the following status: [COMPLETED] in 1s1ms
1552020-11-26 14:42:44.089  INFO 17552 --- [extShutdownHook] o.s.j.d.e.EmbeddedDatabaseFactory        : Shutting down embedded database: url='jdbc:derby:memory:testdb;create=true'
156  @Bean 
157  public DataSource dataSource() {
158     EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
159     EmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.DERBY)
160         .addScript("test.sql")
161         .build();
162     return db;
163  }
164

You either need to remove that bean and let Spring Boot create the datasource for you from application.properties, or define a regular datasource (not an embedded one), something like:

1spring.batch.initialize-schema=ALWAYS
2spring.datasource.url=jdbc:derby:c:/new123/mydb;create=true
3spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.DerbyTenSevenDialect
4spring.jpa.hibernate.ddl-auto=create
5package com.example.demo;
6
7import java.io.FileNotFoundException;
8import java.sql.PreparedStatement;
9import java.sql.SQLException;
10import java.util.HashMap;
11import java.util.Map;
12
13import javax.sql.DataSource;
14import javax.xml.stream.XMLStreamException;
15
16import org.springframework.batch.core.Job;
17import org.springframework.batch.core.Step;
18import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
19import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
20import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
21import org.springframework.batch.core.launch.support.RunIdIncrementer;
22import org.springframework.batch.item.database.ItemPreparedStatementSetter;
23import org.springframework.batch.item.database.JdbcBatchItemWriter;
24import org.springframework.batch.item.xml.StaxEventItemReader;
25import org.springframework.beans.factory.annotation.Autowired;
26import org.springframework.boot.context.properties.ConfigurationProperties;
27import org.springframework.context.annotation.Bean;
28import org.springframework.context.annotation.Configuration;
29import org.springframework.context.annotation.PropertySource;
30import org.springframework.core.io.ClassPathResource;
31import org.springframework.jdbc.datasource.DriverManagerDataSource;
32import org.springframework.jdbc.datasource.embedded.ConnectionProperties;
33import org.springframework.jdbc.datasource.embedded.DataSourceFactory;
34import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
35import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
36import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
37import org.springframework.oxm.xstream.XStreamMarshaller;
38
39import com.example.demo.maintablelogic.XmlMainTable;
40import com.thoughtworks.xstream.XStream;
41import com.thoughtworks.xstream.io.xml.DomDriver;
42import com.thoughtworks.xstream.mapper.CannotResolveClassException;
43import com.thoughtworks.xstream.mapper.MapperWrapper;
44
45@Configuration
46@EnableBatchProcessing
47@PropertySource("application.properties")
48public class BatchConfiguration {
49
50    @Autowired
51    public JobBuilderFactory jobBuilderFactory;
52
53    @Autowired
54    public StepBuilderFactory stepBuilderFactory;
55
56    @Autowired
57    private DataSource dataSource;
58
59    
60      @Bean public DataSource dataSource() { EmbeddedDatabaseBuilder builder = new
61      EmbeddedDatabaseBuilder(); EmbeddedDatabase db =
62      builder.setType(EmbeddedDatabaseType.DERBY).addScript("test.sql").build();
63      return db;
64     
65      }
66    
67    @Bean
68    public StaxEventItemReader<MessageDto> reader() {
69        StaxEventItemReader<MessageDto> reader = new StaxEventItemReader<MessageDto>();
70        reader.setResource(new ClassPathResource("ssa_msg_list.xml"));
71        reader.setFragmentRootElementName("Message");
72
73        Map<String, String> aliases = new HashMap<String, String>();
74        aliases.put("Message", "com.example.demo.MessageDto");
75        CustomXStreamMarshaller xStreamMarshaller = new CustomXStreamMarshaller();
76        xStreamMarshaller.setAliases(aliases);
77        reader.setUnmarshaller(xStreamMarshaller);
78
79        return reader;
80    }
81
82    @Bean
83    public JdbcBatchItemWriter<MessageDto> writer() {
84        JdbcBatchItemWriter<MessageDto> writer = new JdbcBatchItemWriter<MessageDto>();
85        writer.setDataSource(dataSource);
86
87        writer.setSql(
88                "INSERT INTO ssa_msg_list (Uumid,UumidSuffix,BIC,Service, Status,FormatName,Message_Identifier, Date,Subformat, CreationDate, UETR,MURID) values (?,?,?,?,?,?,?,?,?,?,?,?)");
89        writer.setItemPreparedStatementSetter(new UserItemPreparedStmSetter());
90        
91
92        return writer;
93    }
94
95    private class UserItemPreparedStmSetter implements ItemPreparedStatementSetter<MessageDto> {
96
97        @Override
98        public void setValues(MessageDto user, PreparedStatement ps) throws SQLException {
99            XmlMainTable obj = new XmlMainTable();
100            try {
101                obj.createmaintable(user, ps);
102            } catch (ClassNotFoundException e) {
103                // TODO Auto-generated catch block
104                e.printStackTrace();
105            } catch (FileNotFoundException e) {
106                // TODO Auto-generated catch block
107                e.printStackTrace();
108            } catch (SQLException e) {
109                // TODO Auto-generated catch block
110                e.printStackTrace();
111            } catch (XMLStreamException e) {
112                // TODO Auto-generated catch block
113                e.printStackTrace();
114            }
115        }
116
117    }
118
119    @Bean
120    public Step step1() {
121        return stepBuilderFactory.get("step1").<MessageDto, MessageDto>chunk(10).reader(reader()).writer(writer())
122                .build();
123    }
124
125    @Bean
126    public Job importUserJob() {
127        return jobBuilderFactory.get("importUserJob").incrementer(new RunIdIncrementer()).flow(step1()).end().build();
128
129    }
130}
131( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
132 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
133  '  |____| .__|_| |_|_| |_\__, | / / / /
134 =========|_|==============|___/=/_/_/_/
135 :: Spring Boot ::                (v2.4.0)
136
1372020-11-26 14:42:40.694  INFO 17552 --- [           main] com.example.demo.DemoApplication         : Starting DemoApplication using Java 15.0.1 on LAPTOP-RODPBL05 with PID 17552 (C:\Users\shanil\Desktop\demov4\demo\target\classes started by shanil in C:\Users\shanil\Desktop\demov4\demo)
1382020-11-26 14:42:40.696  INFO 17552 --- [           main] com.example.demo.DemoApplication         : No active profile set, falling back to default profiles: default
1392020-11-26 14:42:41.586  INFO 17552 --- [           main] o.s.j.d.e.EmbeddedDatabaseFactory        : Starting embedded database: url='jdbc:derby:memory:testdb;create=true', username='sa'
140successsfullly
1412020-11-26 14:42:42.525  INFO 17552 --- [           main] o.s.b.c.r.s.JobRepositoryFactoryBean     : No database type set, using meta data indicating: DERBY
1422020-11-26 14:42:42.714  INFO 17552 --- [           main] o.s.b.c.l.support.SimpleJobLauncher      : No TaskExecutor has been set, defaulting to synchronous executor.
1432020-11-26 14:42:42.824  INFO 17552 --- [           main] com.example.demo.DemoApplication         : Started DemoApplication in 2.554 seconds (JVM running for 2.971)
1442020-11-26 14:42:42.827  INFO 17552 --- [           main] o.s.b.a.b.JobLauncherApplicationRunner   : Running default command line with: []
1452020-11-26 14:42:43.057  INFO 17552 --- [           main] o.s.b.c.l.support.SimpleJobLauncher      : Job: [FlowJob: [name=importUserJob]] launched with the following parameters: [{run.id=1}]
1462020-11-26 14:42:43.178  INFO 17552 --- [           main] o.s.batch.core.job.SimpleStepHandler     : Executing step: [step1]
147WARNING: An illegal reflective access operation has occurred
148WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/C:/Users/shanil/.m2/repository/com/thoughtworks/xstream/xstream/1.4.11.1/xstream-1.4.11.1.jar) to field java.util.TreeMap.comparator
149WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields
150WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
151WARNING: All illegal access operations will be denied in a future release
152Security framework of XStream not initialized, XStream is probably vulnerable.
1532020-11-26 14:42:44.070  INFO 17552 --- [           main] o.s.batch.core.step.AbstractStep         : Step: [step1] executed in 891ms
1542020-11-26 14:42:44.085  INFO 17552 --- [           main] o.s.b.c.l.support.SimpleJobLauncher      : Job: [FlowJob: [name=importUserJob]] completed with the following parameters: [{run.id=1}] and the following status: [COMPLETED] in 1s1ms
1552020-11-26 14:42:44.089  INFO 17552 --- [extShutdownHook] o.s.j.d.e.EmbeddedDatabaseFactory        : Shutting down embedded database: url='jdbc:derby:memory:testdb;create=true'
156  @Bean 
157  public DataSource dataSource() {
158     EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
159     EmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.DERBY)
160         .addScript("test.sql")
161         .build();
162     return db;
163  }
164@Bean
165public DataSource datasource() {
166    org.apache.commons.dbcp2.BasicDataSource dataSource = new org.apache.commons.dbcp2.BasicDataSource();
167    // the following properties should be injected from application.properties
168    dataSource.setDriverClassName("");
169    dataSource.setUrl("url");
170    dataSource.setUsername("");
171    dataSource.setPassword("");
172    return dataSource;
173}
174

Source https://stackoverflow.com/questions/65019183

QUESTION

Run JMeter test on AWS ec2 instance (ubuntu)

Asked 2020-Nov-10 at 09:43

I am trying to set up JMeter tests in AWS on an EC2 (t2.micro) instance to run them on cmd. Therefore I wanted to use this git project: https://github.com/r4dx/terraform-aws-jmeter.

As I am new to terraform and have just basic knowledge of aws, I went step by step. So for first attempts I let the autoscaling group away and want to reach, that I can run one test against another ec2 instance, where there is the artemis broker and some applications running as a cluster.

The ec2 instance is running and has JMeter 3.3 installed. So far I added the test itself as well as the truststore.jks to /bin and a driver for artemis to the /lib folder (artemis-jms-client-all-2.15.0.jar).

When I execute "jmeter -n -t Artemis_AWS.jmx -j jmeterlogfile" I am getting following error:

1WARNING: An illegal reflective access operation has occurred 
2WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields file:/usr/share/java/xstream.jar) to field java.util.TreeMap.comparator 
3WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields    
4WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations 
5WARNING: All illegal access operations will be denied in a future release Security framework of XStream not initialized, XStream is probably vulnerable. 
6Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML from:'/jmeter-master/apache-jmeter-3.3/bin/Artemis_AWS.jmx', conversion error com.thoughtworks.xstream.converters.ConversionException: 
7---- Debugging information ---- 
8cause-exception : com.thoughtworks.xstream.converters.ConversionException 
9cause-message : 
10first-jmeter-class  : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)    
11class               : org.apache.jmeter.save.ScriptWrapper    
12required-type       : org.apache.jmeter.save.ScriptWrapper    
13converter-type      : org.apache.jmeter.save.ScriptWrapperConverter    
14path                :   jmeterTestPlan/hashTree/hashTree/hashTree[2]/PublisherSampler 
15line number         : 140 
16version             : 2.13.20170723    -------------------------------
17

This is what is in line 140 of the jmx file:

1WARNING: An illegal reflective access operation has occurred 
2WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields file:/usr/share/java/xstream.jar) to field java.util.TreeMap.comparator 
3WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields    
4WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations 
5WARNING: All illegal access operations will be denied in a future release Security framework of XStream not initialized, XStream is probably vulnerable. 
6Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML from:'/jmeter-master/apache-jmeter-3.3/bin/Artemis_AWS.jmx', conversion error com.thoughtworks.xstream.converters.ConversionException: 
7---- Debugging information ---- 
8cause-exception : com.thoughtworks.xstream.converters.ConversionException 
9cause-message : 
10first-jmeter-class  : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)    
11class               : org.apache.jmeter.save.ScriptWrapper    
12required-type       : org.apache.jmeter.save.ScriptWrapper    
13converter-type      : org.apache.jmeter.save.ScriptWrapperConverter    
14path                :   jmeterTestPlan/hashTree/hashTree/hashTree[2]/PublisherSampler 
15line number         : 140 
16version             : 2.13.20170723    -------------------------------
17<RandomVariableConfig guiclass="TestBeanGUI" testclass="RandomVariableConfig" 
18  testname="tableNumber-100" enabled="true">
19  <stringProp name="variableName">tableNumber</stringProp>
20  <stringProp name="outputFormat">000</stringProp>
21  <stringProp name="minimumValue">100</stringProp>
22  <stringProp name="maximumValue">200</stringProp>
23  <stringProp name="randomSeed">100</stringProp>
24  <boolProp name="perThread">false</boolProp>
25</RandomVariableConfig>                             <------ line 140
26<hashTree/>
27

ANSWER

Answered 2020-Nov-10 at 09:43

According to the log file you're running JMeter 2.13, not JMeter 3.3:

version : 2.13.20170723 ------------------------------- ^^^^

And Random Variable element is available since JMeter 2.3.3 so you need to upgrade your JMeter to at least 2.3.3 or higher in order to be able to use this config element.

Ubuntu has JMeter 2.13 in its repositories which is kind of old so you need to download whatever version you need from JMeter Downloads page and install it manually

More information: How to Get Started With JMeter: Installation & Test Plans

In general according to JMeter Best Practrices you should always be using the latest version of JMeter so consider upgrading to JMeter 5.3 instead of 3.3 which is kind of old as well.

Source https://stackoverflow.com/questions/64758128

QUESTION

Xamarin.iOS binding library cannot use the SecKey API from the Security framework

Asked 2020-Nov-08 at 10:58

I created a binding library from an objective-c framework. It works but it cannot use SecKey's encryption api in the Security framework. Library used it for the api request. Is Security framework not fully supported in Xamarin.iOS? Or is it not working when binding library used it?

Note: By the way I added this line to native framework for dependency:

1 <Frameworks>Foundation CFNetwork CoreFoundation Security</Frameworks>
2

Update 1:

This is the device log:

1 <Frameworks>Foundation CFNetwork CoreFoundation Security</Frameworks>
2Trust evaluate failure: [leaf AnchorTrusted]
3DemoX[10647]/1#-1 LF=22 add Error Domain=NSOSStatusErrorDomain Code=-34018 "Client has neither application-identifier nor keychain-access-groups entitlements" UserInfo={NSDescription=Client has neither application-identifier nor keychain-access-groups entitlements}
4SecTaskLoadEntitlements failed error=22 cs_flags=200, pid=10438
5SecTaskCopyDebugDescription: DemoX[10039]/0#-1 LF=0
6nw_protocol_boringssl_signal_connected(728) [C13.1:2][0x7fbe21309f80] TLS connected [version(0x0303) ciphersuite(TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) group(0x001d) signature_alg(0x0601) alpn(http/1.1) resumed(0) offered_ticket(0) false_started(0) ocsp_received(0) sct_received(0) connect_time(1811ms) flight_time(144ms) rtt(72ms) write_stalls(0) read_stalls(5)]    
7Trust evaluate failure: [leaf AnchorTrusted]
8Trust evaluate failure: [leaf AnchorTrusted TemporalValidity]
9

Update 2:

When I run the framework with the XCode below lines appears but not in the my Xamarin.iOS app

1 <Frameworks>Foundation CFNetwork CoreFoundation Security</Frameworks>
2Trust evaluate failure: [leaf AnchorTrusted]
3DemoX[10647]/1#-1 LF=22 add Error Domain=NSOSStatusErrorDomain Code=-34018 "Client has neither application-identifier nor keychain-access-groups entitlements" UserInfo={NSDescription=Client has neither application-identifier nor keychain-access-groups entitlements}
4SecTaskLoadEntitlements failed error=22 cs_flags=200, pid=10438
5SecTaskCopyDebugDescription: DemoX[10039]/0#-1 LF=0
6nw_protocol_boringssl_signal_connected(728) [C13.1:2][0x7fbe21309f80] TLS connected [version(0x0303) ciphersuite(TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) group(0x001d) signature_alg(0x0601) alpn(http/1.1) resumed(0) offered_ticket(0) false_started(0) ocsp_received(0) sct_received(0) connect_time(1811ms) flight_time(144ms) rtt(72ms) write_stalls(0) read_stalls(5)]    
7Trust evaluate failure: [leaf AnchorTrusted]
8Trust evaluate failure: [leaf AnchorTrusted TemporalValidity]
9inserted <keys,kcls=0,klbl=,atag=5253415574696C5F5075624B6579,
10crtr=0,type=42,bsiz=0,esiz=0,sdat=2001-01-01 00:00:00 +0000,
11edat=2001-01-01 00:00:00+0000,agrp=A7PT8PDBPQ.com.test.app,sync=0,
12musr=,|otherAttr,tomb=0,rowid=9,cdat=2020-11-07 11:02:34 +0000,mdat=2020-11-07 11:02:34+0000,pdmn=ak,
13sha1=24BB5BBEE125D6A051E08EA2CB72469A0C62042F,v_Data=<?>,
14UUID=********-****-****-****-************,
15persistref=,clip=0> from <SecDbConnection rw open>
16

and

1 <Frameworks>Foundation CFNetwork CoreFoundation Security</Frameworks>
2Trust evaluate failure: [leaf AnchorTrusted]
3DemoX[10647]/1#-1 LF=22 add Error Domain=NSOSStatusErrorDomain Code=-34018 "Client has neither application-identifier nor keychain-access-groups entitlements" UserInfo={NSDescription=Client has neither application-identifier nor keychain-access-groups entitlements}
4SecTaskLoadEntitlements failed error=22 cs_flags=200, pid=10438
5SecTaskCopyDebugDescription: DemoX[10039]/0#-1 LF=0
6nw_protocol_boringssl_signal_connected(728) [C13.1:2][0x7fbe21309f80] TLS connected [version(0x0303) ciphersuite(TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) group(0x001d) signature_alg(0x0601) alpn(http/1.1) resumed(0) offered_ticket(0) false_started(0) ocsp_received(0) sct_received(0) connect_time(1811ms) flight_time(144ms) rtt(72ms) write_stalls(0) read_stalls(5)]    
7Trust evaluate failure: [leaf AnchorTrusted]
8Trust evaluate failure: [leaf AnchorTrusted TemporalValidity]
9inserted <keys,kcls=0,klbl=,atag=5253415574696C5F5075624B6579,
10crtr=0,type=42,bsiz=0,esiz=0,sdat=2001-01-01 00:00:00 +0000,
11edat=2001-01-01 00:00:00+0000,agrp=A7PT8PDBPQ.com.test.app,sync=0,
12musr=,|otherAttr,tomb=0,rowid=9,cdat=2020-11-07 11:02:34 +0000,mdat=2020-11-07 11:02:34+0000,pdmn=ak,
13sha1=24BB5BBEE125D6A051E08EA2CB72469A0C62042F,v_Data=<?>,
14UUID=********-****-****-****-************,
15persistref=,clip=0> from <SecDbConnection rw open>
16deleted 
17<keys,kcls=0,klbl=,atag=5253415574696C5F5075624B6579,crtr=0,type=42,
18bsi=,esiz=0,sdat=2001-01-01 00:00:00 +0000,edat=2001-01-01 00:00:00
19+0000,agrp=A7PT8PDBPQ.com.test.app,sync=0,musr=,
20|otherAttr,tomb=0,rowid=7,cdat=2020-11-07 11:01:55 
21+0000,mdat=2020-11-07 11:01:55 +0000,pdmn=ak,
22sha1=F1A9A4EC0C5AC67D354C9D7602E118B8DF5EFAF5,
23v_Data=<?>,accc=310C300A0C0470726F740C02616B,
24UUID=********-****-****-****-************,
25persistref=,clip=0> from <SecDbConnection rw open>
26

ANSWER

Answered 2020-Nov-08 at 10:49

So I will answer my own questions since I found the solution. The reason behind the problem is SecKeyRef using KeyChain access to read and write key as stated in official documentation:

A SecKeyRef instance that represents a key that is stored in a keychain can be safely cast to a SecKeychainItemRef for manipulation as a keychain item. On the other hand, if the key is not stored in a keychain, casting the object to a SecKeychainItemRef and passing it to Keychain Services functions returns errors.

Having a provisioning profile in Xcode to use SecKeyRef is not important, but in Visual Studio Mac, it is required to use Entitlements.plist to enable keychain access. So if your binding library used the SecKey API, you need to enable KeyChain Access in Entitlements.plist and set apple developer account in project.

1 <Frameworks>Foundation CFNetwork CoreFoundation Security</Frameworks>
2Trust evaluate failure: [leaf AnchorTrusted]
3DemoX[10647]/1#-1 LF=22 add Error Domain=NSOSStatusErrorDomain Code=-34018 "Client has neither application-identifier nor keychain-access-groups entitlements" UserInfo={NSDescription=Client has neither application-identifier nor keychain-access-groups entitlements}
4SecTaskLoadEntitlements failed error=22 cs_flags=200, pid=10438
5SecTaskCopyDebugDescription: DemoX[10039]/0#-1 LF=0
6nw_protocol_boringssl_signal_connected(728) [C13.1:2][0x7fbe21309f80] TLS connected [version(0x0303) ciphersuite(TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) group(0x001d) signature_alg(0x0601) alpn(http/1.1) resumed(0) offered_ticket(0) false_started(0) ocsp_received(0) sct_received(0) connect_time(1811ms) flight_time(144ms) rtt(72ms) write_stalls(0) read_stalls(5)]    
7Trust evaluate failure: [leaf AnchorTrusted]
8Trust evaluate failure: [leaf AnchorTrusted TemporalValidity]
9inserted <keys,kcls=0,klbl=,atag=5253415574696C5F5075624B6579,
10crtr=0,type=42,bsiz=0,esiz=0,sdat=2001-01-01 00:00:00 +0000,
11edat=2001-01-01 00:00:00+0000,agrp=A7PT8PDBPQ.com.test.app,sync=0,
12musr=,|otherAttr,tomb=0,rowid=9,cdat=2020-11-07 11:02:34 +0000,mdat=2020-11-07 11:02:34+0000,pdmn=ak,
13sha1=24BB5BBEE125D6A051E08EA2CB72469A0C62042F,v_Data=<?>,
14UUID=********-****-****-****-************,
15persistref=,clip=0> from <SecDbConnection rw open>
16deleted 
17<keys,kcls=0,klbl=,atag=5253415574696C5F5075624B6579,crtr=0,type=42,
18bsi=,esiz=0,sdat=2001-01-01 00:00:00 +0000,edat=2001-01-01 00:00:00
19+0000,agrp=A7PT8PDBPQ.com.test.app,sync=0,musr=,
20|otherAttr,tomb=0,rowid=7,cdat=2020-11-07 11:01:55 
21+0000,mdat=2020-11-07 11:01:55 +0000,pdmn=ak,
22sha1=F1A9A4EC0C5AC67D354C9D7602E118B8DF5EFAF5,
23v_Data=<?>,accc=310C300A0C0470726F740C02616B,
24UUID=********-****-****-****-************,
25persistref=,clip=0> from <SecDbConnection rw open>
26<key>keychain-access-groups</key>
27<array>
28    <string>$(AppIdentifierPrefix)com.company.yourapp</string>
29</array>
30

Source https://stackoverflow.com/questions/64719935

QUESTION

AWC EC2 Amazon Linux 2 Instances failed to boot after applying os updates

Asked 2020-Oct-30 at 11:21

Yesterday we lost contact with 10 identically configured servers, after some investigation the conclusion was that a reboot after security updates had failed.

We have so far not been able to get any of the servers back online, but were lucky enough to be able to reinstall the instances without data loss.

I will paste the console log below, can anyone help me determine the root cause and perhaps give me some advice on if there is a better way to configure the server to make recovery easier (like getting past the "Press Enter to continue." prompt, that it seems to hang in).

The full log is too big for SO, so I put it on pastebin and pasted a redacted version below. I have removed the escape sequences that colorize the output and removed some double new lines, but besides that it is complete.

1[    0.000000] Linux version 4.14.200-155.322.amzn2.x86_64 (mockbuild@ip-10-0-1-230) (gcc version 7.3.1 20180712 (Red Hat 7.3.1-10) (GCC)) #1 SMP Thu Oct 15 20:11:12 UTC 2020
2[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.14.200-155.322.amzn2.x86_64 root=UUID=a1e1011e-e38f-408e-878b-fed395b47ad6 ro console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 nvme_core.io_timeout=4294967295 rd.emergency=poweroff rd.shell=0 LANG=en_US.UTF-8
3[    0.000000] e820: BIOS-provided physical RAM map:
4[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
5[    0.000000] NX (Execute Disable) protection: active
6[    0.000000] SMBIOS 2.7 present.
7[    0.000000] DMI: Amazon EC2 t3.micro/, BIOS 1.0 10/16/2017
8[    0.000000] Hypervisor detected: KVM
9[    0.000000] tsc: Fast TSC calibration using PIT
10[    0.000000] e820: last_pfn = 0x3e3fa max_arch_pfn = 0x400000000
11[    0.000000] x86/PAT: Configuration [0-7]: WB  WC  UC- UC  WB  WP  UC- WT  
12[    0.000000] Scanning 1 areas for low memory corruption
13[    0.000000] Using GB pages for direct mapping
14[    0.000000] RAMDISK: [mem 0x3433e000-0x36196fff]
15[    0.000000] ACPI: Early table checksum verification disabled
16[    0.000000] ACPI: RSDP 0x00000000000F8F80 000014 (v00 AMAZON)
17[    0.000000] ACPI: RSDT 0x000000003E3FE360 00003C (v01 AMAZON AMZNRSDT 00000001 AMZN 00000001)
18[    0.000000] ACPI: FACS 0x000000003E3FFF40 000040
19[    0.000000] ACPI: SSDT 0x000000003E3FF6C0 00087A (v01 AMAZON AMZNSSDT 00000001 AMZN 00000001)
20[    0.000000] smpboot: Allowing 2 CPUs, 0 hotplug CPUs
21[    0.000000] e820: [mem 0x40000000-0xdfffffff] available for PCI devices
22[    0.000000] Booting paravirtualized kernel on KVM
23[    0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.14.200-155.322.amzn2.x86_64 root=UUID=a1e1011e-e38f-408e-878b-fed395b47ad6 ro console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 nvme_core.io_timeout=4294967295 rd.emergency=poweroff rd.shell=0 LANG=en_US.UTF-8
24[    0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
25[    0.000000] Memory: 943540K/1019488K available (10252K kernel code, 1958K rwdata, 2780K rodata, 2088K init, 4240K bss, 75948K reserved, 0K cma-reserved)
26[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
27[    0.000000] Kernel/User page tables isolation: enabled
28[    0.000000] ftrace: allocating 26683 entries in 105 pages
29[    0.004000] Hierarchical RCU implementation.
30[    0.004000]    RCU restricting CPUs from NR_CPUS=8192 to nr_cpu_ids=2.
31[    0.004000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
32[    0.004000] NR_IRQS: 524544, nr_irqs: 440, preallocated irqs: 16
33[    0.004000] Console: colour VGA+ 80x25
34[    0.004000] console [tty0] enabled
35[    0.004000] console [ttyS0] enabled
36[    0.004005] tsc: Detected 2500.000 MHz processor
37[    0.007582] Calibrating delay loop (skipped) preset value.. 5000.00 BogoMIPS (lpj=10000000)
38[    0.008002] pid_max: default: 32768 minimum: 301
39[    0.012006] ACPI: Core revision 20170728
40[    0.016560] ACPI: 2 ACPI AML tables successfully acquired and loaded
41[    0.020015] Security Framework initialized
42[    0.024002] SELinux:  Initializing.
43[    0.028159] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
44[    0.032082] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
45[    0.036012] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes)
46[    0.040006] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes)
47[    0.044325] Last level iTLB entries: 4KB 64, 2MB 8, 4MB 8
48[    0.048003] Last level dTLB entries: 4KB 64, 2MB 0, 4MB 0, 1GB 4
49[    0.052003] Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization
50[    0.056003] Spectre V2 : Mitigation: Full generic retpoline
51[    0.060002] Spectre V2 : Spectre v2 / SpectreRSB mitigation: Filling RSB on context switch
52[    0.064002] Speculative Store Bypass: Vulnerable
53[    0.067720] TAA: Vulnerable: Clear CPU buffers attempted, no microcode
54[    0.068002] MDS: Vulnerable: Clear CPU buffers attempted, no microcode
55[    0.072086] Freeing SMP alternatives memory: 24K
56[    0.076807] smpboot: Max logical packages: 1
57[    0.080264] x2apic enabled
58[    0.084003] Switched APIC routing to physical x2apic.
59[    0.088000] ..TIMER: vector=0x30 apic1=0 pin1=0 apic2=-1 pin2=-1
60[    0.088000] smpboot: CPU0: Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz (family: 0x6, model: 0x55, stepping: 0x4)
61[    0.088074] Performance Events: unsupported p6 CPU model 85 no PMU driver, software events only.
62[    0.092046] Hierarchical SRCU implementation.
63[    0.095857] NMI watchdog: Perf event create on CPU 0 failed with -2
64[    0.096002] NMI watchdog: Perf NMI watchdog permanently disabled
65[    0.100049] smp: Bringing up secondary CPUs ...
66[    0.103696] x86: Booting SMP configuration:
67[    0.104003] .... node  #0, CPUs:      #1
68[    0.004000] kvm-clock: cpu 1, msr 0:3e357041, secondary cpu clock
69[    0.106853] KVM setup async PF for cpu 1
70[    0.107214] kvm-stealtime: cpu 1, msr 3e1161c0
71[    0.112307] MDS CPU bug present and SMT on, data leak possible. See https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/mds.html for more details.
72[    0.116006] TAA CPU bug present and SMT on, data leak possible. See https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/tsx_async_abort.html for more details.
73[    0.120007] smp: Brought up 1 node, 2 CPUs
74[    0.123417] smpboot: Total of 2 processors activated (10000.00 BogoMIPS)
75[    0.124320] devtmpfs: initialized
76[    0.126970] x86/mm: Memory block size: 128MB
77[    0.128137] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
78[    0.132008] futex hash table entries: 512 (order: 3, 32768 bytes)
79[    0.136156] NET: Registered protocol family 16
80[    0.139769] cpuidle: using governor ladder
81[    0.140013] cpuidle: using governor menu
82[    0.143281] ACPI: bus type PCI registered
83[    0.144000] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
84[    0.148144] PCI: Using configuration type 1 for base access
85[    0.156770] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
86[    0.160017] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
87[    0.164044] ACPI: Added _OSI(Module Device)
88[    0.168007] ACPI: Added _OSI(Processor Device)
89[    0.172007] ACPI: Added _OSI(3.0 _SCP Extensions)
90[    0.176004] ACPI: Added _OSI(Processor Aggregator Device)
91[    0.180007] ACPI: Interpreter enabled
92[    0.184011] ACPI: (supports S0 S4 S5)
93[    0.187094] ACPI: Using IOAPIC for interrupt routing
94[    0.188018] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
95[    0.300750] ACPI: Enabled 16 GPEs in block 00 to 0F
96[    0.308023] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
97[    0.312007] acpi PNP0A03:00: _OSC: OS supports [ASPM ClockPM Segments MSI]
98[    0.316010] acpi PNP0A03:00: _OSC failed (AE_NOT_FOUND); disabling ASPM
99[    0.320007] acpi PNP0A03:00: fail to add MMCONFIG information, can't access extended PCI configuration space under this bridge.
100[    0.328324] acpiphp: Slot [3] registered
101[    0.420040] acpiphp: Slot [31] registered
102[    0.424003] PCI host bridge to bus 0000:00
103[    0.536451] pci 0000:00:03.0: vgaarb: setting as boot VGA device
104[    0.540000] pci 0000:00:03.0: vgaarb: VGA device added: decodes=io+mem,owns=io+mem,locks=none
105[    0.548009] pci 0000:00:03.0: vgaarb: bridge control possible
106[    0.551996] vgaarb: loaded
107[    0.556090] EDAC MC: Ver: 3.0.0
108[    0.559140] PCI: Using ACPI for IRQ routing
109[    0.560280] NetLabel: Initializing
110[    0.563268] NetLabel:  domain hash size = 128
111[    0.568019] NetLabel:  protocols = UNLABELED CIPSOv4 CALIPSO
112[    0.571902] NetLabel:  unlabeled traffic allowed by default
113[    0.576145] clocksource: Switched to clocksource kvm-clock
114[    0.586755] VFS: Disk quotas dquot_6.6.0
115[    0.590090] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
116[    0.594562] pnp: PnP ACPI init
117[    0.597855] pnp: PnP ACPI: found 5 devices
118[    0.608231] clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns
119[    0.614881] NET: Registered protocol family 2
120[    0.618324] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
121[    0.622749] TCP bind hash table entries: 8192 (order: 5, 131072 bytes)
122[    0.626965] TCP: Hash tables configured (established 8192 bind 8192)
123[    0.631170] UDP hash table entries: 512 (order: 2, 16384 bytes)
124[    0.635163] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
125[    0.639358] NET: Registered protocol family 1
126[    0.642779] pci 0000:00:00.0: Limiting direct PCI/PCI transfers
127[    0.646797] pci 0000:00:01.0: Activating ISA DMA hang workarounds
128[    0.651113] pci 0000:00:03.0: Video device with shadowed ROM at [mem 0x000c0000-0x000dffff]
129[    0.657825] Unpacking initramfs...
130[    0.734208] Freeing initrd memory: 31076K
131[    0.737636] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x240939f1bb2, max_idle_ns: 440795263295 ns
132[    0.745181] Scanning for low memory corruption every 60 seconds
133[    0.750602] audit: initializing netlink subsys (disabled)
134[    0.754606] audit: type=2000 audit(1603879247.564:1): state=initialized audit_enabled=0 res=1
135[    0.754917] Initialise system trusted keyrings
136[    0.764927] Key type blacklist registered
137[    0.768266] workingset: timestamp_bits=36 max_order=18 bucket_order=0
138[    0.773861] zbud: loaded
139[    0.905903] Key type asymmetric registered
140[    0.909292] Asymmetric key parser 'x509' registered
141[    0.912915] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
142[    0.918972] io scheduler noop registered (default)
143[    0.922543] io scheduler cfq registered
144[    0.925904] crc32: CRC_LE_BITS = 64, CRC_BE BITS = 64
145[    0.964594] crc32c_combine: 8373 self tests passed
146[    0.968628] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
147[    1.000785] 00:04: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
148[    1.007649] i8042: PNP: PS/2 Controller [PNP0303:KBD,PNP0f13:MOU] at 0x60,0x64 irq 1,12
149[    1.014310] i8042: Warning: Keylock active
150[    1.018572] serio: i8042 KBD port at 0x60,0x64 irq 1
151[    1.022414] serio: i8042 AUX port at 0x60,0x64 irq 12
152[    1.026284] rtc_cmos 00:00: RTC can wake from S4
153[    1.030475] rtc_cmos 00:00: rtc core: registered rtc_cmos as rtc0
154[    1.034755] rtc_cmos 00:00: alarms up to one day, 114 bytes nvram
155[    1.038955] hidraw: raw HID events driver (C) Jiri Kosina
156[    1.042936] NET: Registered protocol family 17
157[    1.046622] mce: Using 32 MCE banks
158[    1.049627] sched_clock: Marking stable (1049607566, 0)->(1755024155, -705416589)
159[    1.056014] registered taskstats version 1
160[    1.059279] Loading compiled-in X.509 certificates
161[    1.064832] Loaded X.509 cert 'Build time autogenerated kernel key: 121ffea65ca15230f4a21fe7e5b65abaabaa433c'
162[    1.072013] zswap: loaded using pool lzo/zbud
163[    1.075526] ima: No TPM chip found, activating TPM-bypass! (rc=-19)
164[    1.079746] ima: Allocated hash algorithm: sha1
165[    1.083589] rtc_cmos 00:00: setting system clock to 2020-10-28 09:59:31 UTC (1603879171)
166[    1.091820] Freeing unused kernel memory: 2088K
167[    1.116102] Write protecting the kernel read-only data: 16384k
168[    1.120697] Freeing unused kernel memory: 2016K
169[    1.126528] Freeing unused kernel memory: 1316K
170[    1.160972] systemd[1]: Inserted module 'autofs4'
171[    1.176133] NET: Registered protocol family 10
172[    1.181508] Segment Routing with IPv6
173[    1.184828] systemd[1]: Inserted module 'ipv6'
174[    1.189116] random: systemd: uninitialized urandom read (16 bytes read)
175[    1.193763] random: systemd: uninitialized urandom read (16 bytes read)
176[    1.198171] random: systemd: uninitialized urandom read (16 bytes read)
177[    1.205354] systemd[1]: systemd 219 running in system mode. (+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
178[    1.217384] systemd[1]: Detected virtualization kvm.
179[    1.221077] systemd[1]: Detected architecture x86-64.
180[    1.224774] systemd[1]: Running in initial RAM disk.
181Welcome to Amazon Linux 2 dracut-033-535.amzn2.1.3 (Initramfs)
182[    1.230712] systemd[1]: No hostname configured.
183[    1.234213] systemd[1]: Set hostname to <localhost>.
184[    1.237934] systemd[1]: Initializing machine ID from KVM UUID.
185[  OK  ] Reached target Swap.
186[    1.265844] systemd[1]: Reached target Swap.
187[    1.269312] systemd[1]: Starting Swap.
188[  OK  ] Created slice Root Slice.
189[    1.274036] systemd[1]: Created slice Root Slice.
190[  OK  ] Listening on Journal Socket.
191[  OK  ] Reached target Timers.
192[  OK  ] Reached target Local Encrypted Volumes.
193[  OK  ] Reached target Local File Systems.
194[  OK  ] Listening on udev Control Socket.
195[  OK  ] Created slice System Slice.
196         Starting Setup Virtual Console...
197         Starting Journal Service...
198         Starting Create list of required st... nodes for the current kernel...
199         Starting Apply Kernel Variables...
200[  OK  ] Reached target Slices.
201[  OK  ] Listening on udev Kernel Socket.
202[  OK  ] Reached target Sockets.
203         Starting dracut cmdline hook...
204[  OK  ] Started Setup Virtual Console.
205[  OK  ] Started Create list of required sta...ce nodes for the current kernel.
206[  OK  ] Started Apply Kernel Variables.
207         Starting Create Static Device Nodes in /dev...
208[  OK  ] Started Create Static Device Nodes in /dev.
209[  OK  ] Started Journal Service.
210[  OK  ] Started dracut cmdline hook.
211         Starting dracut pre-udev hook...
212[    1.390579] device-mapper: uevent: version 1.0.3
213[    1.394255] device-mapper: ioctl: 4.37.0-ioctl (2017-09-20) initialised: dm-devel@redhat.com
214[  OK  ] Started dracut pre-udev hook.
215         Starting udev Kernel Device Manager...
216[  OK  ] Started udev Kernel Device Manager.
217         Starting dracut pre-trigger hook...
218[  OK  ] Started dracut pre-trigger hook.
219         Starting udev Coldplug all Devices...
220[  OK  ] Started udev Coldplug all Devices.
221         Starting Show Plymouth Boot Screen...
222[  OK  ] Reached target System Initialization.
223         Starting dracut initqueue hook...
224[    1.534629] nvme nvme0: pci function 0000:00:04.0
225[  OK  ] Started Show Plymouth Boot Screen.
226[  OK  ] Reached target Paths.
227[  OK  ] Reached target Basic System.
228[    1.543815] ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 11
229[    1.546543] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0
230[    1.556607] nvme nvme1: pci function 0000:00:1f.0
231[    1.557854] ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 10
232[    1.576394] AVX2 version of gcm_enc/dec engaged.
233[    1.580503] AES CTR mode by8 optimization enabled
234[    1.601321] alg: No test for pcbc(aes) (pcbc-aes-aesni)
235[    1.776495]  nvme0n1: p1 p128
236[    1.908576] random: fast init done
237[  OK  ] Found device /dev/disk/by-uuid/a1e1011e-e38f-408e-878b-fed395b47ad6.
238         Starting File System Check on /dev/...e-e38f-408e-878b-fed395b47ad6...
239[  OK  ] Started File System Check on /dev/d...11e-e38f-408e-878b-fed395b47ad6.
240[  OK  ] Started dracut initqueue hook.
241[  OK  ] Reached target Remote File Systems (Pre).
242[  OK  ] Reached target Remote File Systems.
243         Starting dracut pre-mount hook...
244[  OK  ] Started dracut pre-mount hook.
245         Mounting /sysroot...
246[    2.235770] SGI XFS with ACLs, security attributes, no debug enabled
247[    2.242333] XFS (nvme0n1p1): Mounting V5 Filesystem
248[    4.142597] XFS (nvme0n1p1): Ending clean mount
249[  OK  ] Mounted /sysroot.
250[  OK  ] Reached target Initrd Root File System.
251         Starting Reload Configuration from the Real Root...
252[  OK  ] Started Reload Configuration from the Real Root.
253[  OK  ] Reached target Initrd File Systems.
254[  OK  ] Reached target Initrd Default Target.
255         Starting dracut pre-pivot and cleanup hook...
256[  OK  ] Started dracut pre-pivot and cleanup hook.
257         Starting Cleaning Up and Shutting Down Daemons...
258[  OK  ] Stopped Cleaning Up and Shutting Down Daemons.
259[  OK  ] Stopped target Timers.
260[  OK  ] Stopped dracut pre-pivot and cleanup hook.
261         Stopping dracut pre-pivot and cleanup hook...
262[  OK  ] Stopped target Remote File Systems.
263[  OK  ] Stopped target Remote File Systems (Pre).
264[  OK  ] Stopped target Initrd Default Target.
265         Starting Plymouth switch root service...
266[  OK  ] Stopped dracut pre-mount hook.
267         Stopping dracut pre-mount hook...
268[  OK  ] Stopped dracut initqueue hook.
269         Stopping dracut initqueue hook...
270[  OK  ] Stopped target Basic System.
271[  OK  ] Stopped target Sockets.
272[  OK  ] Stopped target System Initialization.
273[  OK  ] Stopped target Swap.
274[  OK  ] Stopped target Local File Systems.
275[  OK  ] Stopped Apply Kernel Variables.
276         Stopping Apply Kernel Variables...
277[  OK  ] Stopped target Local Encrypted Volumes.
278[  OK  ] Stopped udev Coldplug all Devices.
279         Stopping udev Coldplug all Devices...
280[  OK  ] Stopped dracut pre-trigger hook.
281         Stopping dracut pre-trigger hook...
282         Stopping udev Kernel Device Manager...
283[  OK  ] Stopped target Slices.
284[  OK  ] Stopped target Paths.
285[  OK  ] Stopped udev Kernel Device Manager.
286[  OK  ] Stopped Create Static Device Nodes in /dev.
287         Stopping Create Static Device Nodes in /dev...
288[  OK  ] Stopped Create list of required sta...ce nodes for the current kernel.
289         Stopping Create list of required st... nodes for the current kernel...
290[  OK  ] Stopped dracut pre-udev hook.
291         Stopping dracut pre-udev hook...
292[  OK  ] Stopped dracut cmdline hook.
293         Stopping dracut cmdline hook...
294[  OK  ] Closed udev Kernel Socket.
295[  OK  ] Closed udev Control Socket.
296         Starting Cleanup udevd DB...
297[  OK  ] Started Cleanup udevd DB.
298[  OK  ] Reached target Switch Root.
299[    4.553875] systemd-journald[667]: Received SIGTERM from PID 1 (systemd).
300[  OK  ] Started Plymouth switch root service.
301         Starting Switch Root...
302[    4.885212] systemd: 30 output lines suppressed due to ratelimiting
303[    5.925390] SELinux:  Disabled at runtime.
304[    5.980115] audit: type=1404 audit(1603879176.396:2): selinux=0 auid=4294967295 ses=4294967295
305[    6.083250] ip_tables: (C) 2000-2006 Netfilter Core Team
306[    6.106470] systemd[1]: Inserted module 'ip_tables'
307
308Welcome to Amazon Linux 2
309
310[  OK  ] Stopped Switch Root.
311[  OK  ] Stopped Journal Service.
312         Starting Journal Service...
313[  OK  ] Reached target Swap.
314[  OK  ] Listening on Delayed Shutdown Socket.
315         Mounting Huge Pages File System...
316[  OK  ] Stopped target Switch Root.
317[  OK  ] Stopped target Initrd Root File System.
318[  OK  ] Created slice system-getty.slice.
319[  OK  ] Listening on udev Control Socket.
320[  OK  ] Listening on Device-mapper event daemon FIFOs.
321[  OK  ] Created slice User and Session Slice.
322         Starting Create list of required st... nodes for the current kernel...
323[  OK  ] Listening on LVM2 poll daemon socket.
324[  OK  ] Stopped target Initrd File Systems.
325[  OK  ] Listening on udev Kernel Socket.
326         Mounting Debug File System...
327[  OK  ] Reached target Slices.
328[  OK  ] Listening on LVM2 metadata daemon socket.
329         Mounting POSIX Message Queue File System...
330[  OK  ] Created slice system-selinux\x2dpol...grate\x2dlocal\x2dchanges.slice.
331         Starting Monitoring of LVM2 mirrors... dmeventd or progress polling...
332[  OK  ] Created slice system-serial\x2dgetty.slice.
333         Starting Read and set NIS domainname from /etc/sysconfig/network...
334[  OK  ] Listening on /dev/initctl Compatibility Named Pipe.
335[  OK  ] Set up automount Arbitrary Executab...ats File System Automount Point.
336         Starting Remount Root and Kernel File Systems...
337[  OK  ] Started Journal Service.
338[  OK  ] Mounted Debug File System.
339[  OK  ] Mounted POSIX Message Queue File System.
340[  OK  ] Mounted Huge Pages File System.
341[  OK  ] Started Create list of required sta...ce nodes for the current kernel.
342[  OK  ] Started Remount Root and Kernel File Systems.
343[  OK  ] Started Read and set NIS domainname from /etc/sysconfig/network.
344         Starting udev Coldplug all Devices...
345         Starting Configure read-only root support...
346         Starting Relabel kernel modules early in the boot, if needed...
347         Starting Create Static Device Nodes in /dev...
348         Starting Flush Journal to Persistent Storage...
349[  OK  ] Started Relabel kernel modules early in the boot, if needed.
350         Starting Load Kernel Modules...
351[    7.047237] systemd-journald[1398]: Received request to flush runtime journal from PID 1
352[    7.069936] ena 0000:00:05.0: Elastic Network Adapter (ENA) v2.2.10g
353[    7.084119] ena: ena device version: 0.10
354[    7.089001] ena: ena controller version: 0.0.1 implementation version 1
355[  OK  ] Started Configure read-only root support.
356         Starting Load/Save Random Seed...
357[  OK  ] Started Load/Save Random Seed.
358[    7.156042] ena 0000:00:05.0: LLQ is not supported Fallback to host mode policy.
359[  OK  ] Started udev Coldplug all Devices.
360         Starting udev Wait for Complete Device Initialization...
361[    7.181318] ena 0000:00:05.0: Elastic Network Adapter (ENA) found at mem febf4000, mac addr 0a:cf:65:4e:dd:ff
362[  OK  ] Started Load Kernel Modules.
363         Starting Apply Kernel Variables...
364[  OK  ] Started LVM2 metadata daemon.
365         Starting LVM2 metadata daemon...
366[  OK  ] Started Apply Kernel Variables.
367[  OK  ] Started Create Static Device Nodes in /dev.
368         Starting udev Kernel Device Manager...
369[  OK  ] Started Flush Journal to Persistent Storage.
370[  OK  ] Started udev Kernel Device Manager.
371[  OK  ] Found device /dev/ttyS0.
372[    7.776329] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input3
373[    7.783413] ACPI: Power Button [PWRF]
374[    7.786723] input: Sleep Button as /devices/LNXSYSTM:00/LNXSLPBN:00/input/input4
375[    7.793032] ACPI: Sleep Button [SLPF]
376         Starting Relabel kernel modules early in the boot, if needed...
377[  OK  ] Created slice system-ec2net\x2difup.slice.
378[  OK  ] Started Relabel kernel modules early in the boot, if needed.
379[    7.888784] input: ImPS/2 Generic Wheel Mouse as /devices/platform/i8042/serio1/input/input5
380[    7.904661] mousedev: PS/2 mouse device common for all mice
381[  OK  ] Started udev Wait for Complete Device Initialization.
382         Starting Activation of DM RAID sets...
383[  OK  ] Started Activation of DM RAID sets.
384[  OK  ] Reached target Local Encrypted Volumes.
385[  OK  ] Started Monitoring of LVM2 mirrors,...ng dmeventd or progress polling.
386[  OK  ] Reached target Local File Systems (Pre).
387[   59.305661] random: crng init done
388[   59.308921] random: 7 urandom warning(s) missed due to ratelimiting
389[ TIME ] Timed out waiting for device dev-sdf.device.
390[DEPEND] Dependency failed for /home/storage.
391[DEPEND] Dependency failed for Local File Systems.
392[DEPEND] Dependency failed for Mark the need to relabel after reboot.
393[DEPEND] Dependency failed for Relabel all filesystems, if necessary.
394[DEPEND] Dependency failed for Migrate local... structure to the new structure.
395         Starting Preprocess NFS configuration...
396[  OK  ] Reached target Timers.
397[  OK  ] Reached target Network (Pre).
398[  OK  ] Reached target Login Prompts.
399[  OK  ] Reached target Cloud-init target.
400         Starting Initial hibernation setup job...
401         Starting Initial cloud-init job (metadata service crawler)...
402[  OK  ] Reached target Network.
403[  OK  ] Reached target Paths.
404[  OK  ] Reached target Sockets.
405         Starting Create Volatile Files and Directories...
406[  OK  ] Started Emergency Shell.
407         Starting Emergency Shell...
408[  OK  ] Reached target Emergency Mode.
409         Starting Tell Plymouth To Write Out Runtime Data...
410[  OK  ] Started Preprocess NFS configuration.
411[  OK  ] Started Create Volatile Files and Directories.
412         Mounting RPC Pipe File System...
413         Starting Security Auditing Service...
414         Starting RPC bind service...
415[   97.160193] RPC: Registered named UNIX socket transport module.
416[   97.160194] RPC: Registered udp transport module.
417[   97.160194] RPC: Registered tcp transport module.
418[   97.160195] RPC: Registered tcp NFSv4.1 backchannel transport module.
419[  OK  ] Mounted RPC Pipe File System.
420[  OK  ] Reached target rpc_pipefs.target.
421[  OK  ] Reached target NFS client services.
422[  OK  ] Reached target Remote File Systems (Pre).
423[  OK  ] Reached target Remote File Systems.
424[  OK  ] Started Tell Plymouth To Write Out Runtime Data.
425[  OK  ] Started RPC bind service.
426[  OK  ] Started Security Auditing Service.
427         Starting Update UTMP about System Boot/Shutdown...
428[  OK  ] Started Update UTMP about System Boot/Shutdown.
429         Starting Update UTMP about System Runlevel Changes...
430[  OK  ] Started Update UTMP about System Runlevel Changes.
431[   99.871085] hibinit-agent[1855]: Traceback (most recent call last):
432[   99.871339] hibinit-agent[1855]: File "/usr/bin/hibinit-agent", line 496, in <module>
433[   99.871592] hibinit-agent[1855]: main()
434[   99.872080] hibinit-agent[1855]: File "/usr/bin/hibinit-agent", line 435, in main
435[   99.872516] hibinit-agent[1855]: if not hibernation_enabled(config.state_dir):
436[   99.873017] hibinit-agent[1855]: File "/usr/bin/hibinit-agent", line 390, in hibernation_enabled
437[   99.873487] hibinit-agent[1855]: imds_token = get_imds_token()
438[   99.873793] hibinit-agent[1855]: File "/usr/bin/hibinit-agent", line 365, in get_imds_token
439[   99.875332] hibinit-agent[1855]: response = requests.put(token_url, headers=request_header)
440[   99.877065] hibinit-agent[1855]: File "/usr/lib/python2.7/site-packages/requests/api.py", line 121, in put
441[   99.877230] hibinit-agent[1855]: return request('put', url, data=data, **kwargs)
442[   99.877959] hibinit-agent[1855]: File "/usr/lib/python2.7/site-packages/requests/api.py", line 50, in request
443[   99.878225] hibinit-agent[1855]: response = session.request(method=method, url=url, **kwargs)
444[   99.878614] hibinit-agent[1855]: File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 486, in request
445[   99.879747] hibinit-agent[1855]: resp = self.send(prep, **send_kwargs)
446[   99.880157] hibinit-agent[1855]: File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 598, in send
447[   99.884411] hibinit-agent[1855]: r = adapter.send(request, **kwargs)
448[   99.884728] hibinit-agent[1855]: File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 419, in send
449[   99.892094] hibinit-agent[1855]: raise ConnectTimeout(e, request=request)
450[   99.892377] hibinit-agent[1855]: requests.exceptions.ConnectTimeout: HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /latest/api/token (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7efc029fa390>: Failed to establish a new connection: [Errno 101] Network is unreachable',))
451[FAILED] Failed to start Initial hibernation setup job.
452See 'systemctl status hibinit-agent.service' for details.
453[  101.215791] cloud-init[1856]: Cloud-init v. 19.3-3.amzn2 running 'init' at Wed, 28 Oct 2020 10:01:11 +0000. Up 101.18 seconds.
454[  101.264707] cloud-init[1856]: ci-info: +++++++++++++++++++++++++++Net device info++++++++++++++++++++++++++++
455[  101.264940] cloud-init[1856]: ci-info: +--------+-------+-----------+-----------+-------+-------------------+
456[  101.272469] cloud-init[1856]: ci-info: | Device |   Up  |  Address  |    Mask   | Scope |     Hw-Address    |
457[  101.274166] cloud-init[1856]: ci-info: +--------+-------+-----------+-----------+-------+-------------------+
458[  101.274497] cloud-init[1856]: ci-info: |  eth0  | False |     .     |     .     |   .   | 0a:cf:65:4e:dd:ff |
459[  101.284890] cloud-init[1856]: ci-info: |   lo   |  True | 127.0.0.1 | 255.0.0.0 |  host |         .         |
460[  101.286727] cloud-init[1856]: ci-info: |   lo   |  True |  ::1/128  |     .     |  host |         .         |
461[  101.286986] cloud-init[1856]: ci-info: +--------+-------+-----------+-----------+-------+-------------------+
462[  101.291933] cloud-init[1856]: ci-info: +++++++++++++++++++Route IPv6 info+++++++++++++++++++
463[  101.292215] cloud-init[1856]: ci-info: +-------+-------------+---------+-----------+-------+
464[  101.294122] cloud-init[1856]: ci-info: | Route | Destination | Gateway | Interface | Flags |
465[  101.294383] cloud-init[1856]: ci-info: +-------+-------------+---------+-----------+-------+
466[  101.294543] cloud-init[1856]: ci-info: +-------+-------------+---------+-----------+-------+
467Welcome to emerg
468Cannot open access to console, the root account is locked.
469See sulogin(8) man page for more details.
470Press Enter to continue.
471

ANSWER

Answered 2020-Oct-30 at 11:21

Ok, shortly after posting we figured it out. Seems like a mount point has changed (I expect due to a linux kernel update) and we have not used the nofail option in /etc/fstab as described in the aws knowledge center, this caused the server to hang at boot.

Going forward we will also ensure we use UUID mounting so we are independent on the device naming in /dev/.

Source https://stackoverflow.com/questions/64591868

QUESTION

Prevent GCC from using dynamic jumps / functions invocations

Asked 2020-Oct-02 at 04:35

I'm trying to write an assembly-instrumenter module for GCC-compiled applications as part of a security framework. To boost the performance of the module I need to reduce as much as possible dynamic jumps / dynamic function invocations. These, basically, use some dynamic pointer (e.g. a register) to perform a jump or invoke a function.

The current GCC compiler, whenever it has multiple calls to the same function (a certain label in the code), loads the label in a register and then jumps to that register whenever it needs to invoke the function. This is of course a much faster approach than to jump each time to the same label (smaller code and fewer clock cycle) but, as I was mentioning, it would be inefficient with my framework. To give you an example of what I would like to avoid here's a code snippet:

1MOV #function_label, R10.  #Copy the label to the R10 register
2CALL R10
3...
4...
5CALL R10
6...
7...
8CALL R10
9

While I would like GCC to do the following:

1MOV #function_label, R10.  #Copy the label to the R10 register
2CALL R10
3...
4...
5CALL R10
6...
7...
8CALL R10
9CALL #label_function
10...
11...
12CALL #label_function
13...
14...
15CALL #label_function
16

Beware that I'm actually using mspgcc, a GCC compiler for the MSP430 family of microcontrollers, but it should not make too much difference being based on GCC.

Do you think there is anything that can be done (apart from rewriting the GCC compiler)? Thank you very much for your help

ANSWER

Answered 2020-Oct-02 at 04:35

Use -fno-function-cse to not do common-subexpression-elimination on function addresses. GCC manual:

-fno-function-cse

Do not put function addresses in registers; make each instruction that calls a constant function contain the function’s address explicitly.

This option results in less efficient code, but some strange hacks that alter the assembler output may be confused by the optimizations performed when this option is not used.

The default is -ffunction-cse


How to find specific GCC options

I looked at gcc -O1 -fverbose-asm asm output to see all the optimization options that -O1 implies (which GCC lists in asm comments). -O1 -fno-... versions of everything compiled to just 3 call instructions with the symbol name on each, confirming that one of them was the one I wanted, so I just had to narrow it down by bisecting that list of -fno- options

I used the Godbolt compiler explorer with which has MSP430 GCC6.2.1, test code + asm. I disabled the "comments" filter option so I could see pure-comment lines in the asm output.

Since there were a ton of options, I used tr ' ' '\n' | sed -e 's/-f/-fno-/' -e '/;/d' to turn -f options into their negative form. I copy/pasted the whole block of asm comments into that command in a terminal, and copy/pasted the result into the GCC options box on Godbolt. (Along with -O1. -O0 is a special anti-optimized mode for consistent debugging, so an across-statement optimization might never be active at -O0 even with the right option. That's why I needed to negate the options instead of trying the positive form without -O1)

Then I selected and removed a bunch of options to see if that changed the asm. If not, keep going. When I found a block that did, I knew the option I wanted was in there, so I could undo (control-z) and remove all other -f options, then narrow it down to one. (As soon as I saw the name -fno-function-cse in that group, I figured that sounded like the right sort of thing. GCC options do fortunately have meaningful names if you know compiler / optimization terminology.)

That was faster than looking at 1 option at a time, or wading through the manual, because I wasn't even sure that any of those specific options would control this.


BTW, GCC doesn't do that code-size optimization for most other ISAs because it's not a performance win for them. Code-size isn't the most important factor for performance on x86-64 or even ARM thumb; the extra cost of possible branch misprediction for indirect jumps (and extra pollution of the branch predictors) outweighs the code-size cost.

It is a code-size win on x86, where a 5-byte mov-immediate or 7-byte RIP-relative lea (x86-64) can set up for multiple 2-byte call instructions.

It's usually not even a code-size win on many fixed-instruction-width ISAs like AArch64 or ARM (except in Thumb mode), where the standard code model assumes that functions will be in range of each other for relative branch-and-link (call) instructions. So calling any function takes one instruction, of the same size as any other instruction.

Even with -ffunction-cse enabled explicitly, GCC simply does not do this optimization for x86-64 or ARM thumb, even in a case where it already use a function pointer from the GOT. (x86-64 gcc -Os -fPIE -fno-plt -ffunction-cse on Godbolt. I even told GCC to optimize for code-size; saving/restoring a call-preserved register like RBX for use with a 2-byte call rbx instead of 6-byte call [RIP+rel32] would save size even after the extra instructions required to push/pop RBX (1 byte each) and load into RBX (one mov with a RIP-relative addressing mode).)

This could be considered a missed optimization for -Os, especially for ARM Thumb for "simple" cores like -mcpu=cortex-m3 which might not even have a branch predictor.

(AArch64 will load a function-pointer into a register with -fPIE -fno-plt, for function without "hidden" visibility, i.e. where the function might only be in a shared library. This happens even with -fno-function-cse. https://godbolt.org/z/f3MP56.)

Source https://stackoverflow.com/questions/64150636

QUESTION

ios kSecClassCertificate yields -25303

Asked 2020-Sep-16 at 20:34

I'm trying to store p12(pfx) certificate into keychain on ios with code from keychainswift essentially, just the klass changed from password to certificate:

1@discardableResult
2open func setCertificate(_ value: Data, forKey key: String,
3  withAccess access: KeychainSwiftAccessOptions? = nil) -> Bool {
4  
5  // The lock prevents the code to be run simultaneously
6  // from multiple threads which may result in crashing
7  lock.lock()
8  defer { lock.unlock() }
9  
10  deleteNoLock(key) // Delete any existing key before saving it
11
12  let accessible = access?.value ?? KeychainSwiftAccessOptions.defaultOption.value
13    
14  let prefixedKey = keyWithPrefix(key)
15    
16  var query: [String : Any] = [
17    KeychainSwiftConstants.klass      : kSecClassCertificate,
18    KeychainSwiftConstants.attrAccount : prefixedKey,
19    KeychainSwiftConstants.valueData   : value,
20    KeychainSwiftConstants.accessible  : accessible
21  ]
22    
23  query = addAccessGroupWhenPresent(query)
24  query = addSynchronizableIfRequired(query, addingItems: true)
25  lastQueryParameters = query
26  
27  lastResultCode = SecItemAdd(query as CFDictionary, nil)
28  
29  return lastResultCode == noErr
30}
31

getting -25303 (invalid attribute that is) Should I piecemeal store separetely identity, certificate chain and trust with different keys for this to work?

what's the difference between kSecClassCertificate and kSecClassPassword klasses of storage given that we have keychains sandboxes and without GUI? is this for forward compatibility with macos or something?

PS. Apple please attempt to find a tech writer who can fix the horrendous documentation around security framework. Thanks!

ANSWER

Answered 2020-Sep-16 at 20:34

All the available attributes for a certificate are mentioned in the documentation. I believe your attrAccount is an invalid parameter and I feel, but I'm not sure that the valueData might be invalid. So remove at least the attrAccount and possibly the valueData.

Source https://stackoverflow.com/questions/63921565

QUESTION

USB: why USB devices the modules automatically loaded

Asked 2020-Jul-11 at 14:41

I have am335x related customized board and kernel(4.4.16) source code I configure the FTDI module driver. so after kernel start successfully I attach ftdi converter to usb port and then type lsmod command to check module list

1Module                  Size  Used by    Not tainted
2cp210x                 15164  0 
3usbserial              34545  1 cp210x
4bridge                 87777  0 
5stp                     2111  1 bridge
6llc                     5184  2 bridge,stp
7usb_f_rndis            21887  2 
8usb_f_ecm               9211  2 
9u_ether                11816  2 usb_f_rndis,usb_f_ecm
10libcomposite           42715 16 usb_f_rndis,usb_f_ecm
11musb_dsps               9418  0 
12musb_hdrc              72752  1 musb_dsps
13omap_aes_driver        19511  0 
14omap_sham              22202  0 
15omap_rng                4212  0 
16rng_core                7198  1 omap_rng
17musb_am335x             1547  0 [permanent]
18

How usb serial module(cp210x) load automatically ??

I share dmesg log ( FTDI converter connect)

1Module                  Size  Used by    Not tainted
2cp210x                 15164  0 
3usbserial              34545  1 cp210x
4bridge                 87777  0 
5stp                     2111  1 bridge
6llc                     5184  2 bridge,stp
7usb_f_rndis            21887  2 
8usb_f_ecm               9211  2 
9u_ether                11816  2 usb_f_rndis,usb_f_ecm
10libcomposite           42715 16 usb_f_rndis,usb_f_ecm
11musb_dsps               9418  0 
12musb_hdrc              72752  1 musb_dsps
13omap_aes_driver        19511  0 
14omap_sham              22202  0 
15omap_rng                4212  0 
16rng_core                7198  1 omap_rng
17musb_am335x             1547  0 [permanent]
18    root@arm:~# dmesg
19    [    0.000000] Booting Linux on physical CPU 0x0
20    [    0.000000] Initializing cgroup subsys cpuset
21    [    0.000000] Initializing cgroup subsys cpu
22    [    0.000000] Initializing cgroup subsys cpuacct
23    [    0.000000] Linux version 4.4.16 (hiten@hi10) (gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) ) #1 SMP PREEMPT RT Fri Jul 10 12:56:15 IST 2020
24    [    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=50c5387d
25    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
26    [    0.000000] Machine model: TI AM335x BeagleBone Black
27    [    0.000000] cma: Reserved 24 MiB at 0x9e000000
28    [    0.000000] Memory policy: Data cache writeback
29    [    0.000000] On node 0 totalpages: 130816
30    [    0.000000] free_area_init_node: node 0, pgdat c0ab8c00, node_mem_map dfa6d000
31    [    0.000000]   Normal zone: 1150 pages used for memmap
32    [    0.000000]   Normal zone: 0 pages reserved
33    [    0.000000]   Normal zone: 130816 pages, LIFO batch:31
34    [    0.000000] CPU: All CPU(s) started in SVC mode.
35    [    0.000000] AM335X ES2.1 (neon )
36    [    0.000000] PERCPU: Embedded 13 pages/cpu @dfa2b000 s21408 r8192 d23648 u53248
37    [    0.000000] pcpu-alloc: s21408 r8192 d23648 u53248 alloc=13*4096
38    [    0.000000] pcpu-alloc: [0] 0 
39    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 129666
40    [    0.000000] Kernel command line: console=ttyS0,115200 mem=511M bootlogo=9FF00000 fbcon=rotate:1 root=/dev/mmcblk1p2 rootfstype=ext4 rw rootwait verify=n lpj=1990656 quiet
41    [    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
42    [    0.000000] Dentry cache hash table entries: 65536 (order: 7, 524288 bytes)
43    [    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
44    [    0.000000] Memory: 481260K/523264K available (6874K kernel code, 427K rwdata, 3432K rodata, 316K init, 697K bss, 17428K reserved, 24576K cma-reserved, 0K highmem)
45    [    0.000000] Virtual kernel memory layout:
46    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
47    [    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
48    [    0.000000]     vmalloc : 0xe0000000 - 0xff800000   ( 504 MB)
49    [    0.000000]     lowmem  : 0xc0000000 - 0xdff00000   ( 511 MB)
50    [    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
51    [    0.000000]     modules : 0xbf800000 - 0xbfe00000   (   6 MB)
52    [    0.000000]       .text : 0xc0008000 - 0xc0a18d40   (10308 kB)
53    [    0.000000]       .init : 0xc0a19000 - 0xc0a68000   ( 316 kB)
54    [    0.000000]       .data : 0xc0a68000 - 0xc0ad2f60   ( 428 kB)
55    [    0.000000]        .bss : 0xc0ad5000 - 0xc0b8376c   ( 698 kB)
56    [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
57    [    0.000000] Preemptible hierarchical RCU implementation.
58    [    0.000000]  Build-time adjustment of leaf fanout to 32.
59    [    0.000000]  RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1.
60    [    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=1
61    [    0.000000] NR_IRQS:16 nr_irqs:16 16
62    [    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
63    [    0.000000] OMAP clockevent source: timer2 at 24000000 Hz
64    [    0.000012] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
65    [    0.000025] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
66    [    0.000031] OMAP clocksource: timer1 at 24000000 Hz
67    [    0.000699] clocksource_probe: no matching clocksources found
68    [    0.000864] Console: colour dummy device 80x30
69    [    0.001029] Calibrating delay loop (skipped) preset value.. 995.32 BogoMIPS (lpj=1990656)
70    [    0.001034] pid_max: default: 32768 minimum: 301
71    [    0.001139] Security Framework initialized
72    [    0.001146] Yama: becoming mindful.
73    [    0.001174] AppArmor: AppArmor disabled by boot time parameter
74    [    0.001207] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
75    [    0.001212] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
76    [    0.001950] Initializing cgroup subsys io
77    [    0.001968] Initializing cgroup subsys memory
78    [    0.002000] Initializing cgroup subsys devices
79    [    0.002011] Initializing cgroup subsys freezer
80    [    0.002021] Initializing cgroup subsys net_cls
81    [    0.002030] Initializing cgroup subsys perf_event
82    [    0.002038] Initializing cgroup subsys net_prio
83    [    0.002048] Initializing cgroup subsys pids
84    [    0.002146] CPU: Testing write buffer coherency: ok
85    [    0.002508] CPU0: thread -1, cpu 0, socket -1, mpidr 0
86    [    0.002644] Setting up static identity map for 0x80008240 - 0x8000828c
87    [    0.035264] Brought up 1 CPUs
88    [    0.035289] SMP: Total of 1 processors activated (995.32 BogoMIPS).
89    [    0.035296] CPU: All CPU(s) started in SVC mode.
90    [    0.036747] devtmpfs: initialized
91    [    0.059499] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
92    [    0.078583] omap_hwmod: debugss: _wait_target_disable failed
93    [    0.133203] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
94    [    0.136912] pinctrl core: initialized pinctrl subsystem
95    [    0.138947] NET: Registered protocol family 16
96    [    0.142301] DMA: preallocated 256 KiB pool for atomic coherent allocations
97    [    0.155201] cpuidle: using governor ladder
98    [    0.167193] cpuidle: using governor menu
99    [    0.172759] OMAP GPIO hardware version 0.1
100    [    0.173271] GPIO line 61 (EMMC ResetN) hogged as output/high
101    [    0.185683] No ATAGs?
102    [    0.185711] hw-breakpoint: debug architecture 0x4 unsupported.
103    [    0.236748] edma 49000000.edma: TI EDMA DMA engine driver
104    [    0.241697] SCSI subsystem initialized
105    [    0.242030] usbcore: registered new interface driver usbfs
106    [    0.242101] usbcore: registered new interface driver hub
107    [    0.242255] usbcore: registered new device driver usb
108    [    0.242759] pps_core: LinuxPPS API ver. 1 registered
109    [    0.242769] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
110    [    0.242800] PTP clock support registered
111    [    0.243769] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400
112    [    0.248208] Bluetooth: Core ver 2.21
113    [    0.248263] NET: Registered protocol family 31
114    [    0.248271] Bluetooth: HCI device and connection manager initialized
115    [    0.248289] Bluetooth: HCI socket layer initialized
116    [    0.248302] Bluetooth: L2CAP socket layer initialized
117    [    0.248360] Bluetooth: SCO socket layer initialized
118    [    0.251264] NetLabel: Initializing
119    [    0.251276] NetLabel:  domain hash size = 128
120    [    0.251282] NetLabel:  protocols = UNLABELED CIPSOv4
121    [    0.251341] NetLabel:  unlabeled traffic allowed by default
122    [    0.252067] clocksource: Switched to clocksource timer1
123    [    0.265931] NET: Registered protocol family 2
124    [    0.266738] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
125    [    0.266797] TCP bind hash table entries: 4096 (order: 4, 114688 bytes)
126    [    0.266919] TCP: Hash tables configured (established 4096 bind 4096)
127    [    0.266996] UDP hash table entries: 256 (order: 2, 16384 bytes)
128    [    0.267027] UDP-Lite hash table entries: 256 (order: 2, 16384 bytes)
129    [    0.267253] NET: Registered protocol family 1
130    [    0.271871] RPC: Registered named UNIX socket transport module.
131    [    0.271886] RPC: Registered udp transport module.
132    [    0.271893] RPC: Registered tcp transport module.
133    [    0.271900] RPC: Registered tcp NFSv4.1 backchannel transport module.
134    [    0.273009] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
135    [    0.275531] futex hash table entries: 256 (order: 2, 16384 bytes)
136    [    0.275650] audit: initializing netlink subsys (disabled)
137    [    0.275729] audit: type=2000 audit(0.272:1): initialized
138    [    0.290633] zbud: loaded
139    [    0.291309] VFS: Disk quotas dquot_6.6.0
140    [    0.291584] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
141    [    0.299866] NFS: Registering the id_resolver key type
142    [    0.299928] Key type id_resolver registered
143    [    0.299937] Key type id_legacy registered
144    [    0.299973] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
145    [    0.299989] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
146    [    0.300916] jffs2: version 2.2. (NAND) (SUMMARY)  �© 2001-2006 Red Hat, Inc.
147    [    0.301791] fuse init (API version 7.23)
148    [    0.316180] gfs2: GFS2 installed
149    [    0.316682] ceph: loaded (mds proto 32)
150    [    0.322967] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
151    [    0.327217] io scheduler noop registered
152    [    0.327235] io scheduler deadline registered
153    [    0.327519] io scheduler cfq registered (default)
154    [    0.329111] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
155    [    0.332836] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
156    [    0.334316] Serial: 8250/16550 driver, 6 ports, IRQ sharing disabled
157    [    0.337613] console [ttyS0] disabled
158    [    0.337700] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 158, base_baud = 3000000) is a 8250
159    [    0.350727] console [ttyS0] enabled
160    [    0.351614] 481a8000.serial: ttyS4 at MMIO 0x481a8000 (irq = 159, base_baud = 3000000) is a 8250
161    [    0.352530] 481aa000.serial: ttyS5 at MMIO 0x481aa000 (irq = 160, base_baud = 3000000) is a 8250
162    [    0.353934] [drm] Initialized drm 1.1.0 20060810
163    [    0.354607] usbcore: registered new interface driver udl
164    [    0.357236] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
165    [    0.357250] [drm] No driver support for vblank timestamp query.
166    [    0.371907] Console: switching to colour frame buffer device 60x50
167    [    0.393964] tilcdc 4830e000.lcdc: fb0:  frame buffer device
168    [    0.404111] [drm] Initialized tilcdc 1.0.0 20121205 on minor 1
169    [    0.409864] brd: module loaded
170    [    0.450406] loop: module loaded
171    [    0.518959] nbd: registered device at major 43
172    [    0.533794] rbd: loaded
173    [    0.536747] mtdoops: mtd device (mtddev=name/number) must be supplied
174    [    0.547606] Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
175    [    0.554322] eql: Equalizer2002: Simon Janes (simon@ncm.com) and David S. Miller (davem@redhat.com)
176    [    0.556912] tun: Universal TUN/TAP device driver, 1.6
177    [    0.556927] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
178    [    0.608083] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
179    [    0.608102] davinci_mdio 4a101000.mdio: detected phy mask fffffffe
180    [    0.610363] libphy: 4a101000.mdio: probed
181    [    0.610390] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver Marvell 88E1510
182    [    0.611148] cpsw 4a100000.ethernet: Detected MACID = 70:b3:d5:ac:10:4f
183    [    0.612787] PPP generic driver version 2.4.2
184    [    0.613119] PPP BSD Compression module registered
185    [    0.613135] PPP Deflate Compression module registered
186    [    0.613164] PPP MPPE Compression module registered
187    [    0.613183] NET: Registered protocol family 24
188    [    0.614806] aoe: AoE v85 initialised.
189    [    0.615625] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
190    [    0.615673] ehci-platform: EHCI generic platform driver
191    [    0.615871] ehci-omap: OMAP-EHCI Host Controller driver
192    [    0.616630] usbcore: registered new interface driver usb-storage
193    [    0.617151] mousedev: PS/2 mouse device common for all mice
194    [    0.618236] TI-am335x-tsc TI-am335x-tsc: ti,charge-delay not specified
195    [    0.618771] input: ti-tsc as /devices/platform/ocp/44e0d000.tscadc/TI-am335x-tsc/input/input0
196    [    0.620600] i2c /dev entries driver
197    [    0.622290] input: tps65217_pwr_but as /devices/platform/ocp/44e0b000.i2c/i2c-0/0-0024/input/input1
198    [    0.646687] tps65217 0-0024: TPS65217 ID 0xe version 1.2
199    [    0.647205] at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
200    [    0.648549] rtc-pcf8523 0-0068: rtc core: registered rtc-pcf8523 as rtc0
201    [    0.648777] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
202    [    0.649761] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 400 kHz
203    [    0.657728] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
204    [    0.657889] Bluetooth: HCI UART driver ver 2.3
205    [    0.657901] Bluetooth: HCI UART protocol H4 registered
206    [    0.657908] Bluetooth: HCI UART protocol BCSP registered
207    [    0.657915] Bluetooth: HCI UART protocol LL registered
208    [    0.657922] Bluetooth: HCI UART protocol ATH3K registered
209    [    0.657929] Bluetooth: HCI UART protocol Three-wire (H5) registered
210    [    0.658052] Bluetooth: HCI UART protocol BCM registered
211    [    0.658060] Bluetooth: HCI UART protocol QCA registered
212    [    0.658167] usbcore: registered new interface driver btusb
213    [    0.658183] Bluetooth: Generic Bluetooth SDIO driver ver 0.1
214    [    0.658484] cpuidle: enable-method property 'ti,am3352' found operations
215    [    0.659014] pinctrl-single 44e10800.pinmux: pin 44e10960.0 already requested by 48030000.spi; cannot claim for 48060000.mmc
216    [    0.670282] pinctrl-single 44e10800.pinmux: pin-88 (48060000.mmc) status -22
217    [    0.677372] pinctrl-single 44e10800.pinmux: could not request pin 88 (44e10960.0) from group pinmux_mmc1_pins  on device pinctrl-single
218    [    0.689602] omap_hsmmc 48060000.mmc: Error applying setting, reverse things back
219    [    0.697212] omap_hsmmc 48060000.mmc: Got CD GPIO
220    [    0.761972] hidraw: raw HID events driver (C) Jiri Kosina
221    [    0.762621] usbcore: registered new interface driver usbhid
222    [    0.762633] usbhid: USB HID core driver
223    [    0.762916] ashmem: initialized
224    [    0.763496]  remoteproc0: wkup_m3 is available
225    [    0.763508]  remoteproc0: Note: remoteproc is still under development and considered experimental.
226    [    0.763516]  remoteproc0: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.
227    [    0.775946] NET: Registered protocol family 10
228    [    0.784008] mip6: Mobile IPv6
229    [    0.784114] NET: Registered protocol family 17
230    [    0.784340] Bluetooth: RFCOMM TTY layer initialized
231    [    0.784363] Bluetooth: RFCOMM socket layer initialized
232    [    0.784400] Bluetooth: RFCOMM ver 1.11
233    [    0.784424] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
234    [    0.784431] Bluetooth: BNEP filters: protocol multicast
235    [    0.784454] Bluetooth: BNEP socket layer initialized
236    [    0.784465] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
237    [    0.784479] Bluetooth: HIDP socket layer initialized
238    [    0.784603] Key type dns_resolver registered
239    [    0.784631] Key type ceph registered
240    [    0.789158] libceph: loaded (mon/osd proto 15/24)
241    [    0.789180] mpls_gso: MPLS GSO support
242    [    0.789479] omap_voltage_late_init: Voltage driver support not added
243    [    0.798672] PM: Cannot get wkup_m3_ipc handle
244    [    0.803209] ThumbEE CPU extension supported.
245    [    0.803244] Registering SWP/SWPB emulation handler
246    [    0.804385] registered taskstats version 1
247    [    0.804515] zswap: loaded using pool lzo/zbud
248    [    0.806233] Key type encrypted registered
249    [    0.812447] PM: bootloader does not support rtc-only!
250    [    0.813305]  remoteproc0: powering up wkup_m3
251    [    0.813329]  remoteproc0: Booting fw image am335x-pm-firmware.elf, size 219735
252    [    0.813589]  remoteproc0: remote processor wkup_m3 is now up
253    [    0.813651] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x191
254    [    0.814393] input: user_keys as /devices/platform/user_keys/input/input2
255    [    0.815635] rtc-pcf8523 0-0068: setting system clock to 2020-07-11 05:00:37 UTC (1594443637)
256    [    0.815678] of_cfs_init
257    [    0.815739] of_cfs_init: OK
258    [    0.822445] PM: Hibernation image not present or could not be loaded.
259    [    0.823031] mmc1: MAN_BKOPS_EN bit is not set
260    [    0.824413] Waiting for root device /dev/mmcblk1p2...
261    [    0.831058] mmc1: new high speed MMC card at address 0001
262    [    0.836641] mmcblk1: mmc1:0001 DG4008 7.28 GiB 
263    [    0.841304] mmcblk1boot0: mmc1:0001 DG4008 partition 1 4.00 MiB
264    [    0.846114] mmcblk1boot1: mmc1:0001 DG4008 partition 2 4.00 MiB
265    [    0.847520]  mmcblk1: p1 p2 p3 p4
266    [    1.159609] EXT4-fs (mmcblk1p2): recovery complete
267    [    1.160189] EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null)
268    [    1.160260] VFS: Mounted root (ext4 filesystem) on device 179:2.
269    [    1.164510] devtmpfs: mounted
270    [    1.164913] Freeing unused kernel memory: 316K (c0a19000 - c0a68000)
271    [    1.366410] random: systemd urandom read with 26 bits of entropy available
272    [    1.696671] systemd[1]: Configuration file /lib/systemd/system/Sheepapp.service is marked executable. Please remove executable permission bits. Proceeding anyway.
273    [    1.770250] systemd[1]: Cannot add dependency job for unit display-manager.service, ignoring: Unit display-manager.service failed to load: No such file or directory.
274    [    1.770531] systemd[1]: Found ordering cycle on basic.target/start
275    [    1.770555] systemd[1]: Found dependency on sysinit.target/start
276    [    1.770578] systemd[1]: Found dependency on systemd-update-utmp.service/verify-active
277    [    1.770597] systemd[1]: Found dependency on basic.target/start
278    [    1.770616] systemd[1]: Breaking ordering cycle by deleting job systemd-update-utmp.service/verify-active
279    [    1.770635] systemd[1]: Job systemd-update-utmp.service/verify-active deleted to break ordering cycle starting with basic.target/start
280    [    1.783320] systemd[1]: Found ordering cycle on basic.target/start
281    [    1.783347] systemd[1]: Found dependency on sysinit.target/start
282    [    1.783369] systemd[1]: Found dependency on systemd-tmpfiles-setup-dev.service/start
283    [    1.783388] systemd[1]: Found dependency on basic.target/start
284    [    1.783407] systemd[1]: Breaking ordering cycle by deleting job systemd-tmpfiles-setup-dev.service/start
285    [    1.783425] systemd[1]: Job systemd-tmpfiles-setup-dev.service/start deleted to break ordering cycle starting with basic.target/start
286    [    1.795594] systemd[1]: Found ordering cycle on basic.target/start
287    [    1.795617] systemd[1]: Found dependency on sysinit.target/start
288    [    1.795638] systemd[1]: Found dependency on systemd-journald.service/start
289    [    1.795657] systemd[1]: Found dependency on Sheepapp.service/start
290    [    1.795673] systemd[1]: Found dependency on basic.target/start
291    [    1.795690] systemd[1]: Breaking ordering cycle by deleting job systemd-journald.service/start
292    [    1.795709] systemd[1]: Job systemd-journald.service/start deleted to break ordering cycle starting with basic.target/start
293    [    1.937935] systemd-udevd[169]: starting version 215
294    [    2.058270] EXT4-fs (mmcblk1p2): re-mounted. Opts: errors=remount-ro
295    [    2.127552] systemd[1]: Found ordering cycle on systemd-journald.service/start
296    [    2.127595] systemd[1]: Found dependency on Sheepapp.service/start
297    [    2.127618] systemd[1]: Found dependency on basic.target/start
298    [    2.127637] systemd[1]: Found dependency on sysinit.target/start
299    [    2.127655] systemd[1]: Found dependency on systemd-journald.service/start
300    [    2.127673] systemd[1]: Unable to break cycle
301    [    2.146209] systemd[1]: Requested transaction contains an unfixable cyclic ordering dependency: Transaction order is cyclic. See system logs for details.
302    [    2.146280] systemd[1]: systemd-journald.socket failed to queue service startup job (Maybe the service file is missing or not a non-template unit?): Transaction order is cyclic. See system logs for d.
303    [    2.146631] systemd[1]: Unit systemd-journald.socket entered failed state.
304    [    3.250733] 47401300.usb-phy supply vcc not found, using dummy regulator
305    [    3.265076] 47401b00.usb-phy supply vcc not found, using dummy regulator
306    [    3.409115] omap_rng 48310000.rng: OMAP Random Number Generator ver. 20
307    [    3.759452] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2
308    [    3.794250] omap-sham 53100000.sham: hw accel on OMAP rev 4.3
309    [    3.814816] FAT-fs (mmcblk1p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
310    [    4.138771] systemd[1]: Found ordering cycle on systemd-journald.service/start
311    [    4.138814] systemd[1]: Found dependency on Sheepapp.service/start
312    [    4.138835] systemd[1]: Found dependency on basic.target/start
313    [    4.138855] systemd[1]: Found dependency on sysinit.target/start
314    [    4.138874] systemd[1]: Found dependency on systemd-journald.service/start
315    [    4.138892] systemd[1]: Unable to break cycle
316    [    4.145467] systemd[1]: Requested transaction contains an unfixable cyclic ordering dependency: Transaction order is cyclic. See system logs for details.
317    [    4.145536] systemd[1]: systemd-journald-dev-log.socket failed to queue service startup job (Maybe the service file is missing or not a non-template unit?): Transaction order is cyclic. See system lo.
318    [    4.145716] systemd[1]: Unit systemd-journald-dev-log.socket entered failed state.
319    [    4.807371] musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
320    [    4.807395] musb-hdrc: MHDRC RTL version 2.0 
321    [    4.807404] musb-hdrc: setup fifo_mode 4
322    [    4.807422] musb-hdrc: 28/31 max ep, 16384/16384 memory
323    [    4.821829] musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
324    [    4.821851] musb-hdrc: MHDRC RTL version 2.0 
325    [    4.821860] musb-hdrc: setup fifo_mode 4
326    [    4.821874] musb-hdrc: 28/31 max ep, 16384/16384 memory
327    [    4.825460] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
328    [    4.825504] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 1
329    [    4.828480] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
330    [    4.828502] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
331    [    4.828512] usb usb1: Product: MUSB HDRC host driver
332    [    4.828521] usb usb1: Manufacturer: Linux 4.4.16 musb-hcd
333    [    4.828530] usb usb1: SerialNumber: musb-hdrc.1.auto
334    [    4.832531] hub 1-0:1.0: USB hub found
335    [    4.832621] hub 1-0:1.0: 1 port detected
336    [    5.220327] usb 1-1: new full-speed USB device number 2 using musb-hdrc
337    [    5.273232] net eth0: initializing cpsw version 1.12 (0)
338    [    5.273255] net eth0: initialized cpsw ale version 1.4
339    [    5.273264] net eth0: ALE Table size 1024
340    [    5.276187] net eth0: phy found : id is : 0x1410dd1
341    [    5.285327] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
342    [    5.379690] usb 1-1: New USB device found, idVendor=10c4, idProduct=ea60
343    [    5.379714] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
344    [    5.379724] usb 1-1: Product: CP2102 USB to UART Bridge Controller
345    [    5.379734] usb 1-1: Manufacturer: Silicon Labs
346    [    5.379743] usb 1-1: SerialNumber: 0001
347    [    5.523791] usbcore: registered new interface driver usbserial
348    [    5.537093] usbcore: registered new interface driver usbserial_generic
349    [    5.557186] usbserial: USB Serial support registered for generic
350    [    5.592264] usbcore: registered new interface driver cp210x
351    [    5.604265] usbserial: USB Serial support registered for cp210x
352    [    5.604443] cp210x 1-1:1.0: cp210x converter detected
353    [    5.607466] usb 1-1: cp210x converter now attached to ttyUSB0
354    [    6.203786] systemd-logind[344]: New seat seat0.
355    [    6.245462] systemd-logind[344]: Watching system buttons on /dev/input/event1 (tps65217_pwr_but)
356    [    7.006953] random: nonblocking pool is initialized
357    [    7.086270] EXT4-fs (mmcblk1p4): 1 truncate cleaned up
358    [    7.086295] EXT4-fs (mmcblk1p4): recovery complete
359    [    7.090937] EXT4-fs (mmcblk1p4): mounted filesystem with ordered data mode. Opts: (null)
360    [    7.720936] using random self ethernet address
361    [    7.720963] using random host ethernet address
362    [    7.742781] using random self ethernet address
363    [    7.742808] using random host ethernet address
364    [    7.758850] usb0: HOST MAC 70:b3:d5:ac:10:52
365    [    7.759434] usb0: MAC 70:b3:d5:ac:10:50
366    [    7.764019] usb1: HOST MAC 70:b3:d5:ac:10:53
367    [    7.768399] usb1: MAC 70:b3:d5:ac:10:51
368    [   10.849087] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
369    [   10.865462] device usb0 entered promiscuous mode
370    [   10.877359] device usb1 entered promiscuous mode
371    [   10.894547] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready
372    [   10.905536] IPv6: ADDRCONF(NETDEV_UP): usb1: link is not ready
373    [   10.918051] IPv6: ADDRCONF(NETDEV_UP): br0: link is not ready
374    root@arm:~# 
375    CTRL-A Z for help | 115200 8N1 | NOR | Minicom 2.7 | VT102 | Offline | ttyUSB0                                                                                                                            
376

ANSWER

Answered 2020-Jul-11 at 14:41

As you can see in the dmesg output:

[ 5.379690] usb 1-1: New USB device found, idVendor=10c4, idProduct=ea60

Looking that up, e.g. here: https://www.google.com/search?q=usb%20vendor%20id%2010c4

Tells you that it's a "Silicon Labs" USB device, who also make the CP2102.

The log does not identify other devices (ignore the linux kernel root hub). So either you have also a CP2102 attached (and the FTDI is not properly connected) or the device you think is a FTDI based device, is not.

In addition you can identify currently enumerated devices using the lsusb command.

The automatic loading is usually done by udev or a similar user space daemon/mechanism. A decent explanation can be found e.g. here: https://lwn.net/Articles/740455/

Source https://stackoverflow.com/questions/62835556

QUESTION

How reliable is NSWorkspace's runningApplications?

Asked 2020-Jun-02 at 12:54

I want to terminate some applications execution after an amount of time passed. I am polling NSWorkspace's runningApplications for a lack of something to observe on (if the application is just running, does it notify of anything?)

My issue is that applications are only sometimes terminated, sometimes they take a few seconds after the time they should be closed (according to an internal timer) and sometimes they do not terminate at all!

I tried using both terminate and forceTerminate methods.

In the code snippet, apps_ is a vector of strings containing application names. It is updated regularly by another thread and its data is received before running the below code. They all run inside an es_handler_block_t

1NSArray<NSRunningApplication *> *running_apps = [NSWorkspace sharedWorkspace].runningApplications;
2for (const auto &app_ : apps_) {
3    //std::cout << app_ << "\n";
4    for (NSRunningApplication *app in running_apps) {
5        if ([[NSString stringWithUTF8String:app_.c_str()] isEqualToString:[app.executableURL lastPathComponent]] ) {
6            std::string app_name = [[app.executableURL absoluteString] UTF8String];
7            std::cout << "Terminating app " << app_name << "\n";
8            bool res_f = [app forceTerminate];
9            bool res_t = [app terminate];
10            LOG_DBG("Force terminate: %d", res_f);
11            LOG_DBG("Terminate: %d", res_t);
12            break;
13        }
14    }
15}
16

I read in runningApplications documentation that "this property will only change when the main run loop runs in a common mode". What does it mean?

I suppose it is something related to runningApplication's polling, as inserting a breakpoint in the above code (before the if check) and then resuming execution instantly kills the application that would otherwise still run.

I am not blocking the main function. I only have an Endpoint Security class for the framework, networking is done on some other thread, and I return with NSApplicationMain(argc, argv);

What could be the issue? Thanks.

EDIT: I am leveraging the Cocoa Framework to create an agent that displays only in the system tray and it has root privileges. Preventing apps from launching is successfully achieved using the Endpoint Security Framework, but I did not find a reliable way to kill already running applications that works every time.

LATER EDIT: I managed to add an observer to [[NSWorkspace sharedWorkspace] notificationCenter], but what notification should I subscribe to for an application that is running? I tried with hide but it does not work if the user just clicks on the red window button, only if he hides the app from the dock. But I still want to close it even if there is no interaction between the user and the running app.

ANSWER

Answered 2020-Jun-02 at 07:45

Terminating apps reliably on macOS depends on a lot of factors, such as:

  1. Entitlements
  2. How the app was launched
  3. If there are any background apps keeping the main app alive as soon as it crashes or is quit by another process

For example, your app may be allowed to terminate one app, but, for example, if you kill a process that was launched by launchd with a KeepAlive command using a plist like this:

1NSArray<NSRunningApplication *> *running_apps = [NSWorkspace sharedWorkspace].runningApplications;
2for (const auto &app_ : apps_) {
3    //std::cout << app_ << "\n";
4    for (NSRunningApplication *app in running_apps) {
5        if ([[NSString stringWithUTF8String:app_.c_str()] isEqualToString:[app.executableURL lastPathComponent]] ) {
6            std::string app_name = [[app.executableURL absoluteString] UTF8String];
7            std::cout << "Terminating app " << app_name << "\n";
8            bool res_f = [app forceTerminate];
9            bool res_t = [app terminate];
10            LOG_DBG("Force terminate: %d", res_f);
11            LOG_DBG("Terminate: %d", res_t);
12            break;
13        }
14    }
15}
16<?xml version="1.0" encoding="UTF-8"?>
17<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
18<plist version="1.0">
19<dict>
20    <key>KeepAlive</key>
21    <true/>
22    <key>Label</key>
23    <string>com.bundleidentifierOf.AnUnquitabbleApp</string>
24    <key>ProgramArguments</key>
25    <array>
26        <string>/path/to/the/AnUnquitableApp</string>
27    </array>
28    <key>RunAtLoad</key>
29    <true/>
30</dict>
31</plist>
32

You will be in a for surprise, because the moment you try to do so, launchd will relaunch it immediately, and it will seem as though the app was not killed, but it was. You can see that an app is relaunched, when its PID changes every time you try to kill it.

You can check that using the command:

1NSArray<NSRunningApplication *> *running_apps = [NSWorkspace sharedWorkspace].runningApplications;
2for (const auto &app_ : apps_) {
3    //std::cout << app_ << "\n";
4    for (NSRunningApplication *app in running_apps) {
5        if ([[NSString stringWithUTF8String:app_.c_str()] isEqualToString:[app.executableURL lastPathComponent]] ) {
6            std::string app_name = [[app.executableURL absoluteString] UTF8String];
7            std::cout << "Terminating app " << app_name << "\n";
8            bool res_f = [app forceTerminate];
9            bool res_t = [app terminate];
10            LOG_DBG("Force terminate: %d", res_f);
11            LOG_DBG("Terminate: %d", res_t);
12            break;
13        }
14    }
15}
16<?xml version="1.0" encoding="UTF-8"?>
17<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
18<plist version="1.0">
19<dict>
20    <key>KeepAlive</key>
21    <true/>
22    <key>Label</key>
23    <string>com.bundleidentifierOf.AnUnquitabbleApp</string>
24    <key>ProgramArguments</key>
25    <array>
26        <string>/path/to/the/AnUnquitableApp</string>
27    </array>
28    <key>RunAtLoad</key>
29    <true/>
30</dict>
31</plist>
32ps -ax
33

in Terminal to list all processes running on your Mac. If you want to know whether an application is running, then use:

1NSArray<NSRunningApplication *> *running_apps = [NSWorkspace sharedWorkspace].runningApplications;
2for (const auto &app_ : apps_) {
3    //std::cout << app_ << "\n";
4    for (NSRunningApplication *app in running_apps) {
5        if ([[NSString stringWithUTF8String:app_.c_str()] isEqualToString:[app.executableURL lastPathComponent]] ) {
6            std::string app_name = [[app.executableURL absoluteString] UTF8String];
7            std::cout << "Terminating app " << app_name << "\n";
8            bool res_f = [app forceTerminate];
9            bool res_t = [app terminate];
10            LOG_DBG("Force terminate: %d", res_f);
11            LOG_DBG("Terminate: %d", res_t);
12            break;
13        }
14    }
15}
16<?xml version="1.0" encoding="UTF-8"?>
17<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
18<plist version="1.0">
19<dict>
20    <key>KeepAlive</key>
21    <true/>
22    <key>Label</key>
23    <string>com.bundleidentifierOf.AnUnquitabbleApp</string>
24    <key>ProgramArguments</key>
25    <array>
26        <string>/path/to/the/AnUnquitableApp</string>
27    </array>
28    <key>RunAtLoad</key>
29    <true/>
30</dict>
31</plist>
32ps -ax
33ps -ax | grep "AnUnquitableAppNameHere"
34

and then you can kill it by using its PID with

1NSArray<NSRunningApplication *> *running_apps = [NSWorkspace sharedWorkspace].runningApplications;
2for (const auto &app_ : apps_) {
3    //std::cout << app_ << "\n";
4    for (NSRunningApplication *app in running_apps) {
5        if ([[NSString stringWithUTF8String:app_.c_str()] isEqualToString:[app.executableURL lastPathComponent]] ) {
6            std::string app_name = [[app.executableURL absoluteString] UTF8String];
7            std::cout << "Terminating app " << app_name << "\n";
8            bool res_f = [app forceTerminate];
9            bool res_t = [app terminate];
10            LOG_DBG("Force terminate: %d", res_f);
11            LOG_DBG("Terminate: %d", res_t);
12            break;
13        }
14    }
15}
16<?xml version="1.0" encoding="UTF-8"?>
17<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
18<plist version="1.0">
19<dict>
20    <key>KeepAlive</key>
21    <true/>
22    <key>Label</key>
23    <string>com.bundleidentifierOf.AnUnquitabbleApp</string>
24    <key>ProgramArguments</key>
25    <array>
26        <string>/path/to/the/AnUnquitableApp</string>
27    </array>
28    <key>RunAtLoad</key>
29    <true/>
30</dict>
31</plist>
32ps -ax
33ps -ax | grep "AnUnquitableAppNameHere"
34kill <PID>
35

This will help you to determine which apps you can kill with a simple QUIT signal, which ones you will need to use stronger signals to terminate them and the ones are unquitable, because to kill them requires privileges or entitlements your app may not have. Read the man page of ps and kill to learn more about your target apps.

There are many other ways on macOS to gain persistence, and if you want to understand how to reliably quit apps, you need to understand how they gained persistence in the first place.

For example, if a user has admin / superuser privileges, it can gain persistence by installing a daemon in /Library/LaunchDaemons. If your app has no root privileges, it is unlikely you will be able to kill that process.

Another way for apps to maintain persistence besides a launchd plist is , for example, have a background app that will relaunch the main app as soon as the latter is forced to quit. An example is that if you use kill to kill the latest version of Microsoft Word you will see that it will be relaunched by such a helper that will complain that Wordwas forced to quit.

The nicest way to kill an app is actually to send it a Quit Apple Event and that is what I usually do.

I do not want to discourage you, but what you are trying to achieve is more difficult that it might seem in the first place. And even if you succeed, remember that the user may kill your app and that will defeat what you are trying to achieve, unless it is kept alive by a launchd plist or another form of persistence.

Now if you want to observe which apps were killed or launched without polling, I definitely recommend that you read TN2050.

Now replying to your specific questions:

"this property will only change when the main run loop runs in a common mode"

This means that you need to have a running loop for NSRunningApplication to be updated. If you have a GUI app, such a loop is already installed for you. If your app is a CLI, then this is not installed and you need to install such a running loop yourself . If you are using Objective-C then you can do as recommended in this question.

Therefore, what you are trying to achieve has a lot of caveats, and you need to be aware of them before proceeding.

Source https://stackoverflow.com/questions/62118302

Community Discussions contain sources that include Stack Exchange Network

Tutorials and Learning Resources in Security Framework

Tutorials and Learning Resources are not available at this moment for Security Framework

Share this Page

share link

Get latest updates on Security Framework