首页 \ 问答 \ x64:为什么这段代码会给我“地址边界错误”(x64: Why does this piece of code give me “Address boundary error”)

x64:为什么这段代码会给我“地址边界错误”(x64: Why does this piece of code give me “Address boundary error”)

为什么以下x64程序集给我“地址边界错误”? 它只在我call _print_string后添加代码时才会发生。 我假设一些寄存器已被修改,但是一旦_print_string函数返回它们不应该被还原吗?

我正在使用Mac OS X.

obj_size = 8

.data
    hello_world: .asciz "hello world!"

.text
    .globl _main


_main:

    pushq %rbp
    movq %rsp, %rbp
    leaq hello_world(%rip), %rdi
    callq _print_string

    subq obj_size, %rsp
    movq 1, %rax
    movq %rax, obj_size(%rsp)

    addq obj_size, %rsp


    leave
    ret

而C程序是:

void
print_string(char *str) 
{
    printf("%s\n", str);
}

Why does the following x64 assembly give me "Address boundary error"? It only happens when I add code after call _print_string. I assume that some of the register have been modified but aren't they supposed to be reverted once the _print_string function returns?

I am using Mac OS X

obj_size = 8

.data
    hello_world: .asciz "hello world!"

.text
    .globl _main


_main:

    pushq %rbp
    movq %rsp, %rbp
    leaq hello_world(%rip), %rdi
    callq _print_string

    subq obj_size, %rsp
    movq 1, %rax
    movq %rax, obj_size(%rsp)

    addq obj_size, %rsp


    leave
    ret

And the C program is:

void
print_string(char *str) 
{
    printf("%s\n", str);
}

原文:https://stackoverflow.com/questions/43329760
更新时间:2023-08-08 19:08

最满意答案

如果未使用composer安装扩展,则必须将自动加载设置添加到项目的composer.json中。

"autoload": {
    "psr-4": {
      "Test\\Yourext\\": "web/typo3conf/ext/yourext/Classes"
    }
  }

然后你必须做一个作曲家更新作曲家转储自动加载


If your extension is not installed with composer you have to add the autoload settings into the composer.json of the project.

"autoload": {
    "psr-4": {
      "Test\\Yourext\\": "web/typo3conf/ext/yourext/Classes"
    }
  }

Then you have to do a composer update or composer dump-autoload

相关问答

更多
  • 你需要提供一个映射。 查看示例的核心内容https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/extbase/ext_typoscript_setup.txt You need to provide a mapping. Check out the core for examples https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/extbase/ext_typoscri ...
  • 您可以使用扩展名“extension_builder”。 它生成(骨架)基于extbase /流体的扩展,并与TYPO3 6.0兼容(甚至在生成的扩展中使用命名空间,这仅在6.0中引入)。 如果您想构建流媒体/扩展程序扩展,您应该阅读本书以熟悉这些扩展。 在德国,它也可以作为平装本。 我不确定“kickstarter”扩展是否仍然有效,但它的最后更新是一个维护版本,使其在TYPO3 v4.6中工作,所以它很有可能。 You can use the extension "extension_builder". ...
  • 如果未使用composer安装扩展,则必须将自动加载设置添加到项目的composer.json中。 "autoload": { "psr-4": { "Test\\Yourext\\": "web/typo3conf/ext/yourext/Classes" } } 然后你必须做一个作曲家更新或作曲家转储自动加载 If your extension is not installed with composer you have to add the autoload set ...
  • Kickstarter多年来一直被用来创建旧的学校扩展,因为几年来有创建扩展的新方法 - Extbase。 它使用MVC模式,基于FLOW3理念,因此它将在未来很长一段时间内使用。 使用最新版本的“Extension Builder”从存储库“kickstart”您自己的Extbase ext 编辑你需要花一些时间来学习它是如何工作的(尤其是存储库和模型),最好用少量字段创建一些简单的扩展,并尝试识别它的结构如何,你会很快熟悉。 然后使用Builder的“工作表视图 ”来“ 绘制 ”当前表的结构。 如果你仔 ...
  • 当你配置 array( 'GETvar' => 'tx_news_pi1[action]', ), array( 'GETvar' => 'tx_news_pi1[controller]', ), 说,行动和控制器的变量通过。 追加一个valueMap和noMatch,你可以删除它们: array( 'GETvar' => 'tx_news_pi1[action]', 'valueMap' => array(), 'noMat ...
  • 在TYPO3 7.6 LTS的核心文件中,数据库连接建立代码位于core / Classes / Database / DatabaseConnection.php中。 您不必创建此类的对象。 您可以从TYPO3 Globals Constant $ GLOBALS ['TYPO3_DB']获取数据库对象和连接参数。 请参阅点击此处 您可以使用此全局对象编写自定义mysql查询。 示例: $results = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows ( ...
  • 检查模板文件名的首字母大写。 规则是,对于名为fooBarAction()动作,模板文件必须命名为FooBar.html Check so template filename has first letter uppercase. The rule is that for action named fooBarAction() template file must be named FooBar.html
  • 如果您在typo3安装中创建了符号链接并且已经使用TYPO3版本8.7.x运行,则无需手动添加TYPO3源。 如果TYPO3版本在6.2.x运行,那么首先需要升级TYPO3版本7.6和TYPO3 8.7. 如果您的系统在6.2.x.运行,则无法升级Directly版本8.7 。 只需按照以下步骤操作即可。 登录TYPO3 BE并转到安装工具。 在重要操作中,您会看到“ 检查核心更新”按钮。 点击这里,在这里你可以找到最新的TYPO3版本。 下载最新的TYPO3版本。 单击将当前数据库与规范进行比较并更新ty ...
  • 在https://docs.typo3.org/typo3cms/extensions/extension_builder/上有一个“ExtensionBuilder 7.6.0”手册。 There is an "ExtensionBuilder 7.6.0" manual at https://docs.typo3.org/typo3cms/extensions/extension_builder/ .
  • 解决方案: index { queue { tx_myextension = 1 tx_myextension { fields { ... bild_stringS = FILES bild_stringS { references { ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)